Source: https://aiprimetech.io/learn/ # Claude and Codex API guides Set up Claude API access, understand billing and connect the tools you use. Start with [getting and testing an API key](/learn/how-to-get-a-claude-api-key/), then follow the guide for your application. Compare [prepaid credits](/learn/buy-claude-api-credits/) and [timed API plans](/learn/unlimited-claude-api-access/), or get help with [Claude Code setup](/learn/claude-code-api-key-setup/) and [API errors](/learn/claude-api-errors-troubleshooting/). Connecting a coding tool? Use the [AI agent setup checklist](/agents/) to choose the right key group, model and client configuration. ## All guides [ Guide ### How to get a Claude API key Get a Claude API key from Anthropic or AI Prime Tech, choose billing, verify your model list, and make a first Python request with the right base URL.](/learn/how-to-get-a-claude-api-key/) [ Guide ### Claude API Pricing, Explained Understand how Claude API pricing works — input vs output tokens, prompt caching, and how to estimate the cost of a request.](/learn/claude-api-pricing-explained/) [ Guide ### The Cheapest Way to Use the Claude API Practical ways to reduce your Claude API bill without losing quality — model selection, prompt caching, output limits, and more.](/learn/cheapest-way-to-use-claude-api/) [ Cursor IDE Guide ### Unlimited Cursor with the Claude API Run Cursor IDE on a flat-rate unlimited Claude plan. Full setup walkthrough, advanced workflows, model selection, troubleshooting, and why unlimited fits heavy Cursor usage.](/learn/use-claude-api-with-cursor/) [ Claude Code CLI Guide ### Unlimited Claude Code Access Run Claude Code CLI on a flat-rate unlimited API. Environment variables, model mapping, subagents, agent teams, headless mode, and why unlimited access fits Claude Code's quadratic token growth.](/learn/use-claude-api-with-claude-code/) [ Guide ### Claude API Gateway vs. Anthropic Direct An honest comparison of using a Claude API gateway versus the Anthropic API directly — cost, access, and trade-offs.](/learn/claude-api-vs-anthropic-direct/) [ OpenAI-Compatible Guide ### Use Claude with the OpenAI SDK: OpenAI-compatible endpoint, streaming, tools and limits Call Claude through an OpenAI-compatible endpoint: OpenAI Python and Node SDKs with base_url ending in /v1, Bearer auth, streaming with usage, function calling, reasoning_effort, the model IDs that work, and when the native Anthropic API is the better choice.](/learn/openai-compatible-claude-api/) [ Guide ### Claude models explained: a Claude model comparison of Claude Opus vs Sonnet vs Haiku vs Fable — all Claude API models, Anthropic model names and prices (2026) Claude models explained in one Claude model comparison: every Claude API model you can call in 2026 — Fable 5.1, Opus 5, Sonnet 5, Opus 4.8, Sonnet 4.6, Haiku 4.5 — with Anthropic model names and ids, list prices per million tokens, context windows, and which Claude model is best for coding, agents and chat.](/learn/claude-api-models-compared/) [ Guide ### Paying for the Claude API with Crypto How to pay for Claude API access using cryptocurrency — supported coins and how the prepaid balance works.](/learn/claude-api-with-crypto-payment/) [ Guide ### Claude API Access Without a Waitlist Get Claude API access instantly without an Anthropic account or waitlist, in most regions worldwide.](/learn/claude-api-without-waitlist/) [ Guide ### How to Reduce Claude Token Usage Concrete techniques to use fewer tokens on the Claude API without hurting output quality.](/learn/how-to-reduce-claude-token-usage/) [ Cline Extension Guide ### Unlimited Cline with the Claude API Connect Cline to a flat-rate unlimited Claude API. Full setup for Anthropic and OpenAI-compatible providers, Plan/Act mode, MCP, Computer Use, and why unlimited fits Cline's heavy token consumption.](/learn/use-claude-api-with-cline/) [ Roo Code Extension Guide ### Unlimited Roo Code with the Claude API Run Roo Code on a flat-rate unlimited Claude API. Configuration profiles, per-mode model assignment, Orchestrator subtasks, custom .roomodes, and why unlimited access fits Roo Code's multiplied API consumption.](/learn/use-claude-api-with-roo-code/) [ JetBrains IDE Guide ### Unlimited Claude in JetBrains IDEs Connect any JetBrains IDE to flat-rate unlimited Claude via the Continue plugin. Shared config.yaml, provider setup, role assignments, per-project overrides, and why unlimited fits JetBrains heavy workflows.](/learn/use-claude-api-with-jetbrains/) [ Aider Guide ### Aider with Claude through a gateway: ANTHROPIC_API_BASE, config files, architect mode and fixes Run Aider on Claude through an Anthropic-compatible gateway: ANTHROPIC_API_BASE at the host root, the anthropic/ model prefix, .aider.conf.yml and .env, the OpenAI-compatible route, architect mode, model settings that keep diff edits and the repo map, and the errors users hit.](/learn/use-claude-api-with-aider/) [ VS Code Integration Guide ### Unlimited Claude in VS Code Three paths to unlimited Claude in VS Code: Continue for chat and inline edits, Cline for full autonomous agents, Roo Code for orchestrated multi-mode workflows. Setup comparison, when to use each, and why unlimited access fits VS Code's always-on AI usage.](/learn/use-claude-api-with-vscode/) [ OpenCode Guide ### OpenCode config for Claude: opencode.json setup, models and common errors Configure OpenCode for Claude in opencode.json: point the built-in Anthropic provider at a gateway or add a custom @ai-sdk/anthropic provider, choose models and context limits, and fix the errors OpenCode users actually hit (HTML instead of JSON, 404, invalid key, unsupported model, prompt too long).](/learn/use-claude-api-with-opencode/) [ Hermes Agent Guide ### Hermes Agent with Claude through a gateway: custom provider setup, cost controls and fixes Run Nous Research's Hermes Agent on Claude through an Anthropic-compatible gateway: a named custom provider with the anthropic_messages transport in ~/.hermes/config.yaml, why provider: anthropic ignores a third-party base URL, the settings that drive token use, and documented fixes.](/learn/run-hermes-agent-with-claude-api/) [ OpenClaw Gateway Guide ### Running Unlimited OpenClaw on Claude Deploy OpenClaw on flat-rate unlimited Claude. Provider configuration in openclaw.json, anthropic-messages API type, hub-and-spoke gateway, 50+ channels, skills injection, and why unlimited fits OpenClaw's always-on multi-channel inference.](/learn/run-openclaw-with-claude-api/) [ Guide ### What an Anthropic-Compatible API Means Understand Anthropic-compatible APIs - the Messages API format, and how a drop-in gateway works with existing Claude code.](/learn/anthropic-compatible-api/) [ Setup Guide ### Claude Code API key — ANTHROPIC_API_KEY: how to get it, set it up, and when to use claude setup-token instead How to get a Claude Code API key: ANTHROPIC_API_KEY from the Claude Console or an instant gateway key, ANTHROPIC_BASE_URL setup on macOS, Linux and Windows, what claude setup-token and the OAuth token are for, why a Claude session key is not an API key, and the fixes for the common auth errors.](/learn/claude-code-api-key-setup/) [ Pricing Guide ### Claude Code API Costs — Pricing and How to Cut Them Claude Code pricing in 2026: what sessions really cost on the API, how token usage grows, subscription vs API billing, and how flat-rate plans remove the surprise.](/learn/claude-code-api-costs/) [ Troubleshooting Guide ### Claude API errors explained: server error 500, overloaded 529, rate limit 429, bad request 400 — and the fix for each Getting a Claude server error? This guide decodes every Claude API error — 400 "input is too long", 429 "rate limit reached", 500 internal server error, 529 "overloaded", and "no healthy upstream" — with the cause, the fix, and retry code that works in production.](/learn/claude-api-errors-troubleshooting/) [ Purchase Guide ### How to buy Claude API credits Choose prepaid Claude API credits or a timed plan, check checkout terms, create a gateway key, and verify access before connecting your coding tools.](/learn/buy-claude-api-credits/) [ The honest version ### Claude free API: is there a free Claude API key, and what is actually free in 2026? Looking for a free Claude API key or a Claude free API tier? Here is the honest answer: what Anthropic gives new console accounts, why 'free Claude API key' generators are scams, whether Claude API keys are free at all, and the cheapest legitimate way to run Claude — credits sold below face value and a doubled first crypto top-up.](/learn/claude-api-free-trial/) [ Comparison Guide ### Claude API vs Claude Pro/Max Subscription — Which to Choose Honest comparison of Claude API access vs Claude Pro and Max subscriptions — features, limits, pricing, and which fits developers vs casual users.](/learn/claude-api-vs-subscription/) [ Codex CLI Guide ### Codex CLI with a custom provider: config.toml, GPT and Claude models, IDE extension and fixes Set up OpenAI's Codex CLI and IDE extension with a custom provider in ~/.codex/config.toml: base_url, env_key, wire_api = "responses", GPT and Claude models on one gateway, profiles, codex exec, retries, and fixes for the errors Codex users hit (401, 403 no active subscription, 426 WebSocket, model not supported).](/learn/use-claude-api-with-codex/) [ n8n Guide ### Connecting Claude to n8n Wire n8n's Anthropic node to AI Prime Tech with the Base URL field, route Claude into AI Agent workflows, and fix the common '/v1/models' credential-test failure.](/learn/use-claude-api-with-n8n/) [ LiteLLM Guide ### Routing LiteLLM to Claude Configure LiteLLM's model_list to route to AI Prime Tech — anthropic/ vs openai/ prefix, api_base, the URL-suffix gotcha, and using LiteLLM as a unifying proxy.](/learn/use-claude-api-with-litellm/) [ Kilo Code Guide ### Using Claude in Kilo Code Set up the Kilo Code VS Code extension to drive Claude through AI Prime Tech — provider choice, custom base URL, free-text model id, and the manual context settings.](/learn/use-claude-api-with-kilo-code/) [ VS Code Guide ### GitHub Copilot Chat with Claude through a gateway: Custom Endpoint setup, agent mode and fixes Use Claude models in VS Code's Copilot Chat with your own API key: the Custom Endpoint provider with apiType messages, a complete chatLanguageModels.json, agent mode and tool calling, what BYOK does not cover, and fixes for models that don't appear.](/learn/use-claude-api-with-github-copilot/) [ Zed Guide ### Wire Zed to Claude Through the Gateway Connect the Zed editor to Claude on the multi-model AI Prime Tech gateway. The native Anthropic provider has no api_url override, so use the openai_compatible block — api_url ending in /v1, models declared inline, key in the keychain.](/learn/use-claude-api-with-zed/) [ Cherry Studio Guide ### Connect Cherry Studio to Claude Add Claude to Cherry Studio through the multi-model AI Prime Tech gateway. Settings, Model Services, Add an Anthropic-type provider, set the API Host to the host root, and use the trailing # to lock the exact URL.](/learn/use-claude-api-with-cherry-studio/) [ LangChain Guide ### ChatAnthropic in LangChain: import, base_url, streaming, tools and errors Use Claude in LangChain: from langchain_anthropic import ChatAnthropic, point base_url at a gateway (host root, no /v1), the ANTHROPIC_API_URL and ANTHROPIC_BASE_URL variables, streaming, bind_tools, structured output, retries and the common errors.](/learn/use-claude-api-with-langchain/) [ Python SDK Guide ### Anthropic Python SDK: install, set base_url, stream, and handle errors A practical guide to the Anthropic Python SDK (pip install anthropic): client setup with api_key and base_url or ANTHROPIC_BASE_URL, messages.create, streaming with messages.stream, AsyncAnthropic, timeouts and retries, error classes, request IDs and current Claude model IDs.](/learn/anthropic-python-sdk/) [ AI SDK Guide ### Claude with the Vercel AI SDK: createAnthropic baseURL, streaming and fixes Run Claude through the Vercel AI SDK with @ai-sdk/anthropic: createAnthropic({ baseURL, apiKey }) with /v1 on the end, generateText and streamText, thinking and prompt caching via providerOptions, the OpenAI-compatible alternative, and the errors a wrong URL produces.](/learn/use-claude-api-with-vercel-ai-sdk/) [ Factory Droid Guide ### Run Factory Droid on Claude Drive Factory's Droid CLI with Claude through the multi-model AI Prime Tech gateway. customModels in ~/.factory/settings.json with provider anthropic, baseUrl, ${VAR} apiKey, and the /model switch.](/learn/use-claude-api-with-factory-droid/) [ Guide ### The Claude Code API, Explained How the Claude Code API actually works: using your own API key, pointing ANTHROPIC_BASE_URL at a gateway, what Claude Code sends per request, and what a session costs.](/learn/claude-code-api/) [ Guide ### Integrating the Claude API Into Your Application A practical Claude API integration tutorial: authentication, Python and TypeScript SDKs, streaming, error handling, and the production checklist most integrations miss.](/learn/claude-api-integration/) [ Complete Guide ### How to get unlimited Claude usage Compare Claude subscriptions, metered API usage and timed gateway plans. Check fair-use limits, set up your key, and verify access before a coding session.](/learn/get-unlimited-claude-usage/) [ Guide ### What unlimited Claude API access means Understand timed Claude API plans, eligible usage, fair-use limits, one-time payment and the checks to make before using a plan for coding or applications.](/learn/unlimited-claude-api-access/) Codex and GPT API guides: [Codex API key and access](/codex-api/) · [OpenAI-compatible API](/openai-api/) · [Codex CLI setup](/docs/guides/codex-cli/) · [GPT-6 model comparison](/blog/gpt-6-models-for-codex/) ## More guides - [Claude in Russia: what works in 2026 and what doesn't](/guides/claude-in-russia/) - [Buy a Claude account: what you actually get—and what works instead](/guides/buying-claude-account-access/) - [Buy Claude API access in Russia: a key in a minute, payment without a foreign card](/guides/claude-api-in-russia/) - [Claude Code Configuration: Usage in China, Proxy and API Addresses, Common Environment Variables](/guides/claude-code-configuration-network/)