AI model APIChat
Native Claude format
Request in the Anthropic Claude Messages format. Include the anthropic-version header.
Authorization
BearerAuth AuthorizationBearer <token>
Authenticate with a Bearer token: Authorization: Bearer sk-xxxxxx.
In: header
Header Parameters
anthropic-version*string
Anthropic API version
x-api-key?string
Anthropic API key (optional; Bearer authentication is also supported)
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://example.com/v1/messages" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-3-opus-20240229", "messages": [ { "role": "user", "content": "string" } ], "max_tokens": 1 }'{ "id": "string", "type": "message", "role": "assistant", "content": [ { "type": "string", "text": "string" } ], "model": "string", "stop_reason": "end_turn", "usage": { "input_tokens": 0, "output_tokens": 0, "cache_creation_input_tokens": 0, "cache_read_input_tokens": 0 }}