Home › Claude Code
OverviewInstallCLI referencePricing & limitsAgent SDKSkills & pluginsGitHubWeb, desktop & IDEModelsErrorsOpen source?TutorialFor studentsQA automationvs Cursorvs Codex & OpenCodeSubagentsHooksMCPEcosystemVS CodeOpenRouterRate limits中文指南
Last updated: November 06, 2026

Claude Code: the complete guide

Claude Code is Anthropic's agentic coding tool: a terminal program (and, since late 2025, a web app, desktop app and IDE extension) that reads your repository, plans, edits files, runs commands and opens pull requests. These guides cover installing it, driving it well, what it costs, and how to point it at a gateway so the bill stops being the thing you think about.

TLDR

  • Install with npm, the native installer, or the desktop app — five minutes on macOS, Linux, Windows or WSL.
  • It bills through the API per token, and long sessions resend the whole conversation every turn — that is why it gets expensive.
  • Two env vars (ANTHROPIC_BASE_URL + ANTHROPIC_API_KEY) point it at this gateway: same models, credits at 7.69231× face value, or a flat-rate unlimited plan from $0.80.
  • Skills, plugins, subagents, MCP servers and the GitHub Action all keep working — the gateway sits underneath the tool, not inside it.

What Claude Code actually is

Claude Code is not a chat window with a code button. It is an agent loop: you describe an outcome, it inspects the repository, proposes a plan, edits files, runs your tests, reads the failures and iterates — asking permission before anything destructive. It ships as an npm package (@anthropic-ai/claude-code, currently 2.1.319), a native installer, a VS Code / JetBrains extension, a desktop app and a web version that runs in Anthropic-hosted sandboxes.

Under the hood every turn is a Messages API call carrying the full conversation so far. That single fact explains most of what people search for about it: why it is powerful, why it is token-hungry, why rate limits bite, and why a cheaper or flat-rate API backend changes the experience so much.

Point it at the gateway in two lines

Claude Code reads the standard Anthropic environment variables. Set the base URL to this gateway and use a key from your dashboard; nothing else changes.

export ANTHROPIC_BASE_URL=https://aiprimetech.io
export ANTHROPIC_API_KEY=your_gateway_key
claude

Run /status inside Claude Code to confirm the base URL it is talking to, and /model to pick a model. Every model the gateway serves is available — see the models guide for the current list.

The guides

  • Install — npm, native installer, Windows/WSL, and fixing a broken install.
  • CLI reference — flags, slash commands, headless mode, output formats.
  • Pricing & limits — what it costs on the API, on Pro/Max, and on this gateway.
  • Agent SDK — driving Claude Code programmatically from Python or TypeScript.
  • Skills & plugins — what skills are, the marketplace, and writing your own.
  • GitHub — the GitHub App, the Action, and @claude in pull requests.
  • Web, desktop & IDE — where Claude Code runs besides the terminal.
  • Models — the default model, switching, and per-tier overrides.
  • Errors — 500, 400, 429, 529, auth failures and what each one means.
  • Open source? — what is and isn't, and the open alternatives.
  • Tutorial — a first real session: CLAUDE.md, plan mode, permissions, compaction.
  • For students — the cheapest legitimate way to run it while learning.
  • QA automation — generating tests, the run-fix loop, headless runs in CI, Playwright.
  • Subagents, Hooks, MCP — the three extension points, each with working examples.
  • vs Cursor and vs Codex & OpenCode — honest comparisons, and how to run them together.
  • Ecosystem — claude-code-router, SuperClaude, caveman, statuslines, the awesome lists.
  • VS Code, OpenRouter, Rate limits — the extension and its errors, using other backends, and what "rate limit reached" means.

Frequently asked questions

Is Claude Code free?

The tool itself is free to install. Usage is billed either through a Claude Pro/Max subscription or per token through the API. On this gateway you can run it on pay-as-you-go credits or a flat-rate unlimited plan.

Does Claude Code work with a different API endpoint?

Yes. It honours ANTHROPIC_BASE_URL, so any Anthropic-compatible endpoint works. That is exactly how it connects to this gateway — no patching, no wrapper.

Which model does Claude Code use?

By default the current Sonnet-tier model; you can switch with /model or the --model flag, and override each tier with environment variables. The models guide lists what this gateway serves right now.

Run Claude Code on the gateway

Same models, two environment variables, credits at 7.69231× face value — or a flat-rate unlimited plan.

Get an API key See unlimited plans

AI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.

More Claude Code guides

How to install Claude CodeClaude Code CLI documentation: commands and flagsClaude Code pricing and limits, explainedThe Claude Code SDK, now the Claude Agent SDKClaude Code skills and pluginsClaude Code in GitHub: the App, the Action and @claudeDoes Claude Code have a web interface? Web, desktop and IDE explainedWhich model Claude Code uses, and how to change itClaude Code errors and how to fix themIs Claude Code open source?Claude Code tutorial: your first real sessionClaude for students: Claude Code, the API and what education actually gets youHow to use Claude Code for QA automationClaude Code vs Cursor: which one, when — and how to run bothClaude Code vs Codex vs OpenCode: the terminal agents comparedClaude Code subagents: how they work, how to define them, and agent teamsClaude Code hooks: deterministic control over what the agent doesClaude Code MCP: connecting servers, scopes, remote MCP and real examplesThe Claude Code ecosystem: routers, frameworks, plugins and the lists that track themClaude Code in VS Code: the extension, the terminal route, and the errorsHow to use OpenRouter in Claude Code (and when not to)Claude rate limit error: what "API error: rate limit reached" means and how to fix itClaude Code 怎么用:从安装到日常使用