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.

terminal
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.

headers
Authorization: Bearer yl_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/json

POST /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.

request.json
{
  "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, and assistant.
  • • 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.

stream.mjs
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.

terminal
curl https://yoinkrelay.com/v1/models

Errors

Errors use a stable JSON envelope with message, type, code, and param.

400invalid_requestThe body or a parameter failed validation.
401invalid_api_keyThe key is missing, malformed, revoked, or unknown.
404model_not_foundThe requested catalog id is not configured.
413body_too_largeThe request exceeded the application body limit.
415unsupported_media_typeContent-Type was not application/json.
429rate_limit_exceededThe per-key request limit was reached.
429quota_exceededThe account's UTC daily token allowance was reached.
429ip_account_limitFive accounts were already registered from this IP today (UTC).
503upstream_unconfiguredThe owner has not connected an AI provider.
502/504upstream_*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.