Create an Anthropic message
Generate a Claude-compatible message.
Create an Anthropic message
curl -X POST "https://router.chbcloud.com/v1/messages" \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{}'Successful response.
{
"id": "string",
"model": "string",
"usage": {},
"content": [
{}
]
}Calls Claude or another model that supports the Anthropic Messages protocol. Authenticate with x-api-key or Bearer, and send anthropic-version when required by the client.
This API uses an API key; its location follows the contract's security scheme.
Authorization
x-api-keyHeader Parameters
anthropic-versionAnthropic protocol version.
2023-06-01Body
application/jsonmodelExact model ID returned by the model list operation.
streamWhether to stream Anthropic events.
falsesystemSystem prompt outside the messages array.
messagesConversation messages using only user and assistant roles.
Show child attributesHide child attributes
messages[].roleMessage role, user or assistant.
messages[].contentText or Anthropic content-block array.
max_tokensMaximum output tokens; normally required by native Claude providers.
1Response
application/jsonSuccessful response.
idMessage ID.
modelModel that produced the message.
usageInput and output token usage.
contentAnthropic content blocks.
{
"id": "string",
"model": "string",
"usage": {},
"content": [
{}
]
}