Broker API¶
The broker exposes FastAPI routes grouped by responsibility. Local development
serves OpenAPI at /docs and /openapi.json.
Users and API keys¶
POST /usersCreate a user with optional initial credits.
GET /users/meReturn the authenticated user profile.
POST /users/creditsAdd credits to the authenticated account.
POST /users/rotate-keyRotate the default API key and return the new key.
Jobs¶
POST /run/modelSubmit a model inference job.
POST /run/equationSubmit a structured equation job.
GET /jobs/{job_id}Read job status, metadata, and output when available.
GET /jobs/{job_id}/streamStream Server-Sent Events for tokens and terminal job state.
POST /jobs/{job_id}/cancelCancel a queued or running job.
Hosts¶
POST /hosts/registerRegister a host and its model capabilities.
POST /hosts/heartbeatKeep a host online and update its status.
POST /hosts/next-jobAtomically claim the next compatible queued job.
POST /hosts/jobs/{job_id}/chunkPublish a generated token or text chunk.
POST /hosts/complete-job/{job_id}Complete a job and finalize billing.
POST /hosts/fail-job/{job_id}Fail a job and refund reserved credits.
Catalog and discovery¶
GET /modelsList registered model specifications.
GET /models/{model_name}Inspect a single registered model.
GET /hostsDiscover public host capacity and filter by model or status.
Operations¶
GET /metricsPrometheus metrics for jobs, hosts, runtime, and cost.
/admin/*Admin-only endpoints protected by
x-admin-key.