Back to skills
SKILL.md
Claude Api Reference
ASecurityClaude API development reference guide. Use when developing Claude API applications for Messages API, Vision, PDF processing, Tool Use, Streaming, and more. Triggers: (1) Claude API integration development, (2) Image or PDF file processing, (3) Tool Use or Function Calling implementation, (4) Streaming or Batch processing setup, (5) Any Claude SDK development questions
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added September 27, 2026
Works with
Security analysis
100/100Pro scans all 6 files and shows the line behind each finding
npx -y skills add David-Li0406/meta-skill-evloving --skill claude-api-reference --agent claude-codeAre you the author of Claude Api Reference?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/david-li0406-claude-api-reference)---
name: claude-api-reference
description: "Claude API development reference guide. Use when developing Claude API applications for Messages API, Vision, PDF processing, Tool Use, Streaming, and more. Triggers: (1) Claude API integration development, (2) Image or PDF file processing, (3) Tool Use or Function Calling implementation, (4) Streaming or Batch processing setup, (5) Any Claude SDK development questions"
---
# Claude API Reference Skill
This skill provides essential knowledge and best practices for Claude API development.
## Quick Start
```python
from anthropic import Anthropic
client = Anthropic() # Automatically reads ANTHROPIC_API_KEY from environment
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}]
)
print(message.content[0].text)
```
## Core API Endpoints
| Endpoint | Purpose |
|----------|---------|
| `POST /v1/messages` | Primary conversation API |
| `POST /v1/messages/batches` | Batch processing (50% discount) |
| `POST /v1/messages/count_tokens` | Token counting |
| `GET /v1/models` | List available models |
| `POST /v1/files` | File upload (Beta) |
## Required Headers
```
x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
content-type: application/json
```
## Model Selection
| Model | ID | Features |
|-------|-----|----------|
| Claude Opus 4.5 | `claude-opus-4-5-20251101` | Highest intelligence |
| Claude Sonnet 4.5 | `claude-sonnet-4-5-20250929` | Balanced performance/cost |
| Claude Haiku 4.5 | `claude-haiku-4-5-20251001` | Fastest speed |
## File Handling
For detailed specifications, see:
- **PDF/Image processing**: `references/file_handling.md`
- **Tool Use**: `references/tool_use.md`
- **Advanced features**: `references/advanced_features.md`
### PDF Quick Example
```python
import base64
with open("document.pdf", "rb") as f:
pdf_data = base64.standard_b64encode(f.read()).decode("utf-8")
message = client.messages.create(
model="claude-sonnet-4-5-20250929",
max_tokens=4096,
messages=[{
"role": "user",
"content": [
{
"type": "document",
"source": {
"type": "base64",
"media_type": "application/pdf",
"data": pdf_data
}
},
{"type": "text", "text": "Analyze the key points of this document"}
]
}]
)
```
### Image Processing
```python
# Base64 method
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png", # image/jpeg, image/gif, image/webp
"data": image_base64
}
}
# URL method
{
"type": "image",
"source": {
"type": "url",
"url": "https://example.com/image.jpg"
}
}
```
## Limits
| Limit Type | Value |
|------------|-------|
| Standard request size | 32 MB |
| Batch API | 256 MB |
| Files API | 500 MB |
| PDF pages | 100 pages |
| Single image | 8000x8000 px |
| Multi-image per image | 2000x2000 px |
| Max images per request | 20 images |
| Message limit | 100,000 per request |
## Official Resources
- Documentation: https://docs.claude.com
- Python SDK: https://github.com/anthropics/anthropic-sdk-python
- Cookbook: https://github.com/anthropics/anthropic-cookbook
- Quickstarts: https://github.com/anthropics/anthropic-quickstartsFiles in this skill
- SKILL.md
- references/advanced_features.md
- references/file_handling.md
- references/tool_use.md
- scripts/analyze_pdf.py
- scripts/chat_example.py
Attribution
Comments
Loading comments…