API Reference

HTTP API

Reef answers model requests in the OpenAI Chat Completions, OpenAI Responses and Anthropic Messages formats, and its own operations under /reef/*. This page gives what all routes share; each resource page has one section per endpoint. The quickstart sends a first request.

Routes #

Served by names the service that answers a route when the services run apart; reef serve runs them all in one process. Below, ... is /reef/scenarios/{scenario}, or /reef/namespaces/{owner} in the data rows.

Routes

For

Served by

Page

POST /v1/*, .../v1/*, .../evaluation/v1/*, .../artifacts/{artifact_id}/v1/*, .../inference/*

Model requests

inference

Inference

/reef/report, /reef/records*, .../records*, .../operations, .../commits

Feedback, history

control, data

Records

/reef/scenarios, .../settings, .../contract, .../update, .../restore, .../redeploy

Scenarios

control, data

Scenarios

.../artifacts*

Artifacts

control, data

Artifacts

/reef/train, .../jobs*, .../requests/*, .../train-from, .../samples, .../next-job, .../sample-processing*

Training

control, data

Training

.../evaluations*, .../evaluation-capabilities

Evaluation

control, data

Evaluation

/reef/harness*

Harness

harness, control

Harness

.../data, .../data/{item_id}*, .../deleted-items*, .../collections*, .../scenarios/{scenario}/*, /reef/scenarios/{scenario}/tasks

Data items

data

Data items

POST .../data, .../data/trajectories, .../data/tasks*, .../data/imports*, .../data/exports*

Uploads

data

Data uploads

/healthz, /readyz, /reef/status

Status

all

Status

Authentication #

Send Authorization: Bearer <token>, or x-api-key without an Authorization header. reef.tokens and reef.token set the tokens (Server settings); without one, authentication is off. Each token opens every route; a gateway in front of Reef sets per-user permissions. /healthz, /readyz and CORS preflights need no token. A failed check returns 401 invalid service token.

Three credentials open fewer routes; Reef never reads a token from a query:

  • Evaluation token: a recipe's own evaluation calls get it. It opens POST .../evaluation/v1/* only.

  • Page key: the key of a returned page_path. It opens the two harness pages of one scenario.

  • Signed URL: ?signed=1 on a download returns a URL that opens it until it expires (archive).

Headers #

x-reef-scenario request The scenario, when the path does not name it: model requests, reports, record imports, training requests and harness routes need it (else 400).
x-reef-tag-<name> request Stored in metadata.tags of an inference record; Reef does not read it. x-reef-tag-artifact_id names the client's harness.
x-reef-rollout request 1 or true: a call of Reef's own rollouts, without a record; a stream returns 400.
x-reef-agent-record-id response The receipt of a model request.
x-reef-artifact-id response The artifact that answered, or of a harness tree.

A body can hold 64 MiB, a record import 10 MiB.

Errors #

An error body is the message as plain text; JSON bodies are named in their sections.

Status

When

400

An invalid body, query or header, or a value that the recipe or store refuses.

401

A missing or wrong credential.

403

An origin that reef.console-origins does not list, or an engine's 403.

404

An unknown scenario, artifact, item, evaluation or route.

409

A known ID with other content, a change while a training commit waits, a deleted scenario's name, reef.max-scenarios reached, or two aborted attempts.

413

A body over its limit.

501

An operation that the store or backend does not support.

502, 504

An engine that failed or returned no JSON object; one that did not answer within inference.timeout-s.

503

A store, engine or route that is not available, a record that Reef cannot write, or a full scenario cache (with Retry-After).

An engine's 4xx keeps its message. Reef keeps 400, 401, 402, 403, 404, 408, 409, 422 and 429, with the engine's Retry-After, and returns 400 for other 4xx.

Pagination #

A list returns a page and a cursor. Send the cursor back in the query parameter that the route names, such as after; it is null on the last page. Pages can change between reads.

Browser consoles #

reef.console-origins lists the exact origins that may call Reef from a browser, with GET, POST and DELETE and the headers Authorization, Content-Type and x-reef-scenario. They can read x-reef-agent-record-id and x-reef-artifact-id. Without the setting, Reef sends no CORS headers; other origins get 403.