ShareAI Platform Docs

Choose execution providers for an API request

Use the ShareAI provider object to select execution providers independently from a model’s creator across all four inference endpoints.

View as Markdown
On this page

Set model to the exact creator-based identifier. Add provider when you want to restrict or rank the infrastructure eligible to execute the request. Omitting it uses the default price-ascending policy.

Use one provider#

cURL

curl --fail-with-body --request POST \
  "https://api.shareai.now/api/v1/chat/completions" \
  -H "Authorization: Bearer $SHAREAI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "provider": {
    "only": [
      "shareai"
    ],
    "allow_fallbacks": false
  },
  "model": "openai/gpt-5.4",
  "messages": [
    {
      "role": "user",
      "content": "Explain model routing in one sentence."
    }
  ]
}'

Use provider tags shown for the selected model. only is a hard restriction: allowing fallbacks never permits a provider outside this list.

Use the same policy on each inference endpoint#

EndpointMain input fieldChoose a model that supports
/api/v1/chat/completionsmessagesChat completion
/api/v1/responsesinputResponses
/api/v1/embeddingsinputEmbeddings
/api/v1/images/generationspromptImage generation

The provider policy has the same meaning on these endpoints. Model and provider capabilities differ: a chat model is not automatically an embedding or image model. Copy an eligible identifier for the operation from the catalog; native endpoints require configured support.

Prefer named providers#

JSON

{
  "provider": {
    "order": [
      "PROVIDER_A",
      "PROVIDER_B"
    ],
    "allow_fallbacks": false,
    "sort": {
      "by": "price",
      "direction": "asc"
    }
  }
}

Replace PROVIDER_A and PROVIDER_B with real lowercase provider tags. With this ordered list and fallbacks disabled, only those listed providers are eligible, in that order. The second listed provider can still be selected if the first is unavailable.

Keep credential restrictions#

Your request can narrow an API key’s permitted models and providers. It cannot grant access outside those permissions. OAuth consent, billing eligibility and device availability continue to apply.

Next#

Every provider field · Sort order and fallback behavior

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