BitRouterBitRouter.
Get API Key
Anthropic Compatible

Create message

Creates a message using the Anthropic Messages API format. Drop-in replacement for the Anthropic API.

When stream: true, the response is sent as Server-Sent Events (SSE). Each event has a type field indicating the event kind (message_start, content_block_delta, message_delta, message_stop).

POST
/v1/messages

Authorization

x-api-key<token>

Anthropic-style API key header.

In: header

Request Body

application/json

Anthropic Messages request.

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://api.bitrouter.ai/v1/messages" \  -H "Content-Type: application/json" \  -d '{    "messages": [      null    ],    "model": "string"  }'
{
  "content": [
    null
  ],
  "id": "string",
  "model": "string",
  "role": "string",
  "stop_reason": "string",
  "stop_sequence": "string",
  "type": "string",
  "usage": null
}
{
  "error": null
}
{
  "error": null
}
{
  "error": null
}

How is this guide?