ShareAI Platform Docs

Provider policy reference

Reference the ShareAI provider fields, defaults, limits and errors for choosing execution providers in inference requests.

View as Markdown
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.

FieldTypeBehavior
onlyarray of provider tagsRestrict execution to these providers.
ignorearray of provider tagsExclude these providers, including from fallback.
orderarray of provider tagsRank these providers first in the supplied order; then apply sorting.
allow_fallbacksboolean; default trueAllow other eligible providers. With false and a nonempty order list, only listed providers remain; without order, only the first-ranked provider remains.
networksarrayRestrict provider types to community, company and/or shareai.
sortstring or objectUse 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#

SortDefault directionExplicit reverse
priceasc — lowest firstdesc — highest first
latencyasc — shortest elapsed time firstdesc — longest first
throughputdesc — most output tokens per second firstasc — 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

ShareAI Platform Docs
All documentation

Search by title or content.

Ask about this page

Choose an assistant to explore this page. You can also copy the page and paste it into your conversation.

Ask ChatGPTAsk ClaudeAsk GrokAsk ShareAI