Skip to content
SkillMixed26,506 tokens in use

claude-api

Anthropic's reference skill for building with the Claude API: current model IDs and pricing, SDK patterns in seven languages and cURL, Managed Agents, migrations and evals.

197,763 stars on the repositoryanthropics/skills · skills/claude-api

Skill label

measured from its files

What installing claude-api costs

297tokens idle
26,506tokens in use
317,358tokens, up to

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Up to adds the files its instructions link. Counts are approximate, made offline with cl100k_base.

Model dependence Mixed

Script-ledMixedModel-led

Scripts do part of the work and the model's judgement does the rest.

This describes the skill's structure, how much of it is scripts. It does not say how well it works. Scripts: shared/evals/report/build-report-lite.mjs, shared/evals/report/runner-scaffold.mjs, shared/preserved-thinking-migration/drop_block_probe.py, shared/preserved-thinking-migration/prefix_diff.py.

Touches

networkdetectedwrites filesdetectedcredentialsdetected

Declared tags come from the skill's frontmatter; detected ones from its scripts and code blocks. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Excellent
  • Frontmatter11/15
  • Structure19/25
  • Examples15/15
  • Output15/15
  • Size9/15
  • Resources15/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Good
  • Writes files−8

    does this on the machine, and the frontmatter does not say so

    shared/evals/report/build-report-lite.mjs, line 122
  • Reaches the network−10

    does this on the machine, and the frontmatter does not say so

    shared/preserved-thinking-migration/drop_block_probe.py, line 96
  • Reads credentials−15

    does this on the machine, and the frontmatter does not say so

    shared/preserved-thinking-migration/drop_block_probe.py, line 410

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Good
  • Development activity72
  • Maintenance32
  • Community68
  • Maturity36
  • Momentum40

claude-api is the skill Anthropic publishes in its public skills repository for writing code against the Claude API and the Anthropic SDKs. It triggers whenever a prompt names Claude or Anthropic, asks about LLM pricing, model choice or caching, or describes LLM-shaped work with no provider stated, and it steps aside when the project already uses OpenAI, Gemini or another provider. Its main guide sets the defaults (the current Opus model, adaptive thinking, streaming for long requests), a table of current model IDs and prices, and a list of API shapes that changed in 2025 and 2026 so the agent does not write code from a stale memory.

Around that guide sits a large library of files the agent reads on demand: per-language folders for Python, TypeScript, Java, Go, Ruby, C# and PHP plus cURL, covering the client, tool use, streaming, batches and the Files API, and a shared folder on prompt caching, error codes, platform availability, the ant CLI, the Admin API, Managed Agents and model migration. Slash-style subcommands run longer workflows from those files: migrate code to a newer model, audit prompts for dated patterns, upgrade the Python SDK across a major version, cut API cost, build an eval and hill-climb against it, and make a harness compatible with preserved thinking.

What You Get

  • A SKILL.md guide with defaults, a current model ID and pricing table, a per-model thinking and effort table, and quick references for caching, compaction, fast mode, task budgets, server tools, provider clients and common pitfalls
  • Language folders for Python, TypeScript, Java, Go, Ruby, C# and PHP, plus cURL examples, covering client setup, tool use, streaming, batches and the Files API, with Managed Agents examples for most of them
  • Shared guides on prompt caching, tool-use concepts, agent design, error codes, token counting, platform availability, the Admin API, the ant CLI and the live documentation URLs to fetch
  • Step-by-step workflows for model migration, prompt audits, Python SDK major upgrades, cost optimization, building and hill-climbing evals, and preserved-thinking migration
  • Managed Agents material: overview, core, environments, tools, events, outcomes, multiagent, memory, webhooks, scheduled deployments, self-hosted sandboxes, an onboarding interview and thirteen quickstart templates
  • Bundled scripts: an eval runner scaffold and an HTML report builder in Node, and two Python tools that diff and replay captured Messages API requests

Common Use Cases

  • Adding a Claude call, streaming chat or tool-use agent to an existing Python, TypeScript, Go, Java, Ruby, C# or PHP project
  • Migrating code from an older Claude model to a current one and fixing the parameters that now return errors
  • Checking current model IDs, context windows, prices and which features each model and cloud platform supports
  • Setting up a Managed Agent, from a guided interview, a bundled quickstart template or a page that describes one
  • Building an eval set for a Claude-powered app and iterating prompts against it
  • Reviewing a Claude integration’s bill and working out which caching, batching or effort changes would lower it

What Makes It Unique

The other Anthropic skills listed here teach a task, such as PDF handling or interface design; this one teaches the agent the platform it runs on. It is built against the model’s own training prior: a drift table names API shapes that changed, the rules say never to guess an SDK binding and to fetch the SDK repository when a binding is not documented, and the bundled language files are declared authoritative over recalled patterns. It is also unusually large and layered: a long SKILL.md that works as a router, files for seven SDK languages and cURL, and subcommand workflows that tell the agent to execute a long guide step by step rather than summarize it.

Under The Hood

SKILL.md is a router: it tells the agent to detect the language from project files, then read the relevant files under the language folders and shared/ before writing anything. The agent writes and edits code in the user’s project. When something is not covered, or the user asks for the latest information, it fetches pages from platform.claude.com and the Anthropic SDK repositories on GitHub. For credentials it runs ant auth status and reads ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN or an OAuth profile under ~/.config/anthropic; the CLI guide gives Homebrew and go install commands for ant, and the onboarding guide says to ask before running an installer. The bundled scripts use only built-in libraries. prefix_diff.py compares captured request bodies offline and can scan a repository for likely causes with regular expressions. drop_block_probe.py replays captured conversations against the Messages API at api.anthropic.com (or ANTHROPIC_BASE_URL) with the key or token from the environment, which costs money, and it sends nothing without —yes. runner-scaffold.mjs is copied into the user’s repository as an eval runner, where the user fills in the model call and grading, and it writes traces and results files; build-report-lite.mjs reads that output and writes a static report.html and a scores file. The cost, eval and migration workflows say to get the user’s approval before any run that spends money.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers