Skip to main content
The /v1/messages endpoint accepts requests in Anthropic’s native Claude Messages API format. If you already use the anthropic Python or JavaScript SDK, you can redirect it at OpenOpen8 by changing only the base URL — all request and response fields remain identical. OpenOpen8 authenticates you with the token from your dashboard and routes the request to the configured Claude channel. You can also send Claude-format requests to non-Claude upstream channels; OpenOpen8 translates the format automatically where possible.

Endpoint

POST /v1/messages

Authentication

Claude Messages requests use two headers instead of Authorization:
HeaderRequiredDescription
x-api-keyYesYour OpenOpen8 token
anthropic-versionYesMust be 2023-06-01
You may alternatively use Authorization: Bearer YOUR_TOKEN for the API key if your client does not support x-api-key. OpenOpen8 accepts both forms.

Request parameters

model
string
required
The Claude model to use, for example claude-opus-4-5 or claude-3-7-sonnet-20250219. To enable extended thinking, use the -thinking model name suffix: claude-3-7-sonnet-20250219-thinking.
messages
object[]
required
The conversation history. Messages alternate between user and assistant roles. The first message must have role user.
max_tokens
integer
required
The maximum number of tokens to generate. This field is required by the Claude Messages API. For Claude models, the value must not exceed the model’s output token limit.
system
string | object[]
A system prompt that sets context and instructions for the conversation. Pass a plain string, or an array of content blocks for advanced use cases such as caching system prompts.
stream
boolean
default:"false"
When true, the response is returned as a stream of server-sent events using Anthropic’s streaming format. Events include message_start, content_block_start, content_block_delta, content_block_stop, message_delta, and message_stop.
temperature
number
Sampling temperature between 0 and 1. Higher values produce more varied output.
top_p
number
Nucleus sampling probability mass between 0 and 1. Recommended when temperature is not set.
top_k
integer
Sample from only the top k most likely tokens. Not recommended for most use cases.
stop_sequences
string[]
Custom sequences at which the model will stop generating. The stop sequence itself is not included in the output.
tools
object[]
Tools the model may call. Each tool defines a function the model can invoke.
tool_choice
object
Controls how the model selects tools.
thinking
object
Enable extended thinking for supported models. Use the -thinking model name suffix as an alternative.

Response fields

id
string
A unique identifier for this message in the format msg_....
type
string
Always "message" for complete responses.
role
string
Always "assistant" for generated messages.
content
object[]
An array of content blocks in the response.
model
string
The model that generated the response.
stop_reason
string
Why the model stopped generating. One of "end_turn" (natural end), "max_tokens" (token limit reached), "stop_sequence" (custom stop sequence matched), or "tool_use" (model called a tool).
usage
object
Token counts for this request.

Examples

curl https://openopen8.ai/v1/messages \
  -H "x-api-key: YOUR_TOKEN" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-5",
    "max_tokens": 1024,
    "system": "You are a concise technical assistant.",
    "messages": [
      {"role": "user", "content": "Explain what a mutex is in one paragraph."}
    ]
  }'
Example response:
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "A mutex (mutual exclusion lock) is a synchronization primitive that ensures only one thread can access a shared resource at a time..."
    }
  ],
  "model": "claude-opus-4-5",
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 28,
    "output_tokens": 87,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0
  }
}

Format conversion

You can also route Claude-format requests (/v1/messages) to non-Claude upstream channels. OpenOpen8 performs automatic format conversion, translating the Claude Messages format to the upstream provider’s native format. This lets you use a single client format across providers. Conversion is best-effort; some Claude-specific features (such as extended thinking) may not be available on all upstream channels.