Quickstart

Deploy a Sunlight model in your project and call it with any OpenAI SDK. Each deployment gets its own base URL.

  1. Create an account and a project.
  2. In the project, choose Deploy a model. Copy the endpoint it shows.
  3. Create an API key for the same project under API keys. It is shown once.
  4. Store it as YAVQO_API_KEY and 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; model is optional there.
  • You can also call https://aihub.yavqo.com/api/v1/chat/completions with the deployment name as model.
  • 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.

ModelInput, per 1M tokensOutput, 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.

Header
Authorization: Bearer yavqo_live_…

Chat completions

POST /api/v1/deployments/<name>/chat/completions or POST /api/v1/chat/completions

FieldDescription
modelA deployment name or base model ID. Optional on a deployment endpoint.
messagesRequired. Array of { role, content } with roles system, user or assistant.
streamOptional. Set to true to receive server-sent events.
temperatureOptional. 0 to 2. Lower is more focused.
max_tokensOptional. 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.

IDNameStatus
sunlight-2-proSunlight 2 ProLive

Errors and limits

Errors use the OpenAI shape: { error: { message, type, code } }.

StatusMeaning
400The request body is not valid.
401The key is missing, wrong or revoked.
404The model or deployment does not exist in this key's project.
403The deployment is suspended by Yavqo. The message includes the reason. Contact Yavqo support.
409The deployment is paused.
429A 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, 503The model service is unavailable. Retry with backoff.