First Request

List the models your key can reach, then send your first chat completion. Any OpenAI-compatible client works.

1. Discover models

bash
curl https://api.exosai.tech/v1/models \
  -H "Authorization: Bearer $EXOSAI_API_KEY"

The response is the standard OpenAI list envelope. Use the id field verbatim as the model value in later requests:

json
{
  "object": "list",
  "data": [
    { "id": "YOUR_MODEL_ID", "object": "model", "created": 1757000000, "owned_by": "exosai" }
  ]
}

2. Send a completion

Replace YOUR_MODEL_ID in the examples with an exact id from your model list.

bash
curl https://api.exosai.tech/v1/chat/completions \
  -H "Authorization: Bearer $EXOSAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "messages": [
      { "role": "system", "content": "You are terse." },
      { "role": "user", "content": "Why is the sky blue?" }
    ]
  }'

3. Use your existing SDK

Point the OpenAI SDK at the gateway. Nothing else changes.

javascript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.EXOSAI_API_KEY,
  baseURL: 'https://api.exosai.tech/v1',
});

const res = await client.chat.completions.create({
  model: 'YOUR_MODEL_ID',
  messages: [{ role: 'user', content: 'Summarise HTTP caching in two lines.' }],
});

console.log(res.choices[0].message.content);
python
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["EXOSAI_API_KEY"], base_url="https://api.exosai.tech/v1")

res = client.chat.completions.create(
    model="YOUR_MODEL_ID",
    messages=[{"role": "user", "content": "Explain SSE in one paragraph."}],
)

print(res.choices[0].message.content)

ExosAI

ExosAI — OpenAI-compatible AI API