Docs / API reference
API reference
OpenAI-compatible. Base URL https://api.qyn.io/v1. All requests authenticate with a Bearer key (qyn-live-…).
POST /v1/chat/completions
Create a chat completion. Streaming is not enabled yet — always send "stream": false.
Request body
| Field | Type | Notes |
|---|---|---|
model | string | Required. Catalog id, e.g. openai/gpt-6-astra |
messages | array | Required. OpenAI message objects (system supported; Anthropic models translate automatically) |
max_tokens | integer | Optional; mapped to max_completion_tokens for newer OpenAI models |
temperature, top_p, stop | — | Passed through |
stream | boolean | Must be false |
Response
Standard OpenAI chat completion, with two extra fields on usage: cost_cents (what this call cost) and balance_remaining_cents (your balance after it).
{
"id": "chatcmpl-…",
"object": "chat.completion",
"model": "anthropic/claude-sonnet-5",
"choices": [{ "index": 0, "message": { "role": "assistant", "content": "…" }, "finish_reason": "stop" }],
"usage": { "prompt_tokens": 13, "completion_tokens": 4, "total_tokens": 17,
"cost_cents": 0.0072, "balance_remaining_cents": 99.99 }
}
GET /v1/models
Returns the live catalog with per-model pricing (pricing.prompt_per_1m / completion_per_1m, USD).
Errors
| Status | Type | Meaning |
|---|---|---|
| 401 | invalid_api_key | Missing or unknown key |
| 402 | insufficient_credits | Balance empty — deposit USDG to top up |
| 400 | unknown_model / invalid_request | Bad model id or body |
| 502 | upstream_error | The provider failed; you are not billed |
Keys & deposits
| Endpoint | Purpose |
|---|---|
GET /get-key | Start an accountless key session (unique deposit amount) |
POST /api/claim | {"session": "…", "txHash": "0x…"} — claim a confirmed deposit instantly |
GET /d/<token> | Permanent key dashboard (balance, usage, top-up) |
GET /login | Wallet sign-in (SIWE) for multi-key accounts |
Model catalog & pricing
| Model | Input / 1M | Output / 1M |
|---|---|---|
openai/gpt-6-astra | $3 | $15 |
anthropic/claude-fable-5-1 | $3 | $15 |
anthropic/claude-opus-5 | $3 | $15 |
anthropic/claude-sonnet-5 | $1.2 | $6 |
anthropic/claude-sonnet-4.6 | $1.8 | $9 |
openai/gpt-5.6-sol | $1.2 | $6 |
openai/gpt-5 | $0.75 | $6 |
google/gemini-3.8-flash | $0.45 | $2.25 |
deepseek/deepseek-v4-pro | $0.63 | $1.89 |
zai/glm-5.3 | $0.84 | $2.64 |
meta/llama-4-maverick | $0.12 | $0.42 |
openai/gpt-5-mini | $0.225 | $1.8 |
openai/gpt-4o-mini | $0.135 | $0.54 |
anthropic/claude-haiku-4.5 | $0.9 | $4.5 |
moonshotai/kimi-k2.6 | $0.71 | $3.33 |
qwen/qwen3-coder | $0.285 | $0.95 |
zai/glm-4.7 | $0.38 | $1.66 |
deepseek/deepseek-v3.2 | $0.256 | $0.38 |
openai/gpt-oss-120b | $0.067 | $0.285 |
meta/llama-3.3-70b-instruct | $0.095 | $0.304 |
0% platform fees on everything above. Deposits settle in USDG on Robinhood Chain (chain ID 4663).