Create Anthropic Message
Anthropic Messages API, native pass-through.
Request
- Base URLhttps://api.edenai.run
- AuthHTTP bearer
Request body
List of fallback model IDs to try if the primary model fails. Models are tried in order. Example: ['anthropic/claude-3-opus', 'openai/gpt-4o']
Identifies a conversation, so its requests keep reaching the provider that holds its prompt cache. Any stable string you choose — a thread id, a ticket number, an agent run. Also accepted as the x-session-id header, for clients that cannot add body fields, and read from the headers coding agents already send (x-claude-code-session-id, x-session-affinity, session-id, session_id, and x-client-request-id from pi and Codex); the body field wins if both are sent. Without one, a conversation is recognised from its opening messages instead.
Models the '@edenai' router may choose BETWEEN — it picks the model, whereas routing picks the provider for a model you already named. Used only when model='@edenai'. Each entry is a bare model name (e.g. 'gpt-5.5' — the winner's provider is then picked like any provider-less request) or a 'provider/model' id (e.g. 'openai/gpt-5-nano' — the winner is served by that exact provider). Entries the router cannot rank are skipped and listed under edenai_metadata.routing.auto.dropped; entries naming a model already in the list collapse into its earliest spelling, which decides how the winner is returned. The request fails only when no entry is left. If not provided, the router chooses from a default pool of eligible catalog models. At most 64 entries of up to 128 characters each.
List of hooks to run before the LLM provider call. Each entry must have an 'action' key and optional 'params'. Example: [{'action': 'pdf_text_extract', 'params': {'method': 'default'}}]
List of hooks to run after the LLM provider call. Each entry must have an 'action' key and optional 'params'. Example: [{'action': 'json_heal', 'params': {'json_schema': {...}}}]
Example request
{
"tags": {
"client": "acme",
"project": "invoices"
}
}Response
Successful Response
Unique identifier for the message.
Object type. Always 'message' for this endpoint.
Conversational role of the response.
Model that generated the message.
Reason generation stopped, if known.
Custom stop sequence that triggered the stop, if any.
Changes
No recorded changes to this operation across all 1 revision of this API.