Messages

Create message (Anthropic format)

Create a response in Anthropic Messages format. Supports native Anthropic dispatch and conversion to other supported providers; it is not restricted to the Anthropic provider. Native dispatch preserves provider-specific JSON fields when the destination supports the caller’s format. Cross-format routing converts through the Gateway’s shared representation: provider-only features are not guaranteed to survive. Support for reasoning, images, built-in tools and structured outputs depends on the destination model.

post/v1/messages

Request

  • Base URL: https://edgee.io
  • URL: https://edgee.io/v1/messages
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Headers

X-Edgee-Tagsstring

Comma-separated analytics tags. Trimmed and merged with body tags.

X-Edgee-Debug'true' | '1'

Enable debug capture for this request. Does not add a debug object to the API response.

X-Edgee-Compression-Tool-Result-Trimming'true' | 'false' | '1' | '0' | 'on' | 'off'

Turn tool-result trimming on or off. Overrides the API key setting for this request only. Values are case-insensitive, and a missing or invalid value keeps the key's setting.

X-Edgee-Compression-Tool-Surface-Reduction'true' | 'false' | '1' | '0' | 'on' | 'off'

Turn MCP tool surface reduction on or off. The threshold and resolver mode still come from the API key. Overrides the API key setting for this request only. Values are case-insensitive, and a missing or invalid value keeps the key's setting.

X-Edgee-Compression-Brevity'true' | 'false' | '1' | '0' | 'on' | 'off'

Turn output brevity on or off. Overrides the API key setting for this request only. Values are case-insensitive, and a missing or invalid value keeps the key's setting.

X-Edgee-Session-Idstring

Session identifier used to group request usage.

anthropic-versionstring
Example:2023-06-01

Anthropic API version header. Forwarded on the native Anthropic path; not a cross-provider capability switch.

anthropic-betastring

Provider beta feature flags for native Anthropic requests. Availability depends on the upstream provider.

Request body

modelstring required

Model identifier from GET /v1/models, in author/model format, or a configured global alias. Append :provider to request a specific provider route. Available models and providers depend on your key and organization policies.

max_tokensinteger required

Maximum number of tokens to generate

streamboolean

Enable streaming responses

enable_debugboolean

Enable request debug capture. Gateway-only field; does not add debug information to the response.

tagsstring[]

Optional tags to categorize and label the request. Useful for filtering and grouping requests in analytics and logs. Can also be sent via the x-edgee-tags header as a comma-separated string.

temperaturenumber
top_pnumber

Response

Message created successfully

idstring required

Unique identifier for this message

modelstring required

The model that generated the response

stop_reasonstring nullable

Stop reason. Native provider responses may include additional reasons.

type'message' required
role'assistant' required
stop_sequencestring nullable

Changes

No recorded changes to this operation across all 1 revision of this API.