SetuDocs

Quickstart

This guide walks you through making your first request to the Setu API in a few minutes.

1. Create an API key

Sign in and head to Dashboard → API Keys. Create a key and copy it — it's shown only once. Keys look like sk-setu-....

2. Make a request

The chat endpoint is OpenAI-compatible. Replace $SETU_API_KEY with your key:

bash
curl https://api.setu.dwet.ai/v1/chat/completions \
  -H "Authorization: Bearer $SETU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sutra-v2-pro",
    "messages": [
      {"role": "user", "content": "नमस्ते, आज मौसम कैसा है?"}
    ]
  }'

3. Stream the response

Set "stream": true to receive tokens as Server-Sent Events:

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.setu.dwet.ai/v1",
    api_key="sk-setu-...",
)

stream = client.chat.completions.create(
    model="sutra-v2-pro",
    messages=[{"role": "user", "content": "Write a haiku about Mumbai"}],
    stream=True,
)

for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Next steps