Skip to content

Providers & routing

Connect any of 24 provider presets or your own OpenAI‑compatible server, pick the provider per call with a route prefix, add fallback models and read every cost in USD.

On this page

One Worksi API key reaches every provider your organization connects. The gateway picks the provider from the model string, translates Claude calls when your code speaks the OpenAI API, falls back to other models when a provider fails, and prices every call in USD.

Connect a provider#

Open Settings → Providers → Add provider. The gallery lists the presets of the provider catalog in four groups (Global, China, Local and Self‑hosted), then a custom OpenAI‑compatible or Anthropic endpoint and the built‑in simulator.

  1. Pick a preset and its region. The form shows the base URL of that region.
  2. Paste the provider’s API key. Regions that need none, such as a local Ollama server, hide the field.
  3. Press Test connection. Most presets list their models. Presets without a model list send one 8‑token chat request instead, which the provider may bill, and Azure OpenAI needs one of your deployment names as the test model. Nothing is stored until you save.
  4. Save, then press Import models to register the models you use, with their catalog list prices.

Every organization starts with the simulator as its default provider. Make default on another credential sends models without a route prefix there. Provider keys and extra headers are encrypted at rest (AES-256-GCM) and never shown again. Your providers bill you directly: Worksi never resells or marks up model tokens.

Provider presets#

The provider catalog, last researched on 29 September 2026, records, for each preset, its regions and base URLs, the endpoints it serves and its models with list prices per 1M tokens, each with the vendor page it comes from and the date it was checked. What could not be verified is left out rather than guessed: OpenAI models the catalog does not list yet (the GPT-5 family and embeddings, for example) need the price you enter when you register them. A model called without a price is flagged "Price missing" on the Models and Cost pages, because its calls are recorded at $0; a model the catalog lists takes its official price in one click.

Global#

Global
ProviderRoute prefixServesCatalog prices
OpenAIopenaiChat Completions, Responses, Embeddings7 models, USD
Anthropic ClaudeanthropicChat Completions, Messages8 models, USD
Google Gemini APIgeminiChat Completions, Embeddings10 models, USD
Mistral AImistralChat Completions, Embeddings8 models, USD
xAI GrokxaiChat Completions, Responses6 models, USD
GroqgroqChat Completions, Responses4 models, USD
Together AItogetherChat Completions8 models, USD
OpenRouteropenrouterChat Completions, Embeddings8 models, USD
Azure OpenAI (Microsoft Foundry)azure-openaiChat Completions, Responses, Embeddings6 models, USD

China#

China
ProviderRoute prefixServesCatalog prices
DeepSeekdeepseekChat Completions, Responses2 models, USD or CNY
Qwen (Alibaba Cloud Model Studio, China)qwenChat Completions, Responses, Embeddings7 models, CNY
Qwen (Alibaba Cloud Model Studio, International)qwen-intlChat Completions, Responses, Embeddings7 models, USD
Moonshot AI Kimi (China)kimiChat Completions, Responses4 models, CNY
Moonshot AI Kimi (International)kimi-intlChat Completions, Responses4 models, USD
Zhipu GLM (BigModel, China)zhipuChat Completions, Embeddings7 models, CNY
Z.ai GLM (International)zaiChat Completions7 models, USD
MiniMaxminimaxChat Completions, Responses5 models, USD or CNY
Baidu Qianfan (ERNIE)qianfanChat Completions, Responses, Embeddings8 models, CNY
Tencent Hunyuan (TokenHub)hunyuanChat Completions, Responses, Embeddings8 models, USD or CNY
ByteDance Doubao (Volcengine Ark)doubaoChat Completions, Responses7 models, CNY
BytePlus ModelArk (Seed, International)byteplusChat Completions, Responses5 models, USD
StepFunstepfunChat Completions, Responses4 models, USD or CNY

Local and self‑hosted#

Local and self‑hosted
ProviderRoute prefixServesCatalog prices
OllamaollamaChat Completions, Responses, Embeddings24 models, USD
vLLMvllmChat Completions, Responses, EmbeddingsModels you serve

Every preset serves Chat Completions; for Anthropic the gateway translates it to the Messages API. A request for an endpoint its provider does not serve answers 400 unsupported_endpoint before any quota is used.

Route prefixes#

Every credential has a route prefix, unique in your organization: the preset’s by default, with -2, -3 and so on appended when it is taken. Settings → Providers shows it on each credential, with an example to copy. Send <route prefix>/<model> as the model and the call goes to that credential, with the rest of the string as the provider’s own model id:

Route prefixes
modelGoes toUpstream model
anthropic/claude-sonnet-5Your credential with the prefix anthropicclaude-sonnet-5
deepseek/deepseek-flashYour credential with the prefix deepseekdeepseek-flash
ollama/llama3.1Your credential with the prefix ollamallama3.1
groq/openai/gpt-oss-120bYour credential with the prefix groqopenai/gpt-oss-120b
A model id or alias from your registryThat model’s credential, else your defaultThe model’s upstream id
Anything elseYour default credentialUnchanged
curl -s https://gateway.worksi.ai/v1/chat/completions \  -H "Authorization: Bearer $AIW_API_KEY" \  -H "Content-Type: application/json" \  -d '{"model": "anthropic/claude-sonnet-5",       "max_tokens": 512,       "messages": [{"role": "user", "content": "Hi"}]}'
  • Model ids and aliases in your registry always win, even when they contain a /.
  • A prefixed model that is not in your registry works only when your organization allows unregistered models (Settings → Organization). It is then priced from the catalog when the preset lists it, and appears under Workforce → Discovered.
  • A prefix that names a disabled credential answers 502 provider_error. An explicit prefix never falls back to your default provider.
  • Model allow and deny lists, model approvals and end‑user plans match both the full string and the part after the prefix.
  • GET /v1/models?include=catalog also lists the unregistered catalog models of your preset credentials, when your organization allows unregistered models and the models pass your model policies.

Claude#

Through Chat Completions#

With an Anthropic credential, any OpenAI SDK can call Claude: the gateway translates the request to Anthropic’s Messages API and the answer back, streams included. System messages, tools and tool choice, images, PDFs and usage with cache tokens are translated.

  • reasoning_effort maps to Claude’s thinking and effort settings.
  • Anthropic requires max_tokens. When you send none, the gateway sets one and says so in the X-AIW-Max-Tokens-Defaulted header.
  • n above 1 and a JSON response_format answer 400 invalid_request. For structured output, use a tool with strict: true.
  • Parameters Claude does not accept are dropped or clamped into range, and named in response headers such as X-AIW-Params-Ignored.
  • With the OpenAI SDKs, extra_body={"anthropic": {...}} adds native Messages fields such as thinking or cache_control.
  • In tool loops with thinking, the gateway keeps the turn’s thinking blocks for 1 hour and sends them back with your tool results, because OpenAI clients drop them. They are never written to traces or logs.

The Messages API, natively#

POST /v1/messages accepts Anthropic’s Messages API unchanged, so code written for the official Anthropic SDKs keeps working. Set the SDK’s base URL to the gateway root, without /v1, and use your Worksi key as the API key:

import os from anthropic import Anthropic # the gateway root, without /v1client = Anthropic(    base_url="https://gateway.worksi.ai",    api_key=os.environ["AIW_API_KEY"],)message = client.messages.create(    model="anthropic/claude-sonnet-5",    max_tokens=1024,    messages=[{"role": "user", "content": "Hi"}],)
  • Streaming, tool use, thinking, prompt caching and token counting work as usual. Token counting is not metered.
  • Only Anthropic credentials and the simulator serve this endpoint. Other providers answer 400 unsupported_endpoint.
  • Gateway refusals use Anthropic’s error shape, with the gateway’s code in error.aiw_code, so the SDK raises its own typed errors.
  • The Worksi SDKs build this client for you with aiw.anthropic(), with the attribution headers of the current run: see the Python SDK and the TypeScript SDK.

Fallbacks#

A registry model can list up to three fallback models of the same type, in order, in Workforce → Models. When its provider still fails after the gateway’s retries (a connection error, a timeout, 429 or a 5xx) and nothing has been sent to your client yet, the gateway calls the fallbacks in turn:

  • A fallback is skipped when it is blocked or deprecated, its provider is disabled, it does not serve the endpoint or a policy refuses it. By default, at most two are called per request.
  • Streams fall back only before the first byte. Other 4xx errors never fall back.
  • The response carries X-AIW-Fallback-From with the model first resolved, and the trace records the chain and the reason.
  • The request counts once toward your plan. Spend and tokens count the call that answered.
  • If every fallback fails, you get the error of the first model.
  • X-AIW-Fallback: off turns fallbacks off for one request.

To rehearse it, send X-AIW-Simulate: error=503 to a model the simulator serves that has fallbacks: fault injection applies to the first call only, so a fallback answers.

Cost and currencies#

Each call is priced from its registry model or, for an unregistered model of a preset credential, from the catalog. The catalog keeps list prices in the vendor’s currency, USD or CNY. Costs are always reported in USD: CNY prices are converted at 0.1375 USD per CNY by default, an approximate rate the platform operator can change. The trace also keeps the cost in the native currency and the rate used.

  • Cached input, cache writes, reasoning output, price tiers by request size, dated price changes and off‑peak windows (DeepSeek) apply when the model defines them.
  • OpenRouter calls use the cost the provider reports.
  • Workforce → Models shows CNY prices with their USD equivalent and marks models whose catalog price changed since you imported them.
  • X-AIW-Cost-USD carries the cost on non‑streaming responses. Streams carry it on the trace.

Local and self‑hosted models#

Ollama and vLLM speak the OpenAI API. The hosted gateway reaches public addresses only, so expose your model server over HTTPS (behind a reverse proxy or a tunnel, for example) and set that URL as the credential’s base URL. Ollama’s cloud region needs no tunnel. Import the models your server lists: a model the catalog does not know needs a price, and 0 is allowed.

On a single‑tenant installation, an operator can allow a private host: the credential needs Allow private network, and the host must be on the platform’s allowlist. Cloud metadata and link‑local addresses are always refused, and the gateway never follows redirects.

Questions? Email info@xeoo.io.