Upstreams are the real provider endpoints behind platform models. Create an upstream, add one or more API keys, set protocols and timeouts, sync its remote models, and manage route bindings.
Where to find it#
Open the admin console and select Upstreams. The toolbar has search, Status and Compatibility filters, sorting, Sync, and bulk actions. The Automatic circuit breaker switch at the top right controls whether circuit state is shown and used.
| Column | Meaning |
|---|---|
| ID | Upstream ID. |
| Name | Display name. |
| URL | Base URL. |
| Compatibility / Protocol | Compatibility label and the number of per-kind protocol defaults. |
| Status | Active, Disabled, or Circuit open. |
| Models | Active {active} / Total {total}. |
| Timeouts | C {connect}s / R {read}s / S {stream idle}s. |
| Updated at | Last update time. |
Create an upstream#
- Click Create.
- Enter Name and Base URL, for example
https://api.example.com/v1. - Paste API keys under API keys (multi-key rotation), one key per line.
- Choose Compatibility and Status.
- Expand Default protocols, Timeouts, Circuit breaker, and Request headers to set optional values.
- Click Create.
Name, base URL, and at least one API key are required on create. Keys are stored as a rotation list with the round_robin strategy, so requests spread across the configured keys.
Edit an upstream and rotate keys#
Open Edit from the row menu. The form loads the current values, but plaintext keys are never shown.
- To add keys, paste new keys under Add API keys. They are appended to the rotation list.
- Each existing key shows a masked value and a delete action. Deleting marks the key for removal and takes effect after saving.
- At least one active key must remain. If you delete the last one, add a new key before saving, or the save is rejected with Keep at least one API key, or enter new API keys before saving.
| Field | Notes |
|---|---|
| Name | Required. |
| Base URL | Required. Provider endpoint root. |
| API keys | One key per line. Rotation is round-robin. |
| Compatibility | OpenAI, Anthropic, Google, xAI, OpenRouter, or Custom. |
| Status | Active or Disabled. |
| Default protocols | Per-kind default protocol. |
| Timeouts | Connect, read, and stream idle timeouts in milliseconds. |
| Circuit breaker | Failure thresholds, threshold logic, duration, and rolling window. |
| Request headers | JSON object of extra headers. |
Set per-kind default protocols#
Expand Default protocols to set the protocol used for each kind when a route does not specify one. Kinds are Chat, Audio, Image generation, Image editing, Video generation, and Video extension. Each kind lists only the protocols that apply to it. Leave a kind on System default to let the backend infer the protocol from the compatibility type.
Configure timeouts#
| Field | Unit | Purpose |
|---|---|---|
| Connect timeout | ms | Time allowed to establish the connection. |
| Read timeout | ms | Time allowed to read the first response. |
| Stream idle timeout | ms | Maximum gap between stream chunks before the stream is treated as stalled. |
Blank values use the system default. The list column shows the configured values in seconds.
Configure the circuit breaker#
Circuit breaker settings take effect only when Automatic circuit breaker is enabled.
| Field | Meaning |
|---|---|
| Failure threshold | Open the upstream circuit when failures in the window reach this value. 0 disables it. |
| Model failure threshold | Open the upstream circuit when this many models are already open. 0 disables it. |
| Threshold logic | OR opens when any condition is met; AND requires both. |
| Circuit duration | How long the circuit stays open, in minutes. |
| Circuit rolling window | Window used to count failures, in minutes. |
A circuit-open upstream stops receiving new requests until the duration ends or you reset it. The row shows an Expected recovery time in the tooltip.
Add request headers#
Expand Request headers and edit the JSON object. Quick fill adds common presets without overwriting existing headers:
| Preset | Header |
|---|---|
| Conversation ID | X-Conversation-Id |
| Session key | X-Session-Id |
| Request ID | X-Request-Id |
| OpenAI diagnostic request ID | X-Client-Request-Id |
| Codex-compatible session affinity | session-id, thread-id, x-client-request-id |
If a preset uses a name that already exists with another value, the fill is rejected with a conflict message. Fix the JSON first if the editor cannot parse it.
Sync remote models#
- Open Sync from the row menu, or click Sync in the model management dialog.
- Wait for the remote catalog to load. The header summarizes the planned changes: Add, Update, Restore, Deactivate, Unchanged, and Preserve.
- Review the remote models, select the ones to bind, and edit each Platform model name.
- Optionally choose Add to groups to place imported models into permission groups.
- Click Apply sync.
If the sync would deactivate models that the upstream no longer returns, a confirmation explains the impact. Deactivation only changes the upstream catalog status; platform models and route bindings are kept, and models are restored automatically if the upstream returns them later.
After binding, the summary reports imported, failed, created platform models, created routes, and reused routes. Use Reload to fetch the remote catalog again.
Manage route bindings#
Open Manage models from the row menu. The dialog lists the bindings for this upstream.
- Search by upstream model, platform model, protocol, or status.
- Filter by Route status, Upstream status, and Protocol, and sort as needed.
- Toggle a route with the switch, edit the Platform model name, or change Protocol and Kind.
- Use the bulk controls to apply route status, protocol, or kind to selected rows.
- Click Save.
To create a binding manually, click Create, enter the Upstream model name and Platform model name, choose Protocol, Kind, and Status, then Save. An active route requires a platform model name; to unbind, disable the route first. Deleting bindings keeps the upstream model catalog, so you can rebind by syncing later.
Open or reset a circuit#
When Automatic circuit breaker is enabled, the row menu shows Open circuit or Reset circuit depending on the current state.
- Open circuit now stops new requests until the duration ends or you reset it.
- Reset circuit resumes requests immediately.
Both actions ask for confirmation. Use manual open during provider maintenance, credential problems, or network issues, and reset only after confirming recovery.
Bulk status and delete#
Select rows with the checkboxes.
- To change status, pick Active or Disabled in the bulk status control and click Apply, then confirm.
- To delete, click Delete, then confirm. Deleting an upstream removes its route bindings but keeps the model catalog.
Bulk actions report how many items succeeded and how many failed.
Troubleshooting#
| What you see | What to check |
|---|---|
| Failed to load upstreams | Refresh. If the session expired, sign in again. |
| Could not create or update upstream | Check the name, base URL, and keys. At least one key must remain. |
| Circuit open on an upstream | Check provider status and credentials, then reset the circuit after recovery. |
| Sync shows deactivated models | The upstream no longer returns them. They are restored automatically on a later sync. |
| A model route is unavailable | The upstream or upstream model is disabled, or the route is inactive. |
| Model sync failed | Verify the base URL, keys, and compatibility, then retry. |