Skip to content
All systems operationalStatus

Create a message

Anthropic-compatible Messages endpoint for Claude models.

Sends a conversation to a Claude model and returns the next assistant message. The endpoint is wire-compatible with the Anthropic Messages API, so Claude Code and the Anthropic SDKs work unchanged.

POSThttps://api.evolved.to/v1/messages

Request

HeaderValue
x-api-keyYour key. Authorization: Bearer is also accepted.
anthropic-version2023-06-01
content-typeapplication/json

Body parameters

modelstringrequired
A Claude model ID, e.g. claude-opus-5. See Models.
max_tokensintegerrequired
Maximum number of tokens to generate. Use streaming for large values.
messagesarrayrequired
Alternating user and assistant turns. Content can be a string or an array of content blocks (text, images, documents, tool results).
systemstring | array
System prompt. Array form supports cache_control breakpoints.
streamboolean
Stream the response as server-sent events.
toolsarray
Tool definitions the model may call.
tool_choiceobject
How the model should use the provided tools.
thinkingobject
Thinking configuration, passed through to models that support it.
metadataobject
Request metadata such as an opaque user_id for abuse detection.

Other Messages API parameters are passed through to the model unchanged. Unsupported parameters return an invalid_request_error.

Response

idstring
Unique ID of the message.
contentarray
Content blocks generated by the model: text, thinking and tool_use. Iterate the array and read blocks by type rather than assuming the first block is text.
stop_reasonstring
Why generation stopped: end_turn, max_tokens, stop_sequence, tool_use, pause_turn or refusal.
usageobject
Token counts billed for this request: input_tokens, output_tokens, cache_creation_input_tokens and cache_read_input_tokens. See Balance & billing.
modelstring
The model that served the request.

Streaming

With "stream": true the response is a stream of server-sent events: message_start, content_block_start, content_block_delta, content_block_stop, message_delta and message_stop, with periodic ping events. The SDKs' stream helpers handle these for you.

curl https://api.evolved.to/v1/messages \
  -H "x-api-key: $EVOLVED_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 16000,
    "messages": [{"role": "user", "content": "Hello, Claude"}]
  }'
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.evolved.to",
    api_key=os.environ["EVOLVED_API_KEY"],
)

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=16000,
    messages=[{"role": "user", "content": "Hello, Claude"}],
)

for block in message.content:
    if block.type == "text":
        print(block.text)
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.evolved.to",
  apiKey: process.env.EVOLVED_API_KEY,
});

const message = await client.messages.create({
  model: "claude-opus-5",
  max_tokens: 16000,
  messages: [{ role: "user", content: "Hello, Claude" }],
});

for (const block of message.content) {
  if (block.type === "text") console.log(block.text);
}
Response · 200
{
  "id": "msg_01XFDUDYJgAACzvnptvVoYEL",
  "type": "message",
  "role": "assistant",
  "model": "claude-opus-5",
  "content": [
    { "type": "text", "text": "Hello! How can I help you today?" }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 12,
    "output_tokens": 11,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0
  }
}