Provider policy reference
Reference the ShareAI provider fields, defaults, limits and errors for choosing execution providers in inference requests.
On this page
The optional provider object belongs at the top level of the inference request, alongside model. An empty object uses the defaults. It is separate from Provider Remote Access and its management credentials.
| Field | Type | Behavior |
|---|---|---|
only | array of provider tags | Restrict execution to these providers. |
ignore | array of provider tags | Exclude these providers, including from fallback. |
order | array of provider tags | Rank these providers first in the supplied order; then apply sorting. |
allow_fallbacks | boolean; default true | Allow other eligible providers. With false and a nonempty order list, only listed providers remain; without order, only the first-ranked provider remains. |
networks | array | Restrict provider types to community, company and/or shareai. |
sort | string or object | Use price, latency or throughput, or an object with by and direction. |
JSON
{
"provider": {
"ignore": [
"PROVIDER_TO_EXCLUDE"
],
"networks": [
"company",
"shareai"
],
"sort": {
"by": "throughput",
"direction": "desc"
},
"allow_fallbacks": true
}
}
Replace the placeholder with a real lowercase provider tag, or remove the ignore field. Network types select infrastructure categories; they do not identify model creators.
Sort defaults#
| Sort | Default direction | Explicit reverse |
|---|---|---|
price | asc — lowest first | desc — highest first |
latency | asc — shortest elapsed time first | desc — longest first |
throughput | desc — most output tokens per second first | asc — fewest first |
For an object, set by to one of these names and direction to asc or desc. See how measurements and fallback work.
Validation and errors#
- Use JSON booleans and arrays of lowercase provider tags. Do not send null for provider or sort.
- Only the listed fields are accepted; this is not a complete OpenRouter parameter implementation.
- The policy is limited to 8 KiB. The only, ignore and order lists each accept at most 100 tags.
- Invalid policies return HTTP 400. Forbidden credential scopes return HTTP 403. No eligible available provider returns HTTP 503.
A minimal policy#
JSON
{
"provider": {
"sort": "price"
}
}
When omitted entirely, provider selection also defaults to deterministic price-ascending ranking. Constraints always apply before ranking.
Last updated September 16, 2026