curl https://spro.hridaai.com/v1/messages \ -H "Content-Type: application/json" \ -H "x-api-key: spro-xxxxxxxxxxxxxxxx" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "anthropic/claude-sonnet-4", "max_tokens": 1024, "messages": [ {"role": "user", "content": "What is the capital of France?"} ] }'{ "id": "msg_abc123", "type": "message", "role": "assistant", "model": "anthropic/claude-sonnet-4", "content": [ { "type": "text", "text": "The capital of France is Paris." } ], "stop_reason": "end_turn", "usage": { "input_tokens": 12, "output_tokens": 9 }}POST https://spro.hridaai.com/v1/messages
Anthropic-compatible Messages API. Point the Anthropic SDK at Spro and keep your existing code — the request is routed through the same pipeline as every other surface: model resolution, BYOK/managed credentials, guardrails, and usage logging.
Both auth styles are accepted: the native x-api-key header (what the Anthropic SDK sends) and Authorization: Bearer (OpenAI-style).
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model ID to use, provider-prefixed — e.g. anthropic/claude-sonnet-4. |
messages | array | Required | Conversation messages with role (user or assistant) and content. |
max_tokens | integer | Required | Maximum number of tokens to generate. |
system | string or array | Optional | System prompt — a string, or content blocks. |
metadata | object | Optional | Key-value metadata attached to the request. |
stop_sequences | array | Optional | Sequences that end generation. |
stream | boolean | Optional | If true, events are sent as server-sent events (terminating at message_stop). |
temperature | number | Optional | Sampling temperature between 0 and 1. |
tool_choice | object | Optional | Controls which tool the model calls. |
tools | array | Optional | Tools the model may use. |
top_k | integer | Optional | Sample from the top K options. |
top_p | number | Optional | Nucleus sampling. |
Streaming
With "stream": true, Anthropic SSE events are forwarded as-is — message_start, incremental content_block_delta events, and message_stop:
event: content_block_deltadata: {"type":"content_block_delta","delta":{"type":"text_delta","text":"Paris"}}
event: message_stopdata: {"type":"message_stop"}Guardrails
Input guardrails scan the user messages and output guardrails scan the generated text exactly as on the chat completions surface — a blocked request returns 403 Forbidden and never reaches the model:
{ "error": { "message": "Request blocked by guardrail: sensitive_information_disclosure", "type": "guardrail_block", "code": "GUARDRAIL_BLOCKED" }}