Skip to content

Management API: automate your cluster

Every page of the GPU Kitchen app talks to the controller over HTTP. The part of that API under /api/v1/ is stable: it is documented, and it does not change under a script that uses it. Everything else under /api/ belongs to the app’s own pages and can change in any release. Do not script it.

The reference lists each operation with its inputs, its response and its errors. It is built from an OpenAPI 3.1 document: load it in any OpenAPI tool to generate a client.

Open My account → Access, expand Automation keys, then click New automation key. Choose:

  • a Label, to recognise the key later;
  • an Access level: the key acts as you, but never above this level;
  • Read only, for a key that may only read;
  • when it Expires after.

The key is shown once. Copy it then. It starts with gpuk_mgmt_. It is not an inference key (sk-gpuk-…): the inference proxy refuses it, and an inference key opens nothing here.

Send the key as a Bearer token. The controller’s address is the one you open the app with. Set Url to your local instance in the sidebar to update these examples, then use their copy button. Replace the key placeholder with your automation key. The first request lists your nodes.

Terminal window
export GPUK=http://localhost:1337
export GPUK_KEY=gpuk_mgmt_…
curl -s "$GPUK/api/v1/nodes" -H "Authorization: Bearer $GPUK_KEY"

Revoking the key stops it at the next request. So does disabling its owner.

  • A key acts as you, capped by its access level. If your own access goes down, the key’s does too.
  • A read-only key may only call operations whose effect is read. The reference marks each operation with x-gpuk-effect: read, write or destructive.
  • Some operations need a signed-in session and always refuse a key: signing in, changing a password, and creating, listing or revoking keys. The reference lists only session as their security. A leaked key can never create its successor.
  • Each operation states the minimum role it needs in x-gpuk-access.
  • An operation behind a feature flag carries x-gpuk-flag with the flag’s key. It is served only where that flag is on and answers 404 elsewhere; today, planning.reservations.
  • Bodies are JSON, with snake_case fields. Times are ISO 8601 in UTC.
  • A list comes under its resource name, for example { "keys": [...] }.
  • A long list comes in pages. Pass limit (1 to 500, 50 by default). The response carries next_cursor: pass it back as cursor to get the next page. It is null on the last page. There is no total count.
  • Creating something answers 201. Deleting answers 204 with no body.

Every error has the same shape:

{ "error": { "code": "validation_error", "message": "body.read_only: Invalid input" } }
  • Branch on code. It never changes. message is a sentence to show a person.
  • 400 validation_error means the input was refused. details.issues names each field.
  • Any other 400 code names a request that is well formed but refused, such as last_super_admin. Each operation lists its codes in the reference.
  • A refusal keeps its own code and sentence whatever its status, such as 409 member_signed_in.
  • What a refusal says beyond its sentence, such as the checks that failed, is in error.details.
  • 401 auth_required means the key is missing, wrong, revoked or expired.
  • 403 forbidden means the key, or you, may not do this.
  • 404 also answers for something that belongs to someone else. The API never confirms that it exists.
  • Each operation lists its own codes in the reference.

Some operations create or start something. They take an Idempotency-Key header. If you lose the answer, send the same request again with the same key: for 24 hours you get the first answer back, and nothing is done twice. The reference marks these operations.

Your cluster is also an MCP server, at /api/mcp on the address you open the app with. Each operation of this API is one tool. The agent sees only the tools its key may call, and a read-only key sees only the tools that read.

For Claude Code:

Terminal window
claude mcp add --transport http gpu-kitchen http://localhost:1337/api/mcp \
--header "Authorization: Bearer gpuk_mgmt_…"

Give the agent a key with the smallest role it needs, and make it read-only when it only reports.

Each call below works with a key whose role allows it. The reference gives every field.

The nodes, then every GPU with what holds it:

GET /api/v1/nodes
GET /api/v1/gpus

A GPU’s state is free, busy (a GPU Kitchen container holds it, named in holder), foreign (another program uses its memory) or booked. Read it as text: a later version may add a state.

Each model says what it serves (task_type) and what it can do within that task (capabilities). Filter by task:

GET /api/v1/models?task_type=text-generation

List the recipes that would start now on your GPUs, and the GPU configurations your cards can form. A recipe is run from the app, through a line of My cookbook: a model setup, served for an objective on one GPU configuration. The API follows and stops the container that results.

GET /api/v1/recipes?runnable=true&limit=20
GET /api/v1/gpu-configs

A recipe that came from the hub carries its share_code (GPU_KITCHEN_RECIPE_…), the code the app shows and copies, to share it with someone else.

Follow a container until its status is running, then stop it when you are done. A key that is not an administrator’s reads what a container serves and its state only: its node, cards, image, command and port are left out.

GET /api/v1/containers/17
POST /api/v1/containers/17/stop
{ "mode": "soft" }

A template is a recipe with values to try: the Recipe Builder measures each variation. Create one with the model, the engine, the task and the exact GPU configuration; its setup is fixed once created.

POST /api/v1/templates
Idempotency-Key: 7c1e-sweep-qwen
{ "name": "Qwen 8B sweep", "model_id": 12, "engine_id": 3, "task_type": "text-generation", "gpu_config": "rtx 3090*1" }

To delete a template that still has benchmarks queued or running, read what it would stop, then pass those benchmarks back. The deletion is refused if that work changed in between.

GET /api/v1/templates/5/deletion-impact
{ "queued": 2, "in_progress": 1, "live_benchmark_ids": [41, 42, 43] }
DELETE /api/v1/templates/5?armed_benchmark_ids=41,42,43

Put one or more recipes in the benchmark queue. Each recipe gets its own outcome: queued, or skipped with its reason.

POST /api/v1/benchmarks
Idempotency-Key: 5d2f-nightly-bench
{ "recipe_ids": [42], "gpu_config": "rtx 3090*1" }
{
"outcomes": [
{
"recipe_id": 42,
"queued": false,
"benchmark": null,
"skipped_reason": "already_tested",
"detail": null,
"existing_benchmark_id": null,
"existing_result_id": 318
}
]
}

See what waits and runs, then read the results, newest first:

GET /api/v1/benchmarks?status=queued
GET /api/v1/benchmarks/queues
GET /api/v1/benchmarks/results?recipe_id=42

Admins can read what was used over whole UTC days, by key, model or member (a member comes with their name in the enterprise edition). Without from and to, you get the current month up to today.

GET /api/v1/usage?group_by=model&from=2026-10-01&to=2026-10-07
{
"from": "2026-10-01",
"to": "2026-10-07",
"group_by": "model",
"rows": [
{
"group": "Qwen/Qwen3-8B",
"label": null,
"requests": 1240,
"tokens": 3120000,
"gpu_seconds": 5400
}
]
}

From a signed-in browser session only, because a key may not manage keys:

GET /api/v1/me/management-keys
{
"keys": [
{
"id": "3f9a…",
"label": "nightly report",
"role_ceiling": "admin",
"read_only": true,
"prefix": "gpuk_mgmt_3f9a…",
"created_at": "2026-10-07T08:00:00.000Z",
"expires_at": "2027-10-07T08:00:00.000Z",
"last_used_at": null,
"last_used_ip": null
}
]
}