claude-api
Skill by guanyang
Reference skill for building applications with the Claude API and Anthropic SDK. It covers model ids, pricing, streaming, tool use, MCP, caching and model migration. Aimed at developers who write or maintain Claude API code.
Install claude-api
Built from the published package, never by AI.
git clone --depth 1 https://github.com/guanyang/open-agent-hub /tmp/open-agent-hub && mkdir -p ~/.claude/skills && cp -r /tmp/open-agent-hub/skills/claude-api ~/.claude/skills/claude-apiRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/guanyang/open-agent-hub /tmp/open-agent-hub && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/open-agent-hub/skills/claude-api ~/.gemini/antigravity-cli/skills/claude-apiAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The claude-api skill is a reference for building LLM-powered applications with Claude. Its description covers model ids, pricing, parameters, streaming, tool use, MCP, agents, caching, token counting and model migration. It tells the assistant to choose the right Claude surface, detect the project language, and read the language-specific documentation before writing code.
Code written with this skill must call Claude through the official Anthropic SDK for the project's language. Raw HTTP is used only when the user asks for it, the project is a shell or cURL project, or no SDK exists. The skill sets defaults of claude-opus-5-5 with adaptive thinking and streaming for long requests. It also provides subcommands such as migrate, prompt-audit, upgrade, api-version and cost-optimize. It is aimed at developers who write or maintain Claude API code.
Written from the project's SKILL.md and checked against it.
What it can do
- migrateMigrates existing Claude API code to a newer model, starting by confirming the files in scope.
- prompt-auditAudits prompts, tool descriptions and agent configuration files for outdated patterns.
- upgradeUpgrades the project's Anthropic SDK dependency across a major version.
- api-versionMoves code to a newer Anthropic API version using the anthropic-version header.
- cost-optimizeReduces what existing Claude API code costs to run without sacrificing output quality.
What you need
- Anthropic SDK for the project's language, or raw HTTP where no SDK exists
Try asking
- Migrate my project's Claude API code to claude-opus-5-5
- Audit my prompts and CLAUDE.md files for outdated patterns
- Reduce what my Claude API code costs to run without losing quality
Good to know
- Stops and asks before editing a file that uses another provider's SDK, such as OpenAI.
- Does not edit non-Anthropic files with Anthropic SDK calls.
- Function names and import paths must come from documentation, so code may need fetching from the SDK repositories.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/claude-api/SKILL.md, skills/claude-api/shared/evals/report/build-report-lite.mjs, skills/claude-api/shared/evals/report/runner-scaffold.mjs, skills/claude-api/shared/latency-optimization/latency_probe.py, skills/claude-api/shared/preserved-thinking-migration/drop_block_probe.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
LICENSE.txt11 KB -
SKILL.md112 KB -
csharp/claude-api.md15 KB -
csharp/claude-api/README.md19 KB -
csharp/claude-api/batches.md1 KB
Show all 129 files
-
csharp/claude-api/content-and-headers.md7 KB -
csharp/claude-api/files-api.md3 KB -
csharp/claude-api/opentelemetry.md2 KB -
csharp/claude-api/streaming.md784 B -
csharp/claude-api/tool-use.md17 KB -
curl/examples.md10 KB -
curl/managed-agents.md11 KB -
go/claude-api.md14 KB -
go/claude-api/README.md10 KB -
go/claude-api/batches.md4 KB -
go/claude-api/files-api.md2 KB -
go/claude-api/opentelemetry.md2 KB -
go/claude-api/streaming.md1 KB -
go/claude-api/tool-use.md19 KB -
go/managed-agents/README.md20 KB -
java/claude-api.md15 KB -
java/claude-api/README.md14 KB -
java/claude-api/batches.md3 KB -
java/claude-api/files-api.md2 KB -
java/claude-api/opentelemetry.md3 KB -
java/claude-api/streaming.md655 B -
java/claude-api/tool-use.md18 KB -
java/managed-agents/README.md19 KB -
php/claude-api.md12 KB -
php/claude-api/README.md7 KB
And 99 more files on GitHub.
Alternatives to claude-api
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
claude-api: common questions
Does claude-api work with OpenAI or other providers?
No. The skill produces Claude and Anthropic SDK code and stops when it finds non-Anthropic provider markers in the target file.
Which Claude model does the skill use by default?
Unless the user requests otherwise, the skill defaults to Claude Opus 5.5 with the model string claude-opus-5-5.
Does it use the raw HTTP API or the official SDK?
It uses the official Anthropic SDK for the project's language by default. Raw HTTP is used only when requested, for shell or cURL projects, or when the language has no SDK.
How do I install claude-api?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is claude-api free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is claude-api safe to use?
It scores 93 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to claude-api?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
