Variant Group · Test assignment
Generation API
One endpoint: send a prompt, get the model's answer back as a stream. Authenticate with your own secret token.
Authentication
Your secret token comes with the assignment. Requests without one, or with a token we do not recognise, get 401.
Authorization: Bearer <your secret token>
Content-Type: application/jsonRequest
{
"system": "You are a concise storyteller.",
"prompt": "Write a story about a cat.",
"maxTokens": 1500
}Only prompt is required. system and maxTokens are optional.
Response
The response arrives as a stream of Server-Sent Events, Content-Type: text/event-stream. Each chunk contains one event.
← 200 OK · text/event-stream
event: delta
data: {"text":"The "}
event: delta
data: {"text":"model "}
event: delta
data: {"text":"replies"}
← connection closedJoin the fragments in the order they arrive. The stream closes after the last delta event — there is no separate completion event.
Errors
On failure the service returns a 4xx or 5xx status code and a body of this shape:
{ "error": { "code": "...", "message": "..." } }- invalid_token
- Secret token missing or not recognised
- invalid_request
- Malformed body or empty prompt
- rate_limit_exceeded
- Too many requests. The
Retry-Afterheader says how many seconds to wait - upstream_error
- The model provider is unavailable
Limits
- 6 requests per minute per secret token
- 1,500 tokens per response
- 24,000 characters per request
This specification was written a while ago and may have drifted from how the service actually behaves. If you find discrepancies, describe them in your README.