Skip to main content
POST
Create message (Anthropic format)
Creates a message using Anthropic’s native Messages API format. This endpoint provides the same API format as Anthropic’s official API, making it easy to migrate existing integrations or use Anthropic-specific features.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your API key. More info here

Headers

X-Edgee-Tags
string

Comma-separated list of tags for categorizing and filtering requests in analytics and logs. Example: production,agent,codex

X-Edgee-Debug
boolean

Enable debug mode to include additional debugging information in the response.

X-Edgee-Compression-Model
enum<string>

Compression bundle to apply.

Available options:
claude,
opencode,
cursor,
codex
x-edgee-api-key
string

Claude CLI passthrough authentication. When set, the gateway uses this key instead of x-api-key / Authorization to authenticate the request. Used by the Claude Code CLI when proxying requests through Edgee.

x-edgee-session-id
string

Claude CLI session identifier. Used to group all messages from a single CLI session in analytics.

Body

application/json
model
string
required

The model ID to use (Anthropic format, without provider prefix)

Example:

"claude-sonnet-4.5"

max_tokens
integer
required

Maximum number of tokens to generate

Required range: x >= 1
Example:

1024

messages
object[]
required

Array of message objects

Minimum array length: 1
system

System prompt as a string

stream
boolean
default:false

Enable streaming responses

tools
object[]

Tool definitions

tool_choice
object

Response

Message created successfully

id
string
required

Unique identifier for this message

model
string
required

The model that generated the response

content
object[]
required

Array of content blocks

usage
object
required
stop_reason
enum<string>

Why the model stopped generating

Available options:
end_turn,
max_tokens,
tool_use