Documentation

Documentation

Make your first request to the Prabloé API.

Endpoint

Request
POST /api/v1/chat
Also served at
/api/v1/chat/completions (OpenAI shape) and /api/v1/messages (Anthropic Messages shape: top-level system, content blocks, required max_tokens).
Model
Any model in the picker (ids on /developers), or omit it for gpt-oss-20b; any other id is 400 model_not_in_scope. Add stream: true for models that think before they answer.
Messages
1 to 24, each a non-empty string up to 8,000 characters. Roles system, developer (as system), user, assistant; at least one user.
Sampling
temperature, top_p, stop (stop_sequences on Messages). max_tokens is clamped to the model's own ceiling (2,048 on the default); hitting it ends with finish_reason: "length".
Availability
404 until the public API is switched on.
curl https://www.prabloe.com/api/v1/chat \
  -H "Authorization: Bearer pb_secret_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-oss-20b",
    "messages": [
      { "role": "user", "content": "Explain a token bucket in two sentences." }
    ]
  }'

Authentication

Header
Authorization: Bearer pb_secret_…
Messages path
Also accepts x-api-key: pb_secret_…
Refused
pb_publishable_ keys and secret keys sent from a browser: 401 invalid_key. Call from your server.
Authorization: Bearer pb_secret_YOUR_KEY

# /api/v1/messages also accepts
x-api-key: pb_secret_YOUR_KEY

Streaming

Request
stream: true on either shape
Response
Server-sent events in the shape of the path you called
Usage
stream_options.include_usage adds a final usage chunk (OpenAI shape)
{
  "stream": true,
  "stream_options": { "include_usage": true },
  "messages": [
    { "role": "user", "content": "Hello" }
  ]
}

Errors

Body
{ error: { code, message }, request_id }; Messages wraps it as { type: "error", error, request_id }
Header
request-id on every response, errors included
Codes
invalid_key, key_revoked, rate_limited, spend_limit_reached, model_not_in_scope, insufficient_scope, invalid_request, unavailable
Limits
A per-key request limit, plus daily budgets per key and account. Headers x-prabloe-ratelimit-requests-limit, -remaining, -reset; a refusal is 429 with retry-after.
HTTP/1.1 429
retry-after: …
request-id: …

{
  "error": { "code": "rate_limited", "message": "…" },
  "request_id": "…"
}