Skip to main content
POST
Create message
/v1/messages accepts Anthropic Messages API payloads and returns Anthropic-formatted responses.

Streaming

Set stream: true to receive server-sent events in Anthropic format (message_start, content_block_*, message_delta, message_stop).

Notes

  • Anthropic tool-use fields are supported.
  • stream: true also works with tool loops. For gateway-managed server tools, Phaseo may materialize the upstream tool-call turn, continue the loop, and re-emit a synthetic stream.
  • The Anthropic-native web search tool shape is also accepted directly in tools, for example type: "web_search_20250305".
  • The X-Phaseo-Strictness header controls how unsupported parameters are handled.

Server tools

/v1/messages also supports these gateway-managed server tools:
  • gateway:datetime
  • phaseo:web_search
  • phaseo:web_fetch
  • phaseo:advisor
  • phaseo:image_generation
Phaseo rewrites these tools to Anthropic-compatible format upstream, executes them server-side, and continues the tool loop. When a compatible Anthropic model/provider pair supports native web search, you can also pass the native tool definition through directly:
Provider routing still filters for web_search_options support before execution.

Datetime example

When used, the usage.server_tool_use.* counters report server-tool invocations.

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
model
string
required
messages
object[]
required
Minimum array length: 1
max_tokens
integer
required
Required range: x >= 1
system
temperature
number
Required range: 0 <= x <= 1
top_p
number
Required range: 0 <= x <= 1
top_k
integer
Required range: x >= 1
tools
object[]

Anthropic-compatible tools plus gateway-managed server tools.

tool_choice

Anthropic tool choice object/string. Gateway-managed server tool names are also accepted and rewritten by the gateway.

stream
boolean
metadata
object
session_id
string

Unique identifier for grouping related requests (for example, a conversation or agent workflow) for observability.

Maximum string length: 256
reasoning
object
stop_sequences
string[]
provider_options
object

Optional provider-specific options.

usage
boolean
meta
boolean
echo_upstream_request
boolean
debug
object

Gateway debug controls. These flags are never forwarded upstream.

provider
object

Provider routing preferences for gateway selection.

Response

Message response

id
string
type
string
role
enum<string>
Available options:
assistant
model
string
content
object[]
stop_reason
string
stop_sequence
string
usage
object
Last modified on July 26, 2026