Claude Sonnet 4.6 API integration
Rivya Public API v1 দিয়ে Claude Sonnet 4.6 ব্যবহার করুন: model id claude-sonnet-4-6-chat, supported inputs, parameters, Files API rules, credits এবং response examples সহ।
claude-sonnet-4-6-chat
text
minimal request-এর জন্য required নয়
4
Chat
Chat API: non-streaming + SSE streaming
TOKEN_BASED
20000 characters
Request contract
Chat requests একবারে একটি message পাঠায়। Session history Rivya store করে; raw messages array পাঠাবেন না।
| Key | Type | Required | Default | বিবরণ |
|---|---|---|---|---|
| model | string | Yes | claude-sonnet-4-6-chat | claude-sonnet-4-6-chat API model id ব্যবহার করুন। |
| session_id | string | No | - | optional API-created chat session id। নতুন session শুরু করতে omit করুন। |
| message | string | Yes | - | পরের user message। Chat API history server-side session থেকে আসে, raw messages array থেকে নয়। |
| attachments | array | No | - | Files API থেকে returned optional image file_id values। External attachment URLs accepted নয়। |
| enable_web_search | boolean | No | false | selected chat model web search support করলে only applies। |
| reasoning_effort | string | No | default | optional reasoning effort: supported হলে default, minimal, low, medium, high বা xhigh। |
| client_request_id | string | No | - | আপনার system-এ requests trace করার optional client-side id। |
Model parameters
এই chat model উপরের shared Chat API fields ব্যবহার করে। web search, image file attachments, thoughts এবং reasoning support readiness data-তে reflected।
Minimal request
{
"model": "claude-sonnet-4-6-chat",
"message": "Write a concise launch plan for a new product image campaign"
}Create response
Chat endpoint completed assistant message, token usage এবং এই turn-এর final credit settlement return করে।
{
"id": "chatcmpl_msg_claude_sonnet_4_6_chat_example",
"object": "chat.completion",
"session_id": "chat_session_claude_sonnet_4_6_chat",
"model": "claude-sonnet-4-6-chat",
"created_at": "2026-05-11T00:00:00.000Z",
"message": {
"id": "assistant_message_id",
"role": "assistant",
"content": "A concise launch plan with clear next steps."
},
"usage": {
"input_tokens": 1200,
"output_tokens": 320,
"total_tokens": 1520
},
"credits": {
"reserved": 4,
"final": 4
}
}Common errors
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found, chat_model_not_supported, chat_session_conflict, chat_attachment_not_supported
Public API v1-এ Chat API non-streaming এবং SSE streaming turns support করে। এই chat model image attachments support করে না।