anthropic-api

anthropic-api is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 25 tokens per session (764 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, 7 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, 7 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 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 764 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.00025 $0.00764
Opus 5 $0.00013 $0.00382
Sonnet 5 $0.00005 $0.00153
Haiku 4.5 $0.00003 $0.00076

Measured today against content hash c90c89af5b8a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, 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 today.

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 · 101 lines

How it starts

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

Anthropic API Client AI Skill Guide

Overview & Engine Architecture

The Anthropic SDK talks to the Messages API for Claude models. Requests include model, max_tokens, optional system, and alternating user/assistant messages; tool use returns tool_use blocks the client must execute and continue with tool_result. Agents pin model ids, always set max_tokens, stream when UX needs tokens early, and keep tools allowlisted.

messages.create
   -> content blocks (text / tool_use)
   -> client executes tools
   -> messages continues with tool_result

When to use this skill

  • Direct Claude integrations in apps/backends
  • Tool-calling workflows with strict schemas
  • Streaming assistants and batch analysis jobs

Operational directives

  1. Use ANTHROPIC_API_KEY from the environment only.
  2. Always pass max_tokens; do not rely on implicit defaults for prod.
  3. Put durable instructions in system; keep user turns free of secret keys.
  4. On tool_use, execute only allowlisted tools with validated input.
  5. Record message.id / usage for debugging and cost attribution.

Messages example

import os
from anthropic import Anthropic

client = Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])

msg = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=512,
    system="Answer briefly. If context is missing, say what you need.",
    messages=[
        {"role": "user", "content": "Give two risks of skipping data validation in ETL."},
    ],
)
for block in msg.content:
    if block.type == "text":
        print(block.text)
print(msg.usage)

Streaming

with client.messages.stream(
    model="claude-sonnet-4-20250514",
    max_tokens=256,
    messages=[{"role": "user", "content": "Outline a dbt testing plan."}],
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

Common failures

Symptom Cause Fix
401/403 key/permission check env + workspace
stop_reason=max_tokens cap too low raise max_tokens
Tool loop errors missing tool_result continue conversation correctly
High latency huge context trim; cache prompts when available

Read the full file on GitHub · 101 lines

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. today Changed · -3 tokens per session c90c89af5b8a
  2. 6d 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 (1 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 764 once invoked, about $0.0001 per session on Opus 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

Other skills, from other repositories

python-api

Professional Python API Expert skill. Build performant, secure, and scalable backend logic and RESTful or GraphQL APIs.

AtulPurohit/Antigravity-Awesome-Skills · 26 tokens

api-rate-limit-handler

Implement bounded, idempotency-aware API throttling, backoff, and retry handling for 429 and transient 5xx responses.

sickn33/agentic-awesome-skills · 32 tokens

api-endpoint-builder-v2

API Endpoint Builder workflow skill. Use this skill when the user needs Builds production-ready REST API endpoints with validation, error handling, authentication, and documentation. Follows best practices for security and scalability and the operator should preserve the upstream workflow, copied support files, and…

diegosouzapw/awesome-omni-skills · 66 tokens

api-endpoint-builder

API Endpoint Builder workflow skill. Use this skill when the user needs Builds production-ready REST API endpoints with validation, error handling, authentication, and documentation. Follows best practices for security and scalability and the operator should preserve the upstream workflow, copied support files, and…

diegosouzapw/awesome-omni-skills · 64 tokens

laravel-api

Build production-ready RESTful APIs with Laravel. Covers authentication (Sanctum/Passport), versioning, resources, rate limiting, and API testing.

AtulPurohit/Antigravity-Awesome-Skills · 34 tokens

api-contract-tester

Implement consumer-driven contract testing with Pact to ensure API compatibility.

AtulPurohit/Antigravity-Awesome-Skills · 17 tokens