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-levelsystem, content blocks, requiredmax_tokens).- Model
- Any model in the picker (ids on
/developers), or omit it forgpt-oss-20b; any other id is400 model_not_in_scope. Addstream: truefor 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_sequenceson Messages).max_tokensis clamped to the model's own ceiling (2,048 on the default); hitting it ends withfinish_reason: "length".- Availability
404until 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_KEYStreaming
- Request
stream: trueon either shape- Response
- Server-sent events in the shape of the path you called
- Usage
stream_options.include_usageadds 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-idon 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 is429withretry-after.
HTTP/1.1 429
retry-after: …
request-id: …
{
"error": { "code": "rate_limited", "message": "…" },
"request_id": "…"
}