Skip to main content

Messages

POST 

/gateway/v1/messages

Anthropic-compatible Messages API through a gateway router. Set model to the router's name: the router picks one of its models, Emissary calls it with the router's provider key, and returns the provider's answer in Messages format. With stream: true the answer streams as server-sent events, as Anthropic streams them. If the picked model's provider fails, the router's default model serves instead.

With the Anthropic SDK, set the base URL to https://api.withemissary.com/gateway and the API key to your Emissary API key. For Claude Code, set ANTHROPIC_BASE_URL to the same URL.

Request​

Responses​

The provider's answer, in Messages format