Keep your code. Change two values.
Point any OpenAI client at your gateway and use a Worksi API key. Every model call is then checked, priced and traced, in any language that speaks HTTP.
AIW is the prefix for Worksi keys, headers and packages.
import osfrom openai import OpenAI client = OpenAI( base_url="https://api.openai.com/v1", base_url= "https://gateway.worksi.ai/v1", api_key=os.environ["OPENAI_API_KEY"], api_key=os.environ["AIW_API_KEY"],)import OpenAI from "openai" const client = new OpenAI({ baseURL: "https://api.openai.com/v1", baseURL: "https://gateway.worksi.ai/v1", apiKey: process.env.OPENAI_API_KEY, apiKey: process.env.AIW_API_KEY,})URL=https://api.openai.com/v1URL=https://gateway.worksi.ai/v1KEY=$OPENAI_API_KEYKEY=$AIW_API_KEY curl "$URL/chat/completions" \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -d '{"model": "gpt-5-mini", "messages": [{"role": "user", "content": "Hi"}]}'The endpoints your code already calls.
Requests and responses keep their OpenAI or Anthropic shape, so the official SDKs and the tools built on them work unchanged.
| Endpoint | Supports |
|---|---|
POST /v1/chat/completions | Streaming and non‑streaming, with tool calling and structured outputs where the provider supports them |
POST /v1/responses | The Responses API, streaming and non‑streaming, where the provider serves it |
POST /v1/embeddings | Embedding models from your model registry, where the provider serves them |
POST /v1/messages | Anthropic’s Messages API, native, for Claude |
GET /v1/models | The models this key may use |
- Claude answers Chat Completions too: the gateway translates each call to Anthropic’s Messages API and back.
- Code written for the Anthropic SDK keeps working: set the SDK’s base URL to the gateway root, without
/v1.
Attribute every call.
Optional headers name the agent, the workflow and your end user behind a request. Reports, policies and quotas use them.
| Header | Purpose |
|---|---|
X-AIW-Agent | The agent making the call, for per‑agent policies and reports |
X-AIW-Workflow | The business workflow the call belongs to |
X-AIW-Run-Id | The workflow run the call belongs to; it defaults to the trace id |
X-AIW-End-User | A pseudonymous id of your end user, never an email address |
X-AIW-End-User-Plan | That user’s plan in your app, for per‑user quotas |
X-AIW-Capture | Makes capture stricter for this call, never looser |
Route to the provider you choose.
Add each provider once in the console. deepseek/deepseek-flash sends a call to your DeepSeek credential, and your applications only ever hold a Worksi key.
24 presets from the provider catalog, 23 of them with list prices per 1M tokens from the vendor’s own pages, checked 29 September 2026. Costs are always in USD: CNY prices are converted at 0.1375 USD per yuan by default, an approximate rate.
Providers and routing docsGlobal9 presets
| Provider | Route prefix | Catalog |
|---|---|---|
| OpenAIChat Completions, Responses, Embeddings | openai/ | 7 models, USD |
| Anthropic ClaudeChat Completions, Messages | anthropic/ | 8 models, USD |
| Google Gemini APIChat Completions, Embeddings | gemini/ | 10 models, USD |
| Mistral AIChat Completions, Embeddings | mistral/ | 8 models, USD |
| xAI GrokChat Completions, Responses | xai/ | 6 models, USD |
| GroqChat Completions, Responses | groq/ | 4 models, USD |
| Together AIChat Completions | together/ | 8 models, USD |
| OpenRouterChat Completions, Embeddings | openrouter/ | 8 models, USD |
| Azure OpenAI (Microsoft Foundry)Chat Completions, Responses, Embeddings | azure-openai/ | 6 models, USD |
China13 presets
| Provider | Route prefix | Catalog |
|---|---|---|
| DeepSeekChat Completions, Responses | deepseek/ | 2 models, USD or CNY |
| Qwen (Alibaba Cloud Model Studio, China)Chat Completions, Responses, Embeddings | qwen/ | 7 models, CNY |
| Qwen (Alibaba Cloud Model Studio, International)Chat Completions, Responses, Embeddings | qwen-intl/ | 7 models, USD |
| Moonshot AI Kimi (China)Chat Completions, Responses | kimi/ | 4 models, CNY |
| Moonshot AI Kimi (International)Chat Completions, Responses | kimi-intl/ | 4 models, USD |
| Zhipu GLM (BigModel, China)Chat Completions, Embeddings | zhipu/ | 7 models, CNY |
| Z.ai GLM (International)Chat Completions | zai/ | 7 models, USD |
| MiniMaxChat Completions, Responses | minimax/ | 5 models, USD or CNY |
| Baidu Qianfan (ERNIE)Chat Completions, Responses, Embeddings | qianfan/ | 8 models, CNY |
| Tencent Hunyuan (TokenHub)Chat Completions, Responses, Embeddings | hunyuan/ | 8 models, USD or CNY |
| ByteDance Doubao (Volcengine Ark)Chat Completions, Responses | doubao/ | 7 models, CNY |
| BytePlus ModelArk (Seed, International)Chat Completions, Responses | byteplus/ | 5 models, USD |
| StepFunChat Completions, Responses | stepfun/ | 4 models, USD or CNY |
Local and self‑hosted2 presets
| Provider | Route prefix | Catalog |
|---|---|---|
| OllamaChat Completions, Responses, Embeddings | ollama/ | 24 models, USD |
| vLLMChat Completions, Responses, Embeddings | vllm/ | Models you serve |
- Any other server that speaks the OpenAI API, at the base URL you register, with prices you set.
- The built‑in simulator: offline, free and deterministic, with failures on request through
X-AIW-Simulate.
What you get without touching anything else.
The requests your code already sends, now through the gateway.
- A trace for every call, with latency, tokens and cost.
- Model allow and deny lists, budgets, token and rate limits.
- Pause and stop controls that take effect within seconds.
- Redaction of sensitive values before anything is stored.
- Incidents for provider outages, timeouts, cost spikes and policy violations.
- Errors in the OpenAI shape, with codes such as
model_not_allowedoragent_pausedthat your code can handle.
curl -sN https://gateway.worksi.ai/v1/chat/completions \ -H "Authorization: Bearer $AIW_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "gpt-5-mini", "stream": true, "messages": [{"role": "user", "content": "Count to five"}]}'curl -s https://gateway.worksi.ai/v1/embeddings \ -H "Authorization: Bearer $AIW_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "text-embedding-3-small", "input": "refund policy"}'curl -s https://gateway.worksi.ai/v1/models \ -H "Authorization: Bearer $AIW_API_KEY"Change two values and ship.
Set the base URL and the key. Your prompts, models and response handling stay exactly as they are.
- 3‑day trial with Pro features, no card.
Keep readingSDKsAI gatewayB2C apps
import OpenAI from "openai" const client = new OpenAI({ baseURL: "https://gateway.worksi.ai/v1", apiKey: process.env.AIW_API_KEY,})