Quick Start
This section will guide you to complete a minimal viable integration of UURoute in a few minutes.
Using API directly
import requests
import json
response = requests.post(
url="https://api.uuroute.ai/v1/chat/completions",
headers={
"Authorization": "Bearer <UUROUTE_API_KEY>",
"HTTP-Referer": "<YOUR_SITE_URL>", # Optional. Site URL for rankings on uuroute.ai.
"X-Title": "<YOUR_SITE_NAME>", # Optional. Site title for rankings on uuroute.ai.
},
data=json.dumps({
"model": "gpt-5.6-luna", # Optional
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
})
)
fetch('https://api.uuroute.ai/v1/chat/completions', {
method: 'POST',
headers: {
Authorization: 'Bearer <UUROUTE_API_KEY>',
'HTTP-Referer': '<YOUR_SITE_URL>', // Optional. Site URL for rankings on uuroute.ai.
'X-Title': '<YOUR_SITE_NAME>', // Optional. Site title for rankings on uuroute.ai.
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'gpt-5.6-luna',
messages: [
{
role: 'user',
content: 'What is the meaning of life?',
},
],
}),
});
curl https://api.uuroute.ai/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $UUROUTE_API_KEY" \
-d '{
"model": "gpt-5.6-luna",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
}'
Using the OpenAI SDK
You can also use any OpenAI-compatible client by setting the UURoute API base URL.
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://api.uuroute.ai/v1',
apiKey: '<UUROUTE_API_KEY>',
defaultHeaders: {
'HTTP-Referer': '<YOUR_SITE_URL>', // Optional. Site URL for rankings on uuroute.ai.
'X-Title': '<YOUR_SITE_NAME>', // Optional. Site title for rankings on uuroute.ai.
},
});
async function main() {
const completion = await openai.chat.completions.create({
model: 'gpt-5.6-luna',
messages: [
{
role: 'user',
content: 'What is the meaning of life?',
},
],
});
console.log(completion.choices[0].message);
}
main();
from openai import OpenAI
client = OpenAI(
base_url="https://api.uuroute.ai/v1",
api_key="<UUROUTE_API_KEY>",
)
completion = client.chat.completions.create(
extra_headers={
"HTTP-Referer": "<YOUR_SITE_URL>", # Optional. Site URL for rankings on uuroute.ai.
"X-Title": "<YOUR_SITE_NAME>", # Optional. Site title for rankings on uuroute.ai.
},
model="gpt-5.6-luna",
messages=[
{
"role": "user",
"content": "What is the meaning of life?"
}
]
)
print(completion.choices[0].message.content)
The API also supports streaming.