The management API
Deploy, roll out and benchmark from CI or a script.
Everything a model's Deployments tab does can be scripted, from CI or a terminal, with the management API under /api/v1. Use a key with Manage deployments ticked (Settings, API keys), or the workbox command's sign-in. The whole API is described as OpenAPI at /api/v1/openapi.json.
curl https://<your Workbox>/api/v1/deployments -H "Authorization: Bearer $WORKBOX_API_KEY"| Call | Does |
|---|---|
GET /api/v1/models | The workspace's models, a page at a time (?page=2) |
POST /api/v1/models | Adds a model from Hugging Face: { "repo": "Qwen/Qwen2.5-7B-Instruct", "revision": "main" } (revision optional) |
GET /api/v1/models/{name} | One model: where it came from, its size and how it is served |
GET /api/v1/deployments | The workspace's deployments, a page at a time |
POST /api/v1/deployments | Deploys a model: { "model": "tiny-shakespeare-12", "name": "shakespeare", "maxReplicas": 3 } |
GET /api/v1/deployments/{name} | One deployment, with its replicas and revisions |
PATCH /api/v1/deployments/{name} | Changes it: replicas, size, idle minutes, origins; rolls out a model ({ "model": "tiny-shakespeare-13" }); pauses or resumes it ({ "state": "paused" }) |
DELETE /api/v1/deployments/{name} | Deletes it |
GET /api/v1/deployments/{name}/metrics?range=24h | Its requests, tokens and speed (1h, 24h, 7d, 30d) |
POST /api/v1/benchmarks | Benchmarks a model in its playground ({ "model" }) or a deployment ({ "deployment" }) |
GET /api/v1/benchmarks/{id} | A benchmark's progress and results |
GET /api/v1/jobs/{project}/{number} | A job's state, outputs and model, and the name of the model it made (modelSlug) |
GET, POST /api/v1/keys, DELETE /api/v1/keys/{id} | The workspace's keys: owners and admins, signed in with workbox login |
Errors are in the same shape as the models endpoint's: {"error": {"message", "type", "code"}}.
Next: Box templates