Text
This quickstart walks you through making your first text generation request with Siraya AI.
Using the Siraya AI API directly
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"])
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
- Learn about provider and model routing with fallbacks
- Try other APIs: OpenAI-compatible, Anthropic-compatible, or OpenResponses