Quickstart
Deploy a Sunlight model in your project and call it with any OpenAI SDK. Each deployment gets its own base URL.
- Create an account and a project.
- In the project, choose Deploy a model. Copy the endpoint it shows.
- Create an API key for the same project under API keys. It is shown once.
- Store it as
YAVQO_API_KEYand run one of the examples below.
curl https://aihub.yavqo.com/api/v1/deployments/your-deployment/chat/completions \
-H "Authorization: Bearer $YAVQO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "your-deployment",
"messages": [{ "role": "user", "content": "Write a haiku about sunlight." }]
}'Deployments
A deployment is your own instance of a base model, inside one project. It has a name in the API (for example support-bot-3f9a1c), an optional system prompt, and default temperature and max tokens.
- Its endpoint is
https://aihub.yavqo.com/api/v1/deployments/<name>. Use it as the SDK base URL;modelis optional there. - You can also call
https://aihub.yavqo.com/api/v1/chat/completionswith the deployment name asmodel. - Keys only work with deployments in their own project.
- The system prompt is sent first. Your request's temperature and max_tokens win over the defaults.
- A paused deployment returns 409 until you resume it. A deleted one returns 404. A deployment suspended by Yavqo returns 403.
- Each deployment has its own rate limits: requests per minute (default 60) and tokens per minute (default 200,000), counted per calendar minute. Change them in the deployment's settings.
Responses include x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-limit-tokens, x-ratelimit-remaining-tokens and matching reset headers.
Pricing
You pay per token, billed to the project that owns the deployment. The deployment's system prompt counts as input. Failed requests are free.
| Model | Input, per 1M tokens | Output, per 1M tokens |
|---|---|---|
| sunlight-2-pro | €2.50 | €10.00 |
Every response includes a usage object with prompt and completion tokens, so you can track cost per call.
Authentication
Send your key in the Authorization header as a bearer token. Keys start with yavqo_live_. Keep them on your server; never ship them in browser or mobile code.
Authorization: Bearer yavqo_live_…Chat completions
POST /api/v1/deployments/<name>/chat/completions or POST /api/v1/chat/completions
| Field | Description |
|---|---|
| model | A deployment name or base model ID. Optional on a deployment endpoint. |
| messages | Required. Array of { role, content } with roles system, user or assistant. |
| stream | Optional. Set to true to receive server-sent events. |
| temperature | Optional. 0 to 2. Lower is more focused. |
| max_tokens | Optional. Upper limit for the reply length. |
Streaming
With stream: true the reply arrives as server-sent events, one chunk per line, ending with data: [DONE].
const stream = await client.chat.completions.create({
model: "sunlight-2-pro",
messages: [{ role: "user", content: "Tell me a short story." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Models
GET /api/v1/models lists the base models and your project's active deployments.
| ID | Name | Status |
|---|---|---|
| sunlight-2-pro | Sunlight 2 Pro | Live |
Errors and limits
Errors use the OpenAI shape: { error: { message, type, code } }.
| Status | Meaning |
|---|---|
| 400 | The request body is not valid. |
| 401 | The key is missing, wrong or revoked. |
| 404 | The model or deployment does not exist in this key's project. |
| 403 | The deployment is suspended by Yavqo. The message includes the reason. Contact Yavqo support. |
| 409 | The deployment is paused. |
| 429 | A rate limit was hit: the deployment's requests or tokens per minute, or 60 requests per minute per key when calling a base model directly. Wait for the Retry-After seconds. |
| 502, 503 | The model service is unavailable. Retry with backoff. |