anthropic-api

anthropic-api is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 33 tokens per session (2,063 once invoked), scanned A, original, MIT.

An operational guide for calling the Anthropic API, the online interface for using Claude models in software. It covers messages, system instructions, streaming responses, and tools that an application can let the model call.

In plain words
What is it for?
Use it to add Claude to a backend, build tool-calling workflows, stream responses to users, run batch analysis, and record request usage for troubleshooting.
Why use it?
It helps applications send requests consistently, handle tool calls safely, and avoid leaking keys or accepting unvalidated tool input.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the major-ai-skills plugin — 147 skills, 8 plugins shipped together

Good fit Use it to add Claude to a backend, build tool-calling workflows, stream responses to users, run batch analysis, and record request usage for troubleshooting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/anthropic-api
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alivirgo/Major-AI-Skills --skill anthropic-api
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install major-ai-skills, the plugin that ships this one along with the rest of its 147 skills, 8 plugins.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for anthropic-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/anthropic-api/github.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/anthropic-api)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/anthropic-api"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/anthropic-api/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for anthropic-api

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/anthropic-api"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/anthropic-api.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,063 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.02063
Opus 5.5 $0.00013 $0.00825
Sonnet 5.5 $0.00007 $0.00413
Haiku 4.5 $0.00003 $0.00206

Measured 1mo ago against content hash 94df6031f342, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

anthropic-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/anthropic-api/SKILL.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Anthropic API Client AI Skill Guide (Claude)

Overview & Engine Architecture

The Anthropic SDK talks to the Messages API (messages.create / stream). Requests require model and max_tokens; optional system, alternating user/assistant turns, tools, and cache_control breakpoints. Tool use returns tool_use content blocks; the client must execute allowlisted tools and continue with tool_result. Prompt caching prefixes follow tools → system → messages. Pin current model ids (verify deprecations); never invent keys.

┌─────────────────────────────────────────────────────────────┐
│                 Anthropic Messages runtime                    │
│                                                             │
│  messages.create / messages.stream                          │
│  ├── system (+ optional cache_control)                      │
│  ├── tools[] (cache breakpoint on last tool)                │
│  └── messages[] (user / assistant / tool_result)            │
│                                                             │
│  Response                                                   │
│  ├── content blocks: text | tool_use | ...                  │
│  ├── stop_reason: end_turn | tool_use | max_tokens | ...    │
│  └── usage: input/output + cache_creation/read tokens       │
└─────────────────────────────────────────────────────────────┘

When to use / when not to

Use when

  • Direct Claude integrations in backends, CLIs, and workers.
  • Tool-calling assistants with JSON Schema tool definitions.
  • Streaming UX or long stable system/tool prefixes that benefit from prompt caching.

Do not use when

  • OpenAI-only stack is mandated → @openai-api.
  • Full RAG ingestion product → @llamaindex (still use this skill for Claude calls).
  • User wants unrestricted computer/shell tools without review → refuse; allowlist + human approval.

Operational Capabilities & Agent Directives

  1. ANTHROPIC_API_KEY from environment only — never commit or hardcode.
  2. Always set max_tokens explicitly for production; treat stop_reason=max_tokens as a bug until raised or input trimmed.
  3. Pin model ids (e.g. claude-sonnet-4-6 for balanced prod; claude-haiku-4-5 for high-volume). Check deprecation tables before copying old tutorial ids (claude-sonnet-4-5 EOL paths exist).
  4. System vs user: durable instructions in system; never put secrets in user turns that get logged.
  5. Tool loop correctness: on tool_use, execute only allowlisted tools with schema-validated input; append tool_result and continue until end_turn.
  6. Prompt caching: place cache_control: {"type": "ephemeral"} on the last tool and/or large system blocks; confirm hits via cache_read_input_tokens (short prompts below model minimum silently skip cache).
  7. Record message.id + usage for cost and debugging; redact PII in logs.

Read the full file on GitHub · 214 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +113 lines · +8 tokens per session 94df6031f342
  2. 2mo ago Changed · -3 tokens per session c90c89af5b8a
  3. 2mo ago First seen · 101 lines · 28 tokens per session scan A eecf326949f5

Subscribe to this mod's changes

anthropic-api is a skill published in the GitHub repository alivirgo/Major-AI-Skills (6 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 2,063 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

anthropic-api compared with skills from other repositories

anthropic-api next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
anthropic-apialivirgo/Major-AI-SkillsSkill6todayMITA33Claude Code
django-expertzacklecon/claude-skillsSkill31mo agoMITA37Claude Code, Codex
fastapi-patternschandrudp29/skillhubSkill145mo agoMITA36Claude Code, Codex
fastapi-expertzacklecon/claude-skillsSkill31mo agoMITA39Claude Code, Codex
django-patternsaffaan-m/ECCSkill313k7d agoMITA32Claude Code, Kiro
fastapi-patternsaffaan-m/ECCSkill313k7d agoMITA35Claude Code, Kiro
pydantic-models-pysickn33/agentic-awesome-skillsSkill51kyesterdayMITA23Claude Code