OpenRouter provider restrictions: combine only with account rules
Define allowed providers per request, inspect model endpoints and account limits, and distinguish only from ordering and fallback controls.
Inspect the model-to-provider mapping · Put the allowance in this request · A request does not expand account permissions
At a glance
A model can have several hosting providers. OpenRouter provider.only limits providers for one request, while account-wide allowances restrict it further. This task uses the documented GPT-5 mini and Azure example to create a synthetic configuration and a scope/failure checklist. It controls providers, not model fallback, and proves no current account or endpoint availability. No request or credit use occurred.
Allowance checks
Inspect actual endpoints
Copy a current exact provider slug from the selected model page.
Intersect account and request
only narrows within account allowances; it cannot expand them.
Accept or fail explicitly
Stop if no eligible intersection exists rather than remove the restriction.
Inspect the model-to-provider mapping
Start with a selected model, allowed provider scope and current account rules. Model pages expose exact provider slugs. One provider may have variants or regions: a base slug matches eligible endpoints, while a specific variant needs a full slug. The example uses documented openai/gpt-5-mini and azure to explain configuration. Check current endpoints, account access and task needs before use; an example does not prove your request can run.
Put the allowance in this request
{
"model": "openai/gpt-5-mini",
"input": "Rewrite this synthetic sentence: The demo starts at noon.",
"provider": {
"only": [
"azure"
]
}
}
This body targets /api/v1/responses and contains a synthetic sentence. The documented only setting permits Azure for this request. If several permitted providers serve a model, default routing selects among them. No key or sending command is shown. Load the body through an existing client only after checking permissions and cost.
A request does not expand account permissions
| Account allowance | Request only | Expected decision |
|---|---|---|
| azure and another provider | azure | Still restricted to azure |
| Another provider, excluding azure | azure | No intersection; documented 404 |
| azure | azure and another provider | Account ceiling still permits only azure |
These are teaching sets, not observed account settings. Account-wide allowed providers form a ceiling and only narrows it. The source describes a 404 when none satisfies both. Account-wide ignored providers combine with request ignore. A request body alone cannot establish the effective set without account-rule inspection.
Ordering is not an exclusive allowance
order sets preference and normally permits later providers. Nonempty order with allow_fallbacks: false excludes other public-provider fallback, but private endpoints you can access remain eligible after the named order. Do not describe that combination as an exhaustive endpoint list. only is this task’s provider allowance mechanism. Region, variant and private-endpoint restrictions need full slugs and relevant policies; a base name does not establish a geographic boundary.
| Field | Meaning | Use here |
|---|---|---|
| only | Limits permitted providers | Request boundary |
| order | Prioritizes attempts | Not a boundary by itself |
| allow_fallbacks | Controls fallback with private-endpoint exceptions | Does not replace only |
| require_parameters | Excludes providers lacking requested parameters | Use for parameter needs; no correctness guarantee |
Verify configuration before accepting a result
Check model/slug correspondence, spelling, a nonempty account intersection and endpoint parameter support. If the caller has provider logs, inspect actual routing too; a model name alone cannot establish its provider. Without such evidence, deliver a configuration check rather than verified routing. Response facts need independent review even when routing meets the allowance.
Preserve constraints when a request fails
- For intersection-related 404, inspect account allowances, only and endpoints without silently removing restrictions.
- On provider unavailability or request failure, keep configuration and the real error, then stop consumption.
- For uncertain slugs, copy the exact model-page value rather than guess from brand names.
- Data-retention or regional requirements need their own policies; only does not establish ZDR or compliance.
Verification scope
The current source was read for only, order, endpoint matching, fallback disabling, account filters and parameter support. This original synthetic body was not sent. Account settings, provider responses and billing were not observed. Documented names establish neither current availability nor prices.
Article sources
Original editorial content; official descriptions and checking suggestions are distinguished.