Claude format.
Anthropic Claude Messages API-compatible request. The `anthropic-version` header is required.
Header Parameters
Anthropic API version.
Optional Anthropic-style API Key header; a Bearer Token may also be used.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/messages" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5-20250929", "max_tokens": 1024, "messages": [ { "role": "user", "content": "Hello, please introduce Models Hub in one sentence." } ] }'{
"id": "msg_123",
"type": "message",
"role": "assistant",
"content": [
{
"type": "text",
"text": "string",
"image_url": {},
"inline_data": {}
}
],
"model": "string",
"stop_reason": "string",
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"request_id": "string"
}
}ChatCompletions format.
OpenAI Chat Completions-compatible endpoint. Supports standard chat requests, and can also be used to call image-capable Gemini models via the OpenAI chat format.
Responses format.
OpenAI Responses API-compatible endpoint, supporting single-turn/multi-turn input, tool calls, and reasoning parameters.