スキル一覧に戻る
laitim2001

claude-api-reference

by laitim2001

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


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

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

EndpointPurpose
POST /v1/messagesPrimary conversation API
POST /v1/messages/batchesBatch processing (50% discount)
POST /v1/messages/count_tokensToken counting
GET /v1/modelsList available models
POST /v1/filesFile upload (Beta)

Required Headers

x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
content-type: application/json

Model Selection

ModelIDFeatures
Claude Opus 4.5claude-opus-4-5-20251101Highest intelligence
Claude Sonnet 4.5claude-sonnet-4-5-20250929Balanced performance/cost
Claude Haiku 4.5claude-haiku-4-5-20251001Fastest 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

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

# 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 TypeValue
Standard request size32 MB
Batch API256 MB
Files API500 MB
PDF pages100 pages
Single image8000x8000 px
Multi-image per image2000x2000 px
Max images per request20 images
Message limit100,000 per request

Official Resources

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です