Skip to content
WORKSI AI Control

01Connect

One base URL. Eight checks. Then your provider.

The gateway speaks the OpenAI API and Anthropic’s Messages API, and routes to 24 provider presets. On the way through, every request is checked, priced and recorded.

Your app

any OpenAI clientSDK, MCP or OTel

Worksi gateway

adds 0.82 ms at p95note 1

  1. 1. Body size413
  2. 2. API key401
  3. 3. Model403
  4. 4. Pause, stop423409
  5. 5. Plan & policy402403429
  6. 6. Rate limit429
  7. 7. Provider502504
  8. 8. Price & recordspanasync: never delays or fails the requestSpan recorded: traces, incidents, ROI

response, unchanged + X-AIW-Trace-Id, X-AIW-Cost-USD

Your provider

OpenAI, Claude, DeepSeek, Qwen, Ollama, vLLM

What happens on every request, in order. Next to each check: the status the gateway returns if it fails.Under each check: the status the gateway returns if it fails.
Retries, then fallbacks
Up to two retries with backoff on connection errors, 429 and 5xx, then the fallback models you chose. Never after the first streamed byte.
Errors you can handle
OpenAI‑ or Anthropic‑shaped error bodies with a request id, recorded as blocked spans so they are traced and counted.
Your key, your provider
Any of 24 presets, from Anthropic and OpenAI to DeepSeek, Qwen and a local Ollama, or any OpenAI‑compatible server, with your own key. No token mark‑up.

The APIs your code already uses.

Point any OpenAI SDK at the gateway, or the Anthropic SDK at the gateway root, and keep your code. Requests and responses keep their shapes.

Supported endpoints
EndpointSupports
POST /v1/chat/completionsStreaming and non‑streaming, with usage captured for streams too
POST /v1/responsesThe Responses API, streaming and non‑streaming
POST /v1/embeddingsThe embedding models in your model registry
POST /v1/messagesAnthropic’s Messages API, native, for Claude
GET /v1/modelsOnly the models this key may use
  • A route prefix picks the provider per call: deepseek/deepseek-flash goes to your DeepSeek credential.
  • Claude answers Chat Completions too (anthropic/claude-sonnet-5): the gateway translates each call to the Messages API and back.
  • Streaming works with every provider, and tool calls with every model that supports them, both translated for Claude. The Responses API and embeddings work where the provider serves them.
  • Anthropic‑style clients can send the key in x-api-key, Azure‑style clients in api-key.
  • Every response carries X-AIW-Trace-Id, and non‑streaming responses carry X-AIW-Cost-USD: the cost in USD, from list prices in USD or CNY.

Guardrails, on every model call.

Configured in the console, enforced at the gateway and changed without a redeploy. A refused request is still recorded, so blocked traffic shows up in your traces.

Guardrails and the status the gateway returns when one is enforced
GuardrailStatus when enforced
Model allow and deny lists403 model_not_allowed
Spend limits402 budget_exceeded
Token limits403 token_limit_exceeded
Rate limits, with Retry-After429 rate_limited
Pause an agent or workflow, stop a run423 agent_paused423 workflow_paused409 run_stopped
Approval for sensitive models403 approval_required
End‑user quotas from your own plans429 end_user_quota_exceeded
Your Worksi plan and its monthly quota402 subscription_inactive429 plan_quota_exceeded

Streaming, embeddings, attribution headers.

Everything your OpenAI client already does works through the gateway. Two optional headers tell Worksi which agent and workflow made each call.

Streaming
Server-sent events pass through as they arrive; tokens and cost are recorded on the span.
Embeddings
Priced and traced like any other call, from your model registry.
Attribution
X-AIW-Agent, X-AIW-Workflow and more. The SDKs set them for you.
Attribution headers
import osfrom openai import OpenAI client = OpenAI(    base_url="https://gateway.worksi.ai/v1",    api_key=os.environ["AIW_API_KEY"],    # name the agent and the workflow behind every call    default_headers={        "X-AIW-Agent": "support-bot",        "X-AIW-Workflow": "customer-chat",    },) reply = client.chat.completions.create(    model="gpt-5-mini",    messages=[        {"role": "user", "content": "Where is my order?"},    ],)print(reply.choices[0].message.content)

Benchmark · 24 September 2026

Measured overhead, with the method.

Results of our own load test of the gateway and span ingestion. In production, latency is dominated by your model provider.

0.82ms

Gateway overhead, p95

Non-streaming chat completions ramped to 200 requests/s; 55,806 requests, 0 failures.

Gateway and ingestion
MetricResultConditions
Streaming time to first byte, p951.09msStreaming chat completions ramped to 100 streams/s; 27,906 streams, 0 failures.
Span ingestion on one replica2,000spans/s360,000 spans in batches of 100; p95 request time 6.9 ms, 0 rejected spans.

Note 1: How we measured

Single-replica Docker Compose stack on a 12 vCPU / 16 GB Linux host (gateway limited to 1.5 CPU / 512 MiB), load generated with k6. The built‑in simulator provider answered model calls with a pinned 1 ms latency so the gateway’s own overhead could be isolated. Gateway overhead is the request duration minus the simulated provider latency, so it covers everything the gateway itself does: key lookup, configuration, model resolution, controls, policies, rate limits, counters and span emission. Measured on 24 September 2026.

Not covered

  • Real provider latency and errors (simulator only).
  • Multiple replicas.
  • Cloud networking, TLS termination and managed data stores.
  • Multi-hour soak tests.

Telemetry never sits on the request path: if the telemetry pipeline is unavailable, the gateway buffers spans and your requests continue.

Send one request, read the headers.

Every response carries its trace id, and non‑streaming responses their cost, so you can find the call in the console in one click.

Terminal
curl -si https://gateway.worksi.ai/v1/chat/completions \  -H "Authorization: Bearer $AIW_API_KEY" \  -H "Content-Type: application/json" \  -d '{"model": "gpt-5-mini", "messages":       [{"role": "user", "content": "Hi"}]}' HTTP/1.1 200 OKX-AIW-Trace-Id: …X-AIW-Cost-USD: …