Claude Sonnet 5 API reference
Check Claude Sonnet 5 availability, inputs, parameters, file requirements, credit pricing, and request examples for Rivya Public API v1. Model ID: claude-sonnet-5-chat.
claude-sonnet-5-chat
text
Not required for the minimal request
Base rate per million tokens: 170 credits for input, 855 for output The final cost is rounded up to whole credits.
Chat
Non-streaming and SSE streaming chat
TOKEN_BASED
20000 characters
Request fields
Send one message per request. Rivya stores session history; include session_id to continue an API-created conversation. Do not send a messages array.
| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | claude-sonnet-5-chat | Set model to claude-sonnet-5-chat. |
| session_id | string | No | - | ID of an API-created chat session. Omit it to start a new session. |
| message | string | Yes | - | The user message for this turn. Rivya loads earlier messages from the API session; do not send a messages array. |
| attachments | array | No | - | Optional image attachments as objects containing file_id values from your Files API uploads. Direct image URLs are not accepted, and the model must support images. |
| enable_web_search | boolean | No | false | Only applies when the selected chat model supports web search. |
| reasoning_effort | string | No | default | Optional reasoning_effort value: default, minimal, low, medium, high, or xhigh. Use only values supported by the selected model. |
| client_request_id | string | No | - | Optional ID for tracing this request in your system. It does not replace Idempotency-Key. |
| thought_mode | string | No | default | Optional thought_mode: default, on, or off. For models that support thoughts, on enables the option, off disables it, and default uses the model's default behavior. Other models ignore this field. |
| tool_slug | string | No | - | Optional slug of an existing Rivya chat tool. Rivya adds the tool's instructions to this turn. If the session already has a tool, omit this field or use the same slug. |
Model parameters
Use the shared Chat API fields above. Check chat_capabilities in GET /api/v1/models for this model's web search, image attachments, thoughts, and reasoning support.
Minimal request
{
"model": "claude-sonnet-5-chat",
"message": "Outline three steps for launching a product image campaign."
}Example response
A non-streaming Chat response includes an assistant message, token usage, credit usage, and settlement status. A completed message does not always mean the credit settlement is final.
{
"id": "chatcmpl_assistant_message_id",
"object": "chat.completion",
"session_id": "chat_session_claude_sonnet_5_chat",
"model": "claude-sonnet-5-chat",
"created_at": "2026-05-11T00:00:00.000Z",
"message": {
"id": "assistant_message_id",
"role": "assistant",
"content": "1. Choose the product images. 2. Write the launch posts. 3. Schedule publication and review the results.",
"created_at": "2026-05-11T00:00:00.000Z"
},
"usage": {
"input_tokens": 1200,
"output_tokens": 320,
"total_tokens": 1520
},
"credits": {
"reserved": 0,
"final": 0,
"settlement_status": "PENDING"
}
}Common errors
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found, chat_model_not_supported, chat_session_conflict, chat_attachment_not_supported
Chat API supports non-streaming and SSE streaming turns in Public API v1. Image attachments are not supported for this chat model.
