> ## Documentation Index
> Fetch the complete documentation index at: https://onr.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> High-level request pipeline and provider selection.

## Request pipeline (simplified)

1. Auth (recommended: `Authorization: Bearer <access-key>`)
2. Provider selection
3. DSL execution in phases (`defaults` then selected `match`)
4. Upstream call and response strategy (passthrough / JSON map / SSE parse)
5. Optional usage extraction and pricing

## Provider selection priority

1. `x-onr-provider: <provider>` header (force)
2. `models.yaml` routing (per model round-robin)

## DSL phases (execution engine)

Typical phases:

* `upstream_config`: base URL
* `auth`: header shape and optional OAuth exchange
* `request`: header/query/JSON patching, request mapping
* `upstream`: set upstream path/query
* `response`: passthrough / resp\_map / sse\_parse
* `error`: error\_map
* `metrics`: usage extraction and finish\_reason extraction
