Skip to main content
The Messages API (/v1/messages) provides direct compatibility with the Anthropic Messages API format. Use this endpoint when working with Anthropic Claude models and features like interleaved thinking, tool calling, and multi-turn conversations.
The Messages API (/v1/messages) is fully supported on the Enterprise plan using https://enterprise.blackbox.ai. On standard plans (https://api.blackbox.ai), this endpoint may not work as expected. For the best experience, use an Enterprise API key.

Basic Request

Response Format


System Prompt

Use the system parameter to set the model’s behavior for the entire conversation.
Response

Multi-Turn Conversations

Pass previous messages as an array of alternating user and assistant messages to maintain conversation context.
Response

Request Headers

Authorization
string
required
API Key in the format Bearer <api_key>. Get yours from here.
anthropic-version
string
required
Anthropic API version. Use 2023-06-01.
anthropic-beta
string
Optional beta features. For example, interleaved-thinking-2025-05-14 for legacy interleaved thinking support.

Request Parameters

model
string
required
The model ID. Supported models include:
  • blackboxai/anthropic/claude-opus-4.8
  • blackboxai/anthropic/claude-opus-4.7
  • blackboxai/anthropic/claude-opus-4.6
  • blackboxai/anthropic/claude-opus-4.5
  • blackboxai/anthropic/claude-sonnet-4.6
  • blackboxai/anthropic/claude-sonnet-4.5
max_tokens
integer
required
Maximum number of tokens to generate.
messages
array
required
Array of message objects with role (user or assistant) and content fields.
system
string
System prompt for the conversation.
tools
array
Array of tool definitions using the Anthropic input_schema format. See Tool Calling.
thinking
object
Configuration for extended / interleaved thinking. See Interleaved Thinking.

Response Fields

id
string
Unique message identifier.
type
string
Always "message".
role
string
Always "assistant".
content
array
Array of content blocks. Each block has a type field:
  • text — Text response with a text field
  • tool_use — Tool call with id, name, and input fields
  • thinking — Thinking block with a thinking field (when thinking is enabled)
stop_reason
string
Why the model stopped generating:
  • end_turn — Natural completion
  • tool_use — Model wants to call a tool
  • max_tokens — Hit the token limit
usage
object
Token usage with input_tokens and output_tokens.

Supported Models

Tool Calling

Define tools and build multi-turn agentic loops

Interleaved Thinking

Enable reasoning between tool calls