# Relaykit > An OpenAI- and Anthropic-compatible API for Claude, GPT, Grok and DeepSeek. Prepaid credits, published per-token rates, per-key limits and ready setups for coding agents. OpenAI-format base URL: https://api.oneaiapikey.com/v1 (Authorization: Bearer ). Anthropic-format base URL: https://api.oneaiapikey.com (x-api-key: ; SDKs add /v1/messages). Every docs page is available as Markdown by appending .md to its URL. The full docs in one file: https://oneaiapikey.com/llms-full.txt ## Get started - [Documentation](https://oneaiapikey.com/docs/index.md): Everything you need to call Claude, GPT, Grok and DeepSeek through one OpenAI- and Anthropic-compatible API: quickstart, API reference, errors and tool guides. - [Quickstart](https://oneaiapikey.com/docs/quickstart.md): Create an API key, then send your first request with curl, Python or Node, stream tokens as they arrive and list every model your key can call. - [Authentication and API keys](https://oneaiapikey.com/docs/authentication.md): How to send your API key in each format, which headers are accepted, how per-key spend limits, expiry dates and model allowlists work, and how to rotate keys safely. - [Models and model ids](https://oneaiapikey.com/docs/models.md): Every model id you can send, which request formats each one accepts, its per-token rates, and how to list the models your key can call from code. - [Chat in the browser](https://oneaiapikey.com/docs/chat.md): Use every model in a browser chat on the same account and balance as the API. Sign-in, models, editing and exporting chats, where chats are stored and how replies are billed. ## Build - [Chat completions](https://oneaiapikey.com/docs/chat-completions.md): Send OpenAI-format chat requests to every model with one key. Request fields, roles, the response and usage object, and what changes for Claude models. - [Anthropic Messages API](https://oneaiapikey.com/docs/anthropic-messages.md): Call Claude models through the native Anthropic Messages format with the Anthropic SDKs. Headers, base URL, prompt caching, thinking and beta features. - [Responses API](https://oneaiapikey.com/docs/responses.md): Use OpenAI's Responses API through the gateway. Which models support it, why requests should be stateless, and when chat completions is the better choice. - [Streaming responses](https://oneaiapikey.com/docs/streaming.md): Stream replies token by token with server-sent events in both formats, get token usage in the last chunk, and handle timeouts, disconnects and errors mid-stream. - [Tool calling](https://oneaiapikey.com/docs/tool-calling.md): Let models call your functions. Define tools, run the call loop, send results back, force a tool, and handle parallel calls in OpenAI and Anthropic formats. - [Use MCP servers with your coding tools](https://oneaiapikey.com/docs/mcp.md): MCP servers run in your coding tool, not on the gateway. How to add one in Claude Code, Codex CLI, OpenCode, Cline, Cursor, Kilo Code and Zed, and the cost. - [Vision and files](https://oneaiapikey.com/docs/vision.md): Send images and PDFs to vision models by URL or as base64, in OpenAI and Anthropic formats. Which models accept images, how they are billed, and size limits. - [Structured output](https://oneaiapikey.com/docs/structured-output.md): Get JSON that matches your schema. response_format with JSON Schema, which models honour it, and the two methods that work for Claude models. - [Reasoning models](https://oneaiapikey.com/docs/reasoning.md): Control how much reasoning models think with reasoning_effort or Claude's thinking, read the reasoning text, and understand how thinking tokens are billed. ## Optimize - [Prompt caching](https://oneaiapikey.com/docs/prompt-caching.md): How repeated prompt prefixes are cached and billed at the lower cached rate, how to mark cache breakpoints for Claude, and how to check cache hits in usage. - [Cost control](https://oneaiapikey.com/docs/cost-control.md): Work out what a request costs, choose cheaper models, cap output, use prompt caching, and limit each key's spending so a bug cannot drain your balance. - [Rate limits and retries](https://oneaiapikey.com/docs/rate-limits.md): Where 429 errors come from, how many requests you can run at once, and how to retry with backoff and cap concurrency so bursts and long jobs finish reliably. - [Errors](https://oneaiapikey.com/docs/errors.md): What each HTTP status code and error message from the API means, how to fix 401, 403, 404 and 429 errors, low balance and unknown models, and when to retry. - [Performance metrics explained](https://oneaiapikey.com/docs/performance.md): What first-token time, total duration and tokens per second measure, where the gateway takes each one, what changes them, and how to read them in the console. - [Routing and privacy](https://oneaiapikey.com/docs/routing-privacy.md): What happens to a request between your code and the model, when the gateway retries (it does not), what it records about each call, and what it never stores. - [Migrating](https://oneaiapikey.com/docs/migrate.md): Move existing code from the OpenAI API, the Anthropic API, OpenRouter or another gateway. Change the base URL, key and model ids, then check the few features that differ. ## Account and billing - [Pricing and billing](https://oneaiapikey.com/docs/billing.md): How the prepaid balance works, what each request costs, how to add credit, which models are free, how plans will work, and where to see every charge. - [Account security and alerts](https://oneaiapikey.com/docs/account-security.md): Protect your account with two-factor sign-in, lock API keys to IP addresses, cap their spend, and get an email or webhook alert before your balance runs out. ## Coding tools - [Coding tool setup guides](https://oneaiapikey.com/docs/guides.md): Step-by-step setup for Claude Code, Codex CLI, Cursor, Cline and other coding tools: base URL, API key, model ids and fixes for common errors. - [Claude Code setup: point it at a custom Anthropic base URL](https://oneaiapikey.com/docs/guides/claude-code.md): Run Claude Code on prepaid credits: set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, pin Opus, Sonnet and Haiku model ids, then verify with /status. - [Codex CLI setup: add a custom model provider in config.toml](https://oneaiapikey.com/docs/guides/codex-cli.md): Connect OpenAI Codex CLI to our gateway with a model_providers entry in ~/.codex/config.toml, a key env var and the Responses wire API, plus checks and fixes. - [Cursor setup: use your own key with an OpenAI base URL override](https://oneaiapikey.com/docs/guides/cursor.md): Use Claude, GPT, Grok and DeepSeek in Cursor Chat and Agent via your OpenAI API key and Override OpenAI Base URL, with custom models, checks and known limits. - [Cline setup: connect the OpenAI Compatible provider](https://oneaiapikey.com/docs/guides/cline.md): Configure Cline in VS Code with the OpenAI Compatible provider: base URL, API key and model id for Claude, GPT, Grok or DeepSeek, then verify it and fix errors. - [Kilo Code setup: add a custom OpenAI-compatible provider](https://oneaiapikey.com/docs/guides/kilo-code.md): Add our gateway to Kilo Code as a custom OpenAI Compatible provider in VS Code or in kilo.jsonc for the CLI, with model ids, auto-fetched models and fixes. - [OpenCode setup: custom provider with @ai-sdk/openai-compatible](https://oneaiapikey.com/docs/guides/opencode.md): Add our gateway to OpenCode as a custom provider in opencode.json with @ai-sdk/openai-compatible, store the key via /connect, pick models and fix errors. - [Aider setup: OPENAI_API_BASE and the openai/ model prefix](https://oneaiapikey.com/docs/guides/aider.md): Run Aider through our OpenAI-compatible endpoint: set OPENAI_API_BASE and OPENAI_API_KEY, launch with openai/, save it in .aider.conf.yml and fix errors. - [Zed setup: add an OpenAI-compatible provider for the Agent Panel](https://oneaiapikey.com/docs/guides/zed.md): Add our gateway to Zed via language_models.openai_compatible in settings.json, enter your key, pick Claude, GPT, Grok or DeepSeek in the Agent Panel and fix errors. ## Apps and SDKs - [SDKs and frameworks](https://oneaiapikey.com/docs/sdks.md): Use the official OpenAI and Anthropic SDKs, LangChain, the Vercel AI SDK and LiteLLM with the gateway. The base URL and key settings for each, with working code. - [Open WebUI](https://oneaiapikey.com/docs/apps/open-webui.md): Connect a self-hosted Open WebUI to the gateway as an OpenAI-compatible connection, so every model your key can use appears in its model picker. - [LibreChat](https://oneaiapikey.com/docs/apps/librechat.md): Add the gateway to LibreChat as a custom endpoint in librechat.yaml, with the key in your .env file and the model list fetched from the API. - [LobeChat](https://oneaiapikey.com/docs/apps/lobechat.md): Point LobeChat (LobeHub) at the gateway through its OpenAI provider settings, or with environment variables when you host it yourself. - [SillyTavern](https://oneaiapikey.com/docs/apps/sillytavern.md): Connect SillyTavern to the gateway with a Custom (OpenAI-compatible) chat completion source, and keep long role-play contexts from running up costs. - [Chatbox](https://oneaiapikey.com/docs/apps/chatbox.md): Add the gateway to the Chatbox desktop and mobile app as an OpenAI API compatible model provider, then add the model ids you want to use. ## Reference - [API reference](https://oneaiapikey.com/docs/api-reference.md): Reference for OpenAI- and Anthropic-compatible endpoints: base URLs, auth headers, chat, responses, messages, models, streaming, tool calls and usage. - [Docs for AI tools](https://oneaiapikey.com/docs/llms.md): Give coding assistants and chatbots these docs as plain Markdown, through llms.txt, llms-full.txt, a .md version of every page, or a short project rules file. ## Optional - [Models and per-token rates](https://oneaiapikey.com/models): every model id and price - [Pricing](https://oneaiapikey.com/pricing): plans, credits and how billing works - [Changelog](https://oneaiapikey.com/changelog): dated changes to the API, console and rates