Create an Anthropic-compatible message

Anthropic Messages-compatible skin over the same Infer routing, wallet, privacy, cache, media, tool, and receipt engine. Accepts the Anthropic SDK x-api-key header or Infer Bearer auth. With stream=true, message_start, thinking/text/tool content_block deltas, message_delta, and message_stop are forwarded incrementally; terminal message_delta includes settled usage and relay receipt metadata. Infer emits ping events during quiet periods and does not impose a generation wall-clock timeout while the connection remains alive.

post/v1/messages

Request

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

Headers

Idempotency-Keystring

Optional Infer idempotency key. A one-use key is generated when omitted.

X-Session-Affinitystring

Optional Infer session-affinity/cache-routing extension.

anthropic-versionstring

Accepted for Anthropic SDK compatibility. Infer currently normalizes the stable Messages request shape independently of this header.

Request body

modelstring required
max_tokensinteger required

Requested output ceiling. Capacity is limited by the selected Infer model/price option and its eligible routes, not by a global Infer token cap.

streamboolean
temperaturenumber
top_pnumber
top_kinteger
stop_sequencesstring[]
toolsobject[]
tool_choiceobject
thinkingobject

Response

Anthropic message or SSE stream

idstring required
type'message' required
role'assistant' required
modelstring required
stop_reasonstring nullable required
stop_sequencestring nullable required
usageobject required

Changes

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