Run a model

Create a message

Changed on

Anthropic-compatible Messages API. Set the base URL of an Anthropic SDK or of Claude Code to the v3 base URL followed by /anthropic, and send an API key in x-api-key or Authorization: Bearer. Each request runs as a chat completion, and is charged, limited and recorded as one. The route serves client tools, and answers a tool of any other type with a 400. Each image the model does not accept becomes a text note in its place: every image on a model without image input, and on any other model the oldest images beyond the model's max_images_per_request. output_config.effort becomes chat's reasoning_effort, and thinking of type disabled becomes reasoning_effort: none, whatever output_config.effort says. output_config.format becomes chat's response_format, so the answer's text block holds JSON that matches the schema. Beside tools, a request with output_config.format must set tool_choice to any, tool or none, and gets a 400 under auto. The route accepts thinking.budget_tokens, cache_control and context_management, and they have no effect. The model's reasoning comes back as thinking blocks with an empty signature. Errors are those of POST /chat/completions in Anthropic's error body: the body's type is error, error.type is Anthropic's error type for the status, and error keeps the v3 error fields. The 400 for a value that chat rejects names the chat field, such as reasoning_effort or messages[3].content, under the message or tool_result block the caller sent. With stream: true the response is text/event-stream in the Messages event format, ending with message_stop, or with an error event for a failure after streaming has begun.

post/anthropic/v1/messages

Request

  • Base URL
    https://api.hedra.com/v3
  • Auth
    • API key in header Authorization
    • or HTTP bearer

Response

Successful Response

unknown required

Changes