# Anthropic

> A Claude skill from ashish7802/awesome-api-skills.

- **Type:** Skill
- **Install:** `agentstack add skill-ashish7802-awesome-api-skills-anthropic`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ashish7802](https://agentstack.voostack.com/s/ashish7802)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ashish7802](https://github.com/ashish7802)
- **Source:** https://github.com/ashish7802/awesome-api-skills/tree/master/skills/anthropic

## Install

```sh
agentstack add skill-ashish7802-awesome-api-skills-anthropic
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Anthropic API Skill

## Overview
Anthropic's API provides access to the Claude 3 family (Opus, Sonnet, Haiku). This skill focuses on the Messages API, vision capabilities, and strict system prompt isolation.

## Installation
```bash
npm install @anthropic-ai/sdk
pip install anthropic
```

## Authentication
Use the `x-api-key` header with your `ANTHROPIC_API_KEY`. You must also supply the `anthropic-version` header (e.g., `2023-06-01`).

## Core Concepts
- **System Prompt**: Isolated from the main conversation array for higher adherence.
- **Claude 3.5 Sonnet**: The recommended default model for speed and coding intelligence.
- **Max Tokens**: Required parameter defining the generation limit (e.g., 4096 or 8192).

## Common Workflows
1. Define the system prompt.
2. Pass the conversation history alternating precisely between `user` and `assistant`.
3. Process the response blocks.

## Error Handling
Handle `AnthropicError`. The `OverloadedError` indicates capacity constraints; retry with backoff. `AuthenticationError` indicates invalid or revoked keys.

## Security
Anthropic provides inherent safety filters. Ensure system prompts instruct the model to avoid executing unverified external data.

## Rate Limits
Tiered rate limits applied per minute (RPM) and tokens per minute (TPM). Tier 1 for Claude 3 Sonnet is 50 RPM and 40,000 TPM.

## Best Practices
Always put long reference documents inside `` XML tags. Claude is specifically trained to parse and pay closer attention to XML structures.

## Troubleshooting
If the API returns a 'roles must alternate' error, ensure your `messages` array strictly follows a `user` -> `assistant` -> `user` sequence without duplicate consecutive roles.

## References
- [API Reference](https://docs.anthropic.com/en/api/getting-started)

## Why use this skill
Use this when your agent works with **anthropic** — structured patterns beat pasted docs and prevent common hallucinations.

## AI pitfalls
- Using deprecated model IDs or wrong API endpoints
- Confusing chat vs completions vs embeddings APIs
- Omitting rate-limit and token budget handling

## Production checklist
- [ ] Secrets in environment variables, not source code
- [ ] Error handling and logging in place
- [ ] Rate limits and timeouts configured

## Related skills
- No graph relationships yet — see the knowledge graph in the docs site.

---
> **Last Verified:** 2026-07-02

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ashish7802](https://github.com/ashish7802)
- **Source:** [ashish7802/awesome-api-skills](https://github.com/ashish7802/awesome-api-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ashish7802-awesome-api-skills-anthropic
- Seller: https://agentstack.voostack.com/s/ashish7802
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
