Skip to content

Text

This quickstart walks you through making your first text generation request with Siraya AI.

Using the Siraya AI API directly

curl https://llm.siraya.pro/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
  "model": "deepseek/deepseek-v3.2",
  "messages": [
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ]
}'
import requests
import json

response = requests.post(
  url="https://llm.siraya.pro/v1/chat/completions",
  headers={
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
  },
  data=json.dumps({
    "model": "deepseek/deepseek-v3.2", 
    "messages": [
      {
        "role": "user",
        "content": "What is the meaning of life?"
      }
    ]
  })
)
print(response.json()["choices"][0]["message"]["content"])
fetch('https://llm.siraya.pro/v1/chat/completions', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'deepseek/deepseek-v3.2',
    messages: [
      {
        role: 'user',
        content: 'What is the meaning of life?',
      },
    ],
  }),
});

The API also supports streaming.

Using the OpenAI SDK

Get started with just a few lines of code using your preferred SDK or framework.

from openai import OpenAI

client = OpenAI(
  base_url="https://llm.siraya.pro/v1",
  api_key="<API_KEY>",
)

completion = client.chat.completions.create(
  model="deepseek/deepseek-v3.2",
  messages=[
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ]
)

print(completion.choices[0].message.content)
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://llm.siraya.pro/v1',
  apiKey: '<API_KEY>',
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: 'deepseek/deepseek-v3.2',
    messages: [
      {
        role: 'user',
        content: 'What is the meaning of life?',
      },
    ],
  });

  console.log(completion.choices[0].message);
}

main();

Using third-party SDKs

For information about using third-party SDKs and frameworks with Siraya AI, please see our frameworks documentation.

Next steps