Coding agents burn tokens quietly. One developer’s afternoon with an agent loop can cost more than the rest of the team’s week, and nobody finds out until the invoice arrives.
The fix is not complicated. Every developer gets their own key, the team gets a budget, and CI gets a service account. VoidLLM has the pieces for that. This post shows how to set it up.
Since VoidLLM v0.0.32 that includes Claude Code and Codex CLI. Both talk to the proxy in their own API format, so their requests carry the same keys, model access, limits and usage tracking as everything else.
ℹNative endpoints in v0.0.32
VoidLLM now serves POST /v1/messages and POST /v1/messages/count_tokens (Anthropic Messages API, models with provider: anthropic) and POST /v1/responses (OpenAI Responses API, models with provider: openai, custom, vllm or ollama). They are forwarded in their own wire format, not translated. This is what Claude Code and Codex CLI use.
I ran VoidLLM v0.0.32 locally with SQLite and tried each client. Only things I ran are in this table.
| Client | Version | Result |
|---|---|---|
curl, OpenAI model (/v1/chat/completions) | - | Works |
curl, Anthropic model (/v1/chat/completions) | - | Works, VoidLLM translates to the Messages API |
curl, Anthropic model, POST /v1/messages with streaming | - | Works |
Claude Code, ANTHROPIC_BASE_URL at VoidLLM | 2.1.330 | Works |
| Claude Code, key with exhausted token budget | 2.1.330 | Stops at once: API Error: Request rejected (429) · token budget exceeded |
| Claude Code, VoidLLM as MCP server | 2.1.330 | Connected (claude mcp list) |
| Codex CLI, custom provider at VoidLLM | 0.169.1 | Works |
| Codex CLI, key with exhausted token budget | 0.169.1 | Stops at once: ERROR: Quota exceeded. Check your plan and billing details. |
| Cursor | - | Not tested |
| Windsurf | - | Not tested |
Cursor is a different question. Cursor’s docs say requests made with your own API key go through Cursor’s servers, and the current docs list OpenAI, Anthropic, Google, Azure and AWS Bedrock keys without describing a custom base URL. I did not test it. If your Cursor version has an OpenAI base URL setting, it has to reach your VoidLLM from the internet, which may not be what you want. The older post Connect Cursor, Windsurf, and Claude Code to VoidLLM describes that setting, so check it against your version.
Anything that speaks Chat Completions and lets you set a base URL also works, the same way as in Drop-In Replacement for the OpenAI SDK.
Each developer is a user in your org, with their own vl_uk_ key. Usage is attributed to the person, and when someone leaves you remove them and their keys stop working.
Create the user, add them to the team, and create a key that counts against the team:
curl -X POST $VOIDLLM/api/v1/users \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "dev@example.com",
"display_name": "Dev One",
"password": "a-long-initial-password",
"org_id": "'$ORG_ID'",
"role": "member"
}'
curl -X POST $VOIDLLM/api/v1/orgs/$ORG_ID/teams/$TEAM_ID/members \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"user_id": "'$USER_ID'", "role": "member"}'
curl -X POST $VOIDLLM/api/v1/orgs/$ORG_ID/keys \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "dev-laptop",
"key_type": "user_key",
"user_id": "'$USER_ID'",
"team_id": "'$TEAM_ID'",
"daily_token_limit": 500000,
"requests_per_minute": 30
}'
The key is shown once. If you would rather not set initial passwords, invite links work too, see the RBAC docs.
Limits sit on four levels: org, team, the user’s org membership, and the key. Each level has daily and monthly token limits and requests per minute and per day. All of them are checked on every request, and the most restrictive one wins.
curl -X POST $VOIDLLM/api/v1/orgs/$ORG_ID/teams \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Platform",
"slug": "platform",
"daily_token_limit": 2000000,
"monthly_token_limit": 40000000,
"requests_per_minute": 120
}'
Here is what I saw with deliberately tiny limits:
requests_per_minute: 429 with rate_limit_exceeded.daily_token_limit: 429 with token_limit_exceeded.token_limit_exceeded.Two things to know. A change to a team’s limit is not instant: in my test the first request after lowering it still went through, and the following ones were rejected after the cache refresh (default 30 seconds, cache.key_ttl). And the limits are tokens and requests, not dollars. Cost numbers in the usage views are estimates.
The longer version is in Hard Monthly LLM Budget Caps per Team and LLM Cost Allocation per Team: Budgets, Caps and Chargebacks.
Pipelines should not run on a person’s key. Create a service account for the team and give it its own key and budget:
curl -X POST $VOIDLLM/api/v1/orgs/$ORG_ID/service-accounts \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "ci-bot", "team_id": "'$TEAM_ID'"}'
curl -X POST $VOIDLLM/api/v1/orgs/$ORG_ID/keys \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "ci-key",
"key_type": "sa_key",
"service_account_id": "'$SA_ID'",
"monthly_token_limit": 5000000
}'
The key is a vl_sa_ key, and its team comes from the service account. Deleting the service account stops its keys.
Coding agents will happily pick the most expensive model if you let them. A model allowlist on the team, or on a single key, limits that:
curl -X PUT $VOIDLLM/api/v1/orgs/$ORG_ID/teams/$TEAM_ID/model-access \
-H "Authorization: Bearer $ADMIN_KEY" \
-H "Content-Type: application/json" \
-d '{"models": ["gpt-4o-mini"]}'
A request for any other model gets 403 with model_access_denied, and GET /v1/models only lists what that key may use. An empty list means no restriction at that level.
Claude Code sends its requests to /v1/messages under ANTHROPIC_BASE_URL, see Anthropic’s gateway compatibility guide. Set the base URL to the VoidLLM root, without /v1, and the credential to a VoidLLM key:
export ANTHROPIC_BASE_URL=https://voidllm.example.com
export ANTHROPIC_AUTH_TOKEN=vl_uk_... # sent as Authorization: Bearer
# or
export ANTHROPIC_API_KEY=vl_uk_... # sent as x-api-key
Claude Code sends Anthropic model IDs, so the models it asks for must exist in VoidLLM with provider: anthropic, under that exact name or as an alias. To pin the models to names you have configured, set ANTHROPIC_MODEL (or use --model) and ANTHROPIC_DEFAULT_HAIKU_MODEL, see the Claude Code model configuration. /v1/messages/count_tokens is served too, and it creates no usage record.
Codex CLI uses the Responses API for a custom provider, see the Codex configuration reference. In ~/.codex/config.toml:
model = "your-model" # a VoidLLM model name or alias
model_provider = "voidllm"
[model_providers.voidllm]
name = "VoidLLM"
base_url = "https://voidllm.example.com/v1"
env_key = "VOIDLLM_API_KEY"
wire_api = "responses"
Then export VOIDLLM_API_KEY=vl_uk_.... The model must be a VoidLLM model or alias with provider: openai, custom, vllm or ollama, and the upstream has to implement /responses.
When a key’s token budget, or one inherited from its team, membership or org, is used up, VoidLLM answers 429 with x-should-retry: false and a Retry-After header set to the seconds until the budget resets. On /v1/responses the error also carries type: insufficient_quota. In my test both CLIs stopped with the error instead of retrying, as in the table above. A plain request rate limit sets Retry-After but not x-should-retry.
/v1/responses is stateless. VoidLLM sets store: false when the request does not set store, and rejects previous_response_id, conversation and background: true with 400 unsupported_parameter.POST is served on the native endpoints, so GET or DELETE /v1/responses/{id} are rejected./v1/messages yet. A model with provider bedrock or vertex answers a native request with 400 endpoint not supported for this model.anthropic-beta is forwarded only after validation: a comma-separated list of lowercase letters, digits and hyphens, at most 512 bytes. Anything else is dropped. Anthropic’s guide asks gateways to forward it verbatim, so check this if you rely on unusual beta flags.The step-by-step version, including which headers reach the provider, is in the docs: Coding Agents for Teams.
For other tools, an OpenAI-compatible client needs two variables:
export OPENAI_BASE_URL=https://voidllm.example.com/v1
export OPENAI_API_KEY=vl_uk_...
Use an alias such as fast as the model name, and you can change the model behind it later without touching any laptop.
Claude Code can also use VoidLLM as an MCP server. That gives it the management tools and any MCP servers you registered, see MCP Gateway: Give Your AI Tools a Single Front Door. It is independent of routing its model requests through VoidLLM, so you can use either or both.
One correction to my own older material: current Claude Code skips a remote server entry that has a url but no type. Add "type": "http". A .mcp.json you can commit to a repository:
{
"mcpServers": {
"voidllm": {
"type": "http",
"url": "${VOIDLLM_URL:-http://localhost:8080}/api/v1/mcp/voidllm",
"headers": {
"Authorization": "Bearer ${VOIDLLM_API_KEY}"
}
}
}
}
Each developer sets VOIDLLM_API_KEY to their own key, so nothing secret lands in the repo. Claude Code asks for approval the first time it sees a project server. The expansion syntax is in the Claude Code MCP docs. I checked this file with Claude Code 2.1.330 and claude mcp list showed the server as connected.
For a managed rollout, Anthropic documents managed settings and managed-mcp.json. I did not test a managed rollout with VoidLLM, so I am not going to hand you a snippet for it.
In the UI, Usage can be grouped by model, team, user, key, day or hour. Group by user and you see one row per developer. The same data from the API:
curl "$VOIDLLM/api/v1/orgs/$ORG_ID/usage?from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z&group_by=user" \
-H "Authorization: Bearer $ADMIN_KEY"
Each row has requests, prompt and completion tokens, an estimated cost and average duration. Service account usage shows up in its own row. If you want to bill teams internally, see LLM Chargeback and Cost Attribution for Engineering Teams.
VoidLLM never stores prompts or responses, on the native endpoints too. It reads the model field to route the request and streams everything else through memory. What it keeps is usage metadata: who, when, which model, token counts, duration. That is designed to support GDPR compliance, but metadata tied to a named developer can be personal data, so tell your team what is recorded. More in Zero-Knowledge by Architecture, Not by Policy.
Your model provider still sees the prompts, so your agreement with them applies.
Per-developer keys, team budgets, model allowlists and a CI service account now cover Claude Code and Codex CLI as well as Chat Completions clients, and you can see usage and estimated cost per key and per team. When a budget runs out, both CLIs stop right away. No prompt or response content is stored along the way.
The limits above are real, so read them before you plan a rollout. If you try a tool that is not in the table, tell me how it went in a GitHub issue.
Yes, since VoidLLM v0.0.32. Set ANTHROPIC_BASE_URL to the VoidLLM root (without /v1) and ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY to a VoidLLM key. Claude Code sends its requests to /v1/messages, which VoidLLM forwards natively to models with provider anthropic. We tested Claude Code 2.1.330.
Yes, since VoidLLM v0.0.32. Add a model provider to ~/.codex/config.toml with a base_url ending in /v1, wire_api = "responses" and an env_key that holds a VoidLLM key. VoidLLM forwards /v1/responses to models with provider openai, custom, vllm or ollama. We tested Codex CLI 0.169.1.
VoidLLM answers 429 with x-should-retry: false and a Retry-After header. In our test both Claude Code and Codex CLI stopped immediately with the error instead of retrying.
Create a user per developer, add them to a team, and create a user key (vl_uk_) with the team_id set. Limits can sit on the org, team, user membership and key. Every level is checked on each request and the most restrictive one wins.
No. VoidLLM reads the model field to route a request and streams the rest through memory. It stores usage metadata: who, when, which model, token counts and duration. Your model provider still sees the prompts.
Step-by-step setup for using VoidLLM as your LLM proxy in Cursor and Windsurf, and as an MCP server in Claude Code.
VoidLLM's Code Mode lets AI agents orchestrate multiple MCP tool calls in a single WASM-sandboxed JavaScript execution. No round-trips, no latency penalty.
MCP tools advertise inputs but not outputs. We taught Code Mode to learn return types from the first successful call and surface them as TypeScript on the next discovery.
Use VoidLLM as a drop-in replacement for the OpenAI SDK: change base_url and the API key, keep streaming and tool calls, and route to Anthropic, Azure, Bedrock or vLLM.