Gateway
One key for Claude, GPT, Grok and DeepSeek.
Point any OpenAI or Anthropic client at api.oneaiapikey.com. You pay per token from prepaid credits, at the rates on the models page, and every request shows up in your usage log.
curl https://api.oneaiapikey.com/v1/chat/completions \
-H "Authorization: Bearer $RELAYKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6.1-sol",
"messages": [{"role": "user", "content": "Hello"}]
}'curl https://api.oneaiapikey.com/v1/messages \
-H "x-api-key: $RELAYKIT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5",
"max_tokens": 512,
"messages": [{"role": "user", "content": "Hello"}]
}'- Protocols
- OpenAI + Anthropic
- Models
- 11 across 4 families
- Lowest input rate
- $0.24 / 1M tokens
- Smallest top-up
- $3
Request flow
What happens between your code and the model
The gateway is a thin, strict layer. It checks the key and its limits, forwards your request unchanged in meaning, streams the answer back and writes one line to your usage log. Nothing else sits in the path.
Protocols
Both request formats, same key
Claude models answer on both formats. GPT, Grok and DeepSeek models answer on the OpenAI format. Keep the SDK you already use and change two values: the base URL and the key.
Full API reference| Endpoint | Format | Used for |
|---|---|---|
| POST /v1/chat/completions | OpenAI | Chat with any model. Cursor, Cline, Kilo Code, OpenCode, Aider, Zed and the OpenAI SDKs. |
| POST /v1/responses | OpenAI | Responses API, used by Codex CLI with GPT models. |
| POST /v1/messages | Anthropic | Messages API for Claude Opus 5.5, Claude Sonnet 5, Claude Haiku 4.5 and Claude Sonnet 5.5. Claude Code and the Anthropic SDKs. |
| GET /v1/models | OpenAI | Lists the model ids your key is allowed to call. |
Base URLs
OpenAI SDKs and OpenAI-compatible tools
https://api.oneaiapikey.com/v1
Include /v1.
Anthropic SDKs and Claude Code
https://api.oneaiapikey.com
No /v1: the client appends /v1/messages.
Authentication on both: Authorization: Bearer sk-…. The Anthropic route also accepts x-api-key.
Streaming
Tokens as they are written
- Set
"stream": trueon either format and readtext/event-stream. The SDKs parse it for you. - On the OpenAI format,
stream_options.include_usageadds a final chunk with the token counts you are billed for. - Coding agents stream by default, which is why long agent turns do not time out.
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.oneaiapikey.com/v1", api_key=os.environ["RELAYKIT_API_KEY"])
stream = client.chat.completions.create(
model="claude-sonnet-5",
messages=[{"role": "user", "content": "Explain SSE in one paragraph."}],
stream=True,
stream_options={"include_usage": True}, # token counts in the last chunk
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)data: {"choices":[{"index":0,"delta":{"role":"assistant","content":""}}]}
data: {"choices":[{"index":0,"delta":{"content":"Server-sent"}}]}
data: {"choices":[{"index":0,"delta":{"content":" events"}}]}
data: {"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}
data: {"choices":[],"usage":{"prompt_tokens":14,"completion_tokens":96,"total_tokens":110}}
data: [DONE]Keys and limits
A key per project, each with its own fence
Create as many keys as you need in the console. Each one carries its own scope, so a mistake in one project stays in that project.
- Allowed models
- Restrict a key to the model ids it needs. Anything else is refused before it reaches a provider.
- Spend limit
- Cap how many credits a key can use. When it is spent, the key stops; your balance and other keys are untouched.
- Expiry
- Give short-lived keys to contractors, demos and CI jobs. After the date they fail with 401.
- IP allow-list
- Accept a key only from your servers’ addresses, so a copied key is useless elsewhere.
Billing
Prepaid credits, metered per token
- No subscription required, no overage bill. At zero balance requests stop; top up and the same keys work again.
- 1 credit = $1 of usage at the published per-model rates. Packs start at 10 credits.
- Every request is a line in your usage log: model, input and output tokens, cost.
Reliability
What to expect, plainly
- 01
Provider incidents reach you.
When a provider is down or throttling a model, requests to that model fail with 429 or 5xx. We do not answer with a different model than the one you asked for.
- 02
Retry 429 and 503 with backoff.
The official OpenAI and Anthropic SDKs already do this. Requests the gateway rejects (invalid key, no balance, unknown model) are not charged.
- 03
Stream long outputs.
Proxies on the internet close connections that stay silent for about 100 seconds. A non-streaming request for a long answer can fail even while the model is still working; with stream: true tokens keep the connection alive.
- 04
No uptime percentage, on purpose.
We do not publish an uptime figure or an SLA until we have a measured history to back one. Current state and incidents are on the status page.
- 05
Models change.
Providers retire models on their own schedule. Removals and new ids are announced in Product Updates with dates.
Try it from a $3 top-up.
Create an account, make a key, and send the request above. The first line in your usage log tells you exactly what it cost.