HridaSpro Docs

Api Reference

Messages API

Anthropic-compatible Messages endpoint — use the native Anthropic SDK through Spro.

API console
POST/v1/messages
Bash
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?"}    ]  }'
JSON
{  "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

ParameterTypeRequiredDescription
modelstringRequiredModel ID to use, provider-prefixed — e.g. anthropic/claude-sonnet-4.
messagesarrayRequiredConversation messages with role (user or assistant) and content.
max_tokensintegerRequiredMaximum number of tokens to generate.
systemstring or arrayOptionalSystem prompt — a string, or content blocks.
metadataobjectOptionalKey-value metadata attached to the request.
stop_sequencesarrayOptionalSequences that end generation.
streambooleanOptionalIf true, events are sent as server-sent events (terminating at message_stop).
temperaturenumberOptionalSampling temperature between 0 and 1.
tool_choiceobjectOptionalControls which tool the model calls.
toolsarrayOptionalTools the model may use.
top_kintegerOptionalSample from the top K options.
top_pnumberOptionalNucleus 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"  }}