Docs — API Reference

The core resource. Create a run, read it back with its trace, delete it when you are done. Base URL: https://api.myndlabs.ai

[ 01 ]Create a run

POST/v1/runs

Creates and executes a run. The call is synchronous for y0-fast and returns 201 with the completed run; y0-deep runs may return status "running" — poll with GET until completed. Pass an Idempotency-Key header to make retries safe.

paramtypereqdescription
modelstringrequiredExecution model — "y0-fast" or "y0-deep".
promptstringrequiredWhat the run should accomplish. 1–4,000 characters.
contextstring[]optionalContext sources to attach — any of "calendar", "documents", "finance". Defaults to none.
max_stepsintegeroptionalHard ceiling on plan-and-act steps, 1–16. Defaults to 4. Enforced, not advisory.
metadataobjectoptionalUp to 16 string key–value pairs, echoed back on the run and in webhooks.
[ request ]application/json
{
  "model": "y0-fast",
  "prompt": "Prepare my Thursday.",
  "context": ["calendar", "documents"],
  "max_steps": 4
}
[ response ]201 created
{
  "id": "run_4af2c19e",
  "object": "run",
  "status": "completed",
  "model": "y0-fast",
  "steps_used": 2,
  "max_steps": 4,
  "created_at": "2026-06-10T07:31:04Z",
  "result": {
    "summary": "Thursday brief drafted — 1 deadline, 1 invoice, 1 draft.",
    "artifacts": ["doc_thursday_brief"]
  }
}

[ 02 ]Retrieve a run

GET/v1/runs/:id

Returns the run with its full trace: the plan, every context fetch and the scope that authorized it, every step, and the result. Traces are replayable — the same trace renders identically forever.

paramtypereqdescription
idstringrequiredRun identifier from the create response, e.g. run_4af2c19e. Path parameter.
include_tracebooleanoptionalQuery parameter. Include the full step-by-step trace. Defaults to true.
[ response ]200 ok
{
  "id": "run_4af2c19e",
  "object": "run",
  "status": "completed",
  "trace": [
    { "type": "plan",    "ms": 96,  "steps": 2 },
    { "type": "context", "source": "calendar",
      "scope": "calendar:read", "items": 3 },
    { "type": "step",    "n": 1, "action": "collect_deadlines" },
    { "type": "step",    "n": 2, "action": "draft_brief" },
    { "type": "result",  "ms_total": 612 }
  ]
}

[ 03 ]Delete a run

DELETE/v1/runs/:id

Permanently removes the run record and its trace. The trust kernel's audit log entries are retained — deletion erases your data, not the record that an access happened.

paramtypereqdescription
idstringrequiredRun identifier. Path parameter. Deletion removes the run record and its trace; the audit log is retained.
[ response ]200 ok
{
  "id": "run_4af2c19e",
  "object": "run",
  "deleted": true
}

[ 04 ]Errors

statuscodemeaning
400invalid_requestA field failed validation. The errors object names each offending field.
401unauthenticatedMissing or invalid API key in the Authorization header.
403scope_deniedThe run requested a context source your key's scopes do not allow.
404not_foundNo run with that id exists in this project.
409already_deletedThe run was deleted; its trace is no longer available.
422step_limitThe plan could not fit within max_steps. Raise the ceiling or narrow the prompt.
429rate_limitedToo many requests. Honor the Retry-After header.
500internalOur fault. Retried safely — run creation is idempotent per Idempotency-Key header.