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.
- Pick a preset and its region. The form shows the base URL of that region.
- Paste the provider’s API key. Regions that need none, such as a local Ollama server, hide the field.
- 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.
- 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#
| Provider | Route prefix | Serves | Catalog prices |
|---|---|---|---|
| OpenAI | openai | Chat Completions, Responses, Embeddings | 7 models, USD |
| Anthropic Claude | anthropic | Chat Completions, Messages | 8 models, USD |
| Google Gemini API | gemini | Chat Completions, Embeddings | 10 models, USD |
| Mistral AI | mistral | Chat Completions, Embeddings | 8 models, USD |
| xAI Grok | xai | Chat Completions, Responses | 6 models, USD |
| Groq | groq | Chat Completions, Responses | 4 models, USD |
| Together AI | together | Chat Completions | 8 models, USD |
| OpenRouter | openrouter | Chat Completions, Embeddings | 8 models, USD |
| Azure OpenAI (Microsoft Foundry) | azure-openai | Chat Completions, Responses, Embeddings | 6 models, USD |
China#
| Provider | Route prefix | Serves | Catalog prices |
|---|---|---|---|
| DeepSeek | deepseek | Chat Completions, Responses | 2 models, USD or CNY |
| Qwen (Alibaba Cloud Model Studio, China) | qwen | Chat Completions, Responses, Embeddings | 7 models, CNY |
| Qwen (Alibaba Cloud Model Studio, International) | qwen-intl | Chat Completions, Responses, Embeddings | 7 models, USD |
| Moonshot AI Kimi (China) | kimi | Chat Completions, Responses | 4 models, CNY |
| Moonshot AI Kimi (International) | kimi-intl | Chat Completions, Responses | 4 models, USD |
| Zhipu GLM (BigModel, China) | zhipu | Chat Completions, Embeddings | 7 models, CNY |
| Z.ai GLM (International) | zai | Chat Completions | 7 models, USD |
| MiniMax | minimax | Chat Completions, Responses | 5 models, USD or CNY |
| Baidu Qianfan (ERNIE) | qianfan | Chat Completions, Responses, Embeddings | 8 models, CNY |
| Tencent Hunyuan (TokenHub) | hunyuan | Chat Completions, Responses, Embeddings | 8 models, USD or CNY |
| ByteDance Doubao (Volcengine Ark) | doubao | Chat Completions, Responses | 7 models, CNY |
| BytePlus ModelArk (Seed, International) | byteplus | Chat Completions, Responses | 5 models, USD |
| StepFun | stepfun | Chat Completions, Responses | 4 models, USD or CNY |
Local and self‑hosted#
| Provider | Route prefix | Serves | Catalog prices |
|---|---|---|---|
| Ollama | ollama | Chat Completions, Responses, Embeddings | 24 models, USD |
| vLLM | vllm | Chat Completions, Responses, Embeddings | Models 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:
model | Goes to | Upstream model |
|---|---|---|
anthropic/ | Your credential with the prefix anthropic | claude-sonnet-5 |
deepseek/ | Your credential with the prefix deepseek | deepseek-flash |
ollama/ | Your credential with the prefix ollama | llama3.1 |
groq/ | Your credential with the prefix groq | openai/ |
| A model id or alias from your registry | That model’s credential, else your default | The model’s upstream id |
| Anything else | Your default credential | Unchanged |
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"}]}'curl -s https://gateway.worksi.ai/v1/chat/completions \ -H "Authorization: Bearer $AIW_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "deepseek/deepseek-flash", "messages": [{"role": "user", "content": "Hi"}]}'curl -s https://gateway.worksi.ai/v1/chat/completions \ -H "Authorization: Bearer $AIW_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "ollama/llama3.1", "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=catalogalso 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_effortmaps to Claude’s thinking and effort settings.- Anthropic requires
max_tokens. When you send none, the gateway sets one and says so in theX-AIW-Max-Tokens-Defaultedheader. nabove 1 and a JSONresponse_formatanswer400 invalid_request. For structured output, use a tool withstrict: 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 asthinkingorcache_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"}],)import Anthropic from "@anthropic-ai/sdk" // the gateway root, without /v1const client = new Anthropic({ baseURL: "https://gateway.worksi.ai", apiKey: process.env.AIW_API_KEY,})const message = await 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
4xxerrors never fall back. - The response carries
X-AIW-Fallback-Fromwith 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: offturns 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-USDcarries 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.