Claude API — Anthropic Developer Platform
Anthropic's Claude API centers on the Messages API, supporting text and image understanding/generation, tool calls (functions/skills), computer use, system prompts, streaming outputs, token counting, and prompt caching. Suitable for assistants, RAG, automation workflows, and enterprise integrations.
支持模型
API 接口列表
List available Claude models (latest and stable), returning model names and capabilities.
{
"url": "https://api.anthropic.com/v1/models"
}Retrieve detailed information for a specific model (e.g., availability and version).
{
"url": "https://api.anthropic.com/v1/models/claude-sonnet-4-5"
}Create a chat message to generate the next turn, supporting text and images, multi-turn context, tool calls, and streaming outputs.
{
"url": "https://api.anthropic.com/v1/messages",
"body": {
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "你好,Claude"
}
]
}
]
}
}Create a message batch job to generate responses asynchronously in bulk; suitable for high-throughput workloads.
{
"url": "https://api.anthropic.com/v1/messages/batches",
"body": {
"requests": [
{
"model": "claude-sonnet-4-5",
"max_tokens": 512,
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "批处理任务示例"
}
]
}
]
}
]
}
}Estimate token counts for prompts/messages to plan cost and quota usage.
{
"url": "https://api.anthropic.com/v1/messages/count_tokens",
"body": {
"model": "claude-sonnet-4-5",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "统计一下这条消息的 tokens"
}
]
}
]
}
}