Skip to content
WORKSI AI Control

Your customers’ AI, on your plans.

Give free users a taste and paying users more, without building a metering service. Send each user and their plan with the call, and Worksi enforces your limits per user.

free plan · over the limit
# the request carriesX-AIW-End-User: <hash of your user id>X-AIW-End-User-Plan: free # the gateway answersHTTP/1.1 429 Too Many RequestsRetry-After: <seconds until the limit resets>{  "error": {    "message": "end user \"u_…\" reached the requests per day limit of plan \"free\" (50 of 50; resets …, policy \"Plan limits for app users\")",    "type": "rate_limit_error",    "code": "end_user_quota_exceeded",    "param": null,    "aiw_request_id": "req_…",    "details": {      "plan": "free",      "limit": "requests_per_day",      "window": "day",      "max": 50,      "current": 50,      "resets_at": "…"    }  }}

Example response. The body format is the gateway’s.

One request, per‑user limits.

Two headers carry the user and their plan. The gateway resolves the plan from one policy and decides before your provider is called.

The plan comes from your end‑user quota policy. A model outside the plan gets 403 model_not_allowed. Your app sends a request with the X-AIW-End-User and X-AIW-End-User-Plan headers. The Worksi gateway resolves the user’s plan from your end‑user quota policy. Within the plan’s limits, the request is forwarded to your provider. Over a limit, the gateway answers 429 end_user_quota_exceeded with Retry-After, and your provider is never called.

Your plans, as one policy.

An end_user_quota policy maps your plan names to limits. Create it in the console or with the API.

  • Monitor mode first: see who would be limited, then enforce.
  • Refused calls never reach your provider and don’t count toward your Worksi request quota.
  • Usage per user: requests, tokens, cost, errors and last activity, by plan.
  • End‑user plans are included in every Worksi plan.
POST /api/v1/policies
{  "name": "Plan limits for app users",  "type": "end_user_quota",  "scope_type": "org",  "enforcement": "enforce",  "rules": {    "plans": {      "free": {        "requests_per_day": 50,        "tokens_per_day": 50000,        "models": ["gpt-5-mini"]      },      "pro": {        "requests_per_day": 2000,        "cost_usd_per_month": 20      }    },    "default_plan": "free"  }}
End-user quota rules
RuleMeaning
requests_per_dayModel calls per user per UTC day
tokens_per_dayInput and output tokens per user per UTC day
cost_usd_per_monthModel spend per user per calendar month
modelsThe only models the plan may use; others get 403
default_planThe plan for calls that name none, or an unknown one

What watches your users’ spend.

Four of the eleven built‑in detectors, with the conditions they fire on. Refused calls are recorded, so a surge of them is visible.

What watches your users’ spend
DetectorFires when
Policy violationpolicy_violationA request or tool call was blocked by, or broke, a policy
Cost anomalycost_anomalyCost per request jumps versus the agent’s 7-day baseline, or a run exceeds its cost limit
Budget thresholdbudget_thresholdSpend crosses a budget’s alert thresholds; an incident at 100%
Token anomalytoken_anomalyA call uses far more tokens than the agent normally does

Two headers on each call.

A pseudonymous user id in X-AIW-End-User, their plan in X-AIW-End-User-Plan. Any OpenAI SDK can send them.

Starter fits one app and its users: 100k gateway requests and 1M spans a month, 14‑day retention, end‑user plans. $9 / month.

Compare plans

SDK packages are distributed by Worksi. Request access. Any OpenAI or Anthropic SDK works with the gateway without them.

Your app
import osfrom openai import OpenAI client = OpenAI(    base_url="https://gateway.worksi.ai/v1",    api_key=os.environ["AIW_API_KEY"],) def answer(    user_id_hash: str,    user_plan: str,    messages: list[dict],) -> str | None:    headers = {        # a pseudonymous id, not an email        "X-AIW-End-User": user_id_hash,        # your own plan name, e.g. "free"        "X-AIW-End-User-Plan": user_plan,    }    res = client.chat.completions.create(        model="gpt-5-mini",        messages=messages,        extra_headers=headers,    )    return res.choices[0].message.content

Give your free tier a real limit.

Send the user’s id hash and plan name with each call. Over the plan’s limit, the gateway answers 429 before your provider is called.

  • 3‑day trial with Pro features, no card.

Keep readingAI chat & copilotsPricingGovernance

Terminal
curl https://gateway.worksi.ai/v1/chat/completions \  -H "Authorization: Bearer $AIW_API_KEY" \  -H "X-AIW-End-User: $USER_ID_HASH" \  -H "X-AIW-End-User-Plan: free" \  -H "Content-Type: application/json" \  -d '{"model": "gpt-5-mini", "messages":       [{"role": "user", "content": "Hi"}]}'