developers
API reference
YoinkLab accepts an OpenAI-style Chat Completions payload. The account and key system is active now; chat completion availability depends on the server owner configuring a real upstream provider.
base url
https://yoinkrelay.com/v1
content type
application/json
Quickstart
Sign in, create a key in the dashboard, and copy it to a secret manager. The raw value is not recoverable after the creation response.
export YOINKLAB_API_KEY="yl_live_your_key_here"
curl https://yoinkrelay.com/v1/chat/completions \
-H "Authorization: Bearer $YOINKLAB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "llama-3.3-70b-instruct",
"messages": [{ "role": "user", "content": "Say hello in five words." }]
}'Authentication
Send a key through the Authorization header. Keys start with yl_live_, carry 256 random bits, and are stored only as a server-peppered HMAC. Never put a key in a URL or browser bundle.
Authorization: Bearer yl_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/jsonPOST /v1/chat/completions
Supported fields are model, messages, stream, temperature, top_p, max_tokens, and stream_options.include_usage. Unknown object fields are discarded before forwarding.
{
"model": "llama-3.3-70b-instruct",
"messages": [
{ "role": "system", "content": "Be concise." },
{ "role": "user", "content": "Review this release plan." }
],
"temperature": 0.4,
"max_tokens": 1024
}- • Up to 100 messages and 256 KiB of combined message text.
- • Roles:
system,user, andassistant. - • Temperature range: 0–2; top_p range: 0–1.
- • The reverse proxy caps request bodies at 1 MiB; the route applies a tighter 512 KiB cap.
Streaming
Set stream: true to request server-sent events. Successful upstream streams are passed through with text/event-stream; provider cookies and unrelated response headers are never forwarded.
const response = await fetch("https://yoinkrelay.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.YOINKLAB_API_KEY}`,
},
body: JSON.stringify({
model: "llama-3.3-70b-instruct",
messages: [{ role: "user", content: "Write a short haiku." }],
stream: true,
}),
});
if (!response.ok) throw new Error(await response.text());
for await (const chunk of response.body) process.stdout.write(Buffer.from(chunk));GET /v1/models
Returns catalog metadata and an effective status. When no upstream is installed, entries report unavailable and routed_to: null rather than pretending a local model exists.
curl https://yoinkrelay.com/v1/modelsErrors
Errors use a stable JSON envelope with message, type, code, and param.
| 400 | invalid_request | The body or a parameter failed validation. |
| 401 | invalid_api_key | The key is missing, malformed, revoked, or unknown. |
| 404 | model_not_found | The requested catalog id is not configured. |
| 413 | body_too_large | The request exceeded the application body limit. |
| 415 | unsupported_media_type | Content-Type was not application/json. |
| 429 | rate_limit_exceeded | The per-key request limit was reached. |
| 429 | quota_exceeded | The account's UTC daily token allowance was reached. |
| 429 | ip_account_limit | Five accounts were already registered from this IP today (UTC). |
| 503 | upstream_unconfigured | The owner has not connected an AI provider. |
| 502/504 | upstream_* | The configured provider failed or timed out. |
Limits
The Extended plan includes 50,000,000 relayed tokens per calendar day, resetting at 00:00 UTC. API keys and the playground share an account-wide limit of 40 requests per fixed minute. A single IP may create up to 5 successful accounts per UTC day. Rate-limit responses include retry-after and x-ratelimit-reset; daily quota responses also expose x-quota-limit, x-quota-remaining, and the 00:00 UTC epoch in x-quota-reset.
Data handling
The relay stores account details, password hashes, session-token hashes, API-key HMACs, and operational request metadata. Prompt and completion content is not written to the application database. A configured upstream provider still receives request content under that provider's own terms.