LLM Chat API

Generate text and chat with our proprietary AI models that deliver ChatGPT-level performance at a fraction of the cost.
The Sonna Chat API is fully compatible with the OpenAI Chat Completion format, making it a drop-in replacement for your existing workflows.

Quick Start

Endpoint

POST https://sonna.web.id/api/v1/chat/completions

Authentication

bash
curl -X POST https://sonna.web.id/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sonna-chat-v1",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Hello!"}
    ]
  }'

Request Parameters

ParameterTypeRequiredDescription
modelstringYesThe model ID. Use sonna-chat-v1 for balanced performance.
messagesarrayYesA list of messages comprising the conversation history.
temperaturefloatNoControls randomness (0.0 to 2.0). Default is 1.0.
streambooleanNoIf set, partial message deltas will be sent (SSE).

Response

json
{
  "id": "chatcmpl-123",
  "object": "chat.completion",
  "created": 1677652288,
  "choices": [{
    "index": 0,
    "message": {
      "role": "assistant",
      "content": "Hello! I am Sonna AI. How can I assist you today?"
    },
    "finish_reason": "stop"
  }]
}

Any questions? Email us at hello@sonna.ai