DEVELOPER DOCUMENTATION

Start building
in minutes.

One OpenAI-compatible endpoint gives your application access to every enabled QevrionAI model.

01 / QUICKSTART

Your first request

Create an account, add credits or choose a monthly plan, and generate an API key in your dashboard. Then send a request:

terminal
curl https://useqevrion.com/v1/chat/completions \
  -H 'Authorization: Bearer qv_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{"model":"openai/gpt-4o-mini",
       "messages":[{"role":"user","content":"Hello!"}]}'
02 / TYPESCRIPT SDK

Use the QevrionAI SDK

Install the SDK in your server project. It supports JavaScript and TypeScript with ESM imports on Node.js 20.3 or newer.

terminal
npm install @qevrion/sdk

Set QEVRION_API_KEY in your server environment to the key from your dashboard. This example selects the first enabled chat model; you can replace it with another ID from the filtered model list. Your account needs enough credits to cover the request.

TypeScript / server
import { Qevrion } from '@qevrion/sdk';

const client = new Qevrion({
  apiKey: process.env.QEVRION_API_KEY!,
});

const { data: models } = await client.models.list({ type: 'chat' });
const model = models[0]?.id;
if (!model) throw new Error('No models are enabled.');

const response = await client.chat.completions.create({
  model,
  messages: [{ role: 'user', content: 'Hello!' }],
  max_tokens: 256,
});

console.log(response.choices[0]?.message.content);

For JavaScript, remove the ! after process.env.QEVRION_API_KEY. Keep your key on the server and out of browser code.

03 / AUTHENTICATION

Use your API key

Send your key in the Authorization: Bearer header. Keep it on your server. You can create and revoke keys any time in the dashboard.

04 / ENDPOINT

Chat completions

POST /v1/chat/completions accepts model, messages, and optional temperature, top_p, max_tokens, and stream. The response follows the OpenAI chat completion format.

Use GET /v1/models to list enabled models.

05 / EMBEDDINGS

Turn text into vectors

Use POST /v1/embeddings for semantic search, document retrieval, and similarity matching. An admin must publish an embedding model before use. List enabled embedding models with GET /v1/models?type=embedding.

terminal
curl https://useqevrion.com/v1/embeddings \
  -H 'Authorization: Bearer qv_your_api_key' \
  -H 'Content-Type: application/json' \
  -d '{"model":"openai/text-embedding-3-small",
       "input":["A document about Lagos.","A document about Abuja."]}'

The SDK supports embeddings from version 0.2.0. Use the same API key and account credits as chat requests:

TypeScript / server
// Reuse the client from the SDK example above.
const { data: embeddingModels } = await client.models.list({ type: 'embedding' });
const embeddingModel = embeddingModels[0]?.id;
if (!embeddingModel) throw new Error('No embedding models are enabled.');

const result = await client.embeddings.create({
  model: embeddingModel,
  input: ['A document about Lagos.', 'A document about Abuja.'],
});

for (const item of result.data) {
  console.log(item.index, item.embedding);
}

Pass input as a non-empty string or a batch of up to 100 non-empty strings. The JSON request body is limited to 100,000 bytes, and model context limits still apply. Results include a vector and input index for each item, plus token usage when reported by the provider.

Optional parameters are dimensions (1–65,536), encoding_format (float, the default, or base64), and the provider-specific input_type. Supported dimensions and task hints depend on the selected model. Embeddings do not stream and accept text only.

Requests require enough credits for the reservation; insufficient credits return402 insufficient_credits. The charge is twice the reported upstream cost. If no cost is reported, usage is marked estimated and charged from prompt tokens and the published input price; if token usage is also missing, input bytes provide a conservative token estimate.

06 / STREAMING

Stream responses

Set stream: true to receive server-sent events. Usage in the final event is used to settle your credit charge.

With the SDK, use client.chat.completions.stream() and read the chunks with for await:

TypeScript / server
// Reuse the client and model from the SDK example above.
for await (const chunk of client.chat.completions.stream({
  model,
  messages: [{ role: 'user', content: 'Tell me a short story.' }],
  max_tokens: 256,
})) {
  process.stdout.write(chunk.choices[0]?.delta.content ?? '');
}
07 / BILLING

Prepaid credits

Requests reserve a conservative estimate before reaching the upstream model. After completion, your balance is charged twice the actual OpenRouter cost. You can add credits manually or receive credits with a monthly plan.