Home / Docs
Documentation
Everything needed to call Claude, GPT and Gemini models through one Anthropic-compatible endpoint — from a first curl to production hardening.
QuickstartFirst request in about a minuteClaude CodeTwo environment variablesModelsIds, context windows, ratesAPI referenceEndpoints and schemas
Getting started
IntroductionWhat ClaudeAPIKey.dev is, which endpoints it speaks, and how it differs from calling Anthropic directly.QuickstartGet a key, set two environment variables, and make your first request in about a minute.AuthenticationHow to send your key, which header each format expects, and how to keep keys safe.ModelsEvery model id you can call, its context window, and what it costs per million tokens.Base URLsThe one setting that trips everyone up: which URL each client expects, with and without the /v1 suffix.Your first request explainedA line-by-line walkthrough of one Messages call — what every field does and what comes back.
API reference
API overviewEvery endpoint the gateway exposes, which format it speaks, and what it returns.Messages APIPOST /v1/messages — the Anthropic-format endpoint: parameters, response shape and examples.Chat Completions APIPOST /v1/chat/completions — the OpenAI-format endpoint, for Cursor, LangChain, LiteLLM and the OpenAI SDKs.Models endpointGET /v1/models — discover exactly which model ids your key can call.StreamingServer-sent events in both formats — the event shapes differ, and mixing them up reads as silence.ErrorsEvery status code the gateway returns, what actually causes it, and the fix.Rate limitsHow throttling works, what a 429 means here, and how to build a client that does not trigger one.Tool use and function callingLet a model call your functions — the request loop, both formats, and the mistakes that cost tokens.Vision and image inputSend images to multimodal models — encoding, size limits, and what it costs.
Integration guides
Claude CodePoint Anthropic's CLI agent at the gateway with two environment variables — and avoid the one trap that silently bills the wrong key.CursorUse Claude models inside Cursor through the OpenAI-compatible endpoint, without an Anthropic account.ClineConfigure the Cline VS Code extension against the Anthropic-format endpoint.AiderRun the terminal pair-programmer against the gateway in either wire format.ZedAdd the gateway as a custom assistant provider in the Zed editor.ContinueConfigure the Continue extension for VS Code and JetBrains.VS Code extensionsWhich VS Code AI extensions accept a custom base URL, and how to point each at the gateway.JetBrains IDEsIntelliJ IDEA, PyCharm, WebStorm, GoLand and the rest — via Continue or an OpenAI-compatible plugin.OpenCodePoint the open-source terminal coding agent at the gateway.Codex CLIRun OpenAI's Codex CLI and the Codex extension against the gateway.OpenClawConfigure the OpenClaw agent framework to use gateway models.MCP servers for Claude CodeA Model Context Protocol config that earns its place, plus the traps that cost real time.API key configuration by toolOne table: where each client expects the key and the base URL, with the /v1 suffix spelled out.
Working with the API
Cost controlWhere the tokens actually go in an agentic workload, and the four levers that move the bill.Prompt cachingRe-read a stable prefix at a fraction of the input price — what to cache, what not to, and how to verify it worked.Context managementWhy long sessions get expensive non-linearly, and the patterns that keep history bounded.Migrating from the Anthropic APIMove an existing Anthropic-SDK codebase over by changing two values.Migrating from the OpenAI APIKeep the OpenAI SDK and reach Claude models by changing the base URL.Production best practicesWhat to get right before an integration carries real traffic.TroubleshootingSymptom-first index — find what you are seeing and jump to the cause.
SDKs
SDKs overviewOfficial Anthropic and OpenAI SDKs both work unmodified — pick by which format you prefer.PythonWorking examples with the anthropic and openai packages, including streaming and async.TypeScriptNode examples with @anthropic-ai/sdk and openai, including streaming.cURLDependency-free examples for every endpoint — useful for debugging and CI checks.GoCall the gateway from Go with the standard library — no third-party client needed.
Billing
PricingHow credits convert to tokens, what the bonuses are, and how to work out the cost of a task.CreditsHow the prepaid balance works, what draws it down, and how to avoid running dry mid-run.Unlimited plansFlat-rate access for a fixed window — what they include and when they beat credits.Payment methodsCard and crypto — which to use, and why the bonus differs.Refunds and supportWhat can be refunded, what cannot, and how to raise a billing issue.
Resources
FAQDirect answers to the questions we are actually asked.GlossaryThe terms used throughout these docs, defined precisely.Security and privacyHow to handle keys, what to avoid sending, and the boundaries of this service.ChangelogNotable changes to the API surface, models and documentation.Status and reliabilityHow the gateway handles upstream failures, and what to do when something is degraded.Availability and payment methodsWhere the service can be used, and how to pay when card networks are unavailable.
Learn
Buyer-focused explainers that sit alongside the technical docs.
What an Anthropic-Compatible API MeansHow to Buy Claude API CreditsThe Cheapest Way to Use the Claude APIClaude API Errors — Rate Limits, 400, 500, 529 FixesClaude API Free Trial — Get $5 Free CreditClaude API Integration Guide: SDKs, REST & Production PatternsAll Claude Model Names Compared: Opus, Sonnet, Haiku, Fable (2026)Claude API Pricing ExplainedClaude API Gateway vs. Anthropic DirectClaude API vs Claude Pro/Max Subscription — Which to ChoosePaying for the Claude API with CryptoClaude API Access Without a WaitlistClaude Code Pricing Explained: API Costs, Plans & How to Cut ThemClaude Code API Key — How to Get and Set UpClaude Code API: How Keys, Base URLs & Billing Work (2026)How to Get Unlimited Claude UsageHow to Get a Claude API KeyHow to Reduce Claude Token UsageUsing Claude Through an OpenAI-Compatible APIRunning an Unlimited Hermes Agent on ClaudeRunning Unlimited OpenClaw on ClaudeWhat 'Unlimited' Claude API Access MeansHow to Get an Unlimited Claude API KeyUnlimited Claude Code Usage — No Token Limits