{"openapi": "3.1.0", "info": {"title": "Dyadic Platform API", "version": "3.1.1", "description": "Dyadic's platform API: run the account's agents, compile and run Predictive Operation Graphs (POG), plan work and carry it out once approved, and record, investigate and verify what agents do.\n\nThis contract uses `https://api.dyadic.app/v1` (also the website `/api/v1` alias).\nOpenAI-compatible routes (`/openai/v1`: Chat, Responses, Decisions and shared web retrieval) live in the OpenAI-Compatible API contract, where `dyadic.pog` only enables optional POG turn acceleration. Standalone POG DAGs ([`/pog`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs)), Runs ([`/runs`](https://dyadic.app/developers/api/#platform/tag/runs)), Plans ([`/plans`](https://dyadic.app/developers/api/#platform/tag/plans)), and the Agent Black Box (`/blackbox`) live here in the Dyadic Platform API.\nWorkspace Store, independent Agent Tasks, Current Work and Patch remain owner-session workflows.\nAn API key does not grant those session routes or private administrator documentation.\n\nAuthenticate with a Dyadic API key: `Authorization: Bearer dya-...`. Each capability is a switch on the key, off until\nthe account's owner turns it on in the Workspace (API keys):\n\n| Switch | What it allows |\n|---|---|\n| (always) | [`POST /runs`](https://dyadic.app/developers/api/#platform/tag/runs/POST/runs) with the key's agents and tools; compile, run, inspect, modify, cancel and stream Predictive Operation Graphs ([`POST /pog`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/POST/pog), using the key's `agent_tools` scope); connected-app saves ([`POST /workspace/saves`](https://dyadic.app/developers/api/#platform/tag/connections/POST/workspace/saves)) once the person approves the app |\n| `plans` | make, read, revise, approve, cancel and follow this key's plans ([`/plans`](https://dyadic.app/developers/api/#platform/tag/plans)); runs with `plan_mode` or `plan_id` |\n| `blackbox_record` | record every call this key makes (runs, chat, responses, decisions, AI gateway requests) in the account's Black Box |\n| `blackbox_write` | send Black Box telemetry (events, OTLP, MCP), triage findings, bookmark events |\n| `blackbox_read` | read, verify, export, compare and simulate (from metadata) the runs this key made |\n| `blackbox_content` | read the content kept for them and their file lineage; exports and simulations with content (with `blackbox_read` on too) |\n| `blackbox_manage` | delete or erase the runs this key made; manage this key's own sinks (with `blackbox_read` on too) |\n\nA key reads only the runs it made: its own platform runs ([`POST /runs`](https://dyadic.app/developers/api/#platform/tag/runs/POST/runs), chat completions) and what it sent; and only\nthe plans it made, itself or through its runs, and its own POGs. A deleted run of the key's answers **410** `run_deleted`, its signed deletion record in\n`error.deletion`. Errors use OpenAI's error object. Black Box ingestion ([`POST /blackbox/events`](https://dyadic.app/developers/api/#platform/tag/black-box-recording/POST/blackbox/events),\n[`POST /blackbox/otlp/v1/traces`](https://dyadic.app/developers/api/#platform/tag/black-box-recording/POST/blackbox/otlp/v1/traces)) and the POG writes ([`POST /pog`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/POST/pog), [`PATCH /pog/{pog_id}`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/PATCH/pog/{pog_id}), [`POST /pog/{pog_id}/cancel`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/POST/pog/{pog_id}/cancel))\ntake an `Idempotency-Key` (up to 200 printable characters; the same key with another body answers **422**).\nBlack Box routes allow 600 requests a minute per key and switch (its streams and MCP, the key's own rate); ingestion\nalso 1,200 batches a minute and 200,000 events (512 MB) a day per account. Live streams (plan, POG and Black Box events, MCP) share a cap across workers of 20\nper account and 8 per key: past it, **429** `too_many_live_requests` with `Retry-After` before the stream opens.\nRecorded events from an application are `reported`, never `observed`; findings are hypotheses; simulations are never\nevidence. [`GET /blackbox/keys`](https://dyadic.app/developers/api/#platform/tag/black-box-evidence/GET/blackbox/keys) and [`POST /blackbox/verify`](https://dyadic.app/developers/api/#platform/tag/black-box-evidence/POST/blackbox/verify) need no key: anyone may verify a bundle.\n", "contact": {"name": "Dyadic", "url": "https://api.dyadic.app/"}}, "servers": [{"url": "https://api.dyadic.app/v1", "description": "Production"}], "security": [{"bearerAuth": []}], "tags": [{"name": "Runs"}, {"name": "POG (Predictive Operation Graphs)"}, {"name": "Plans"}, {"name": "Black Box: recording"}, {"name": "Black Box: runs"}, {"name": "Black Box: live"}, {"name": "Black Box: investigation"}, {"name": "Black Box: findings"}, {"name": "Black Box: evidence"}, {"name": "Black Box: privacy"}, {"name": "Black Box: sinks"}, {"name": "Black Box: MCP"}, {"name": "Connections"}, {"name": "Meta"}], "paths": {"/runs": {"post": {"tags": ["Runs"], "operationId": "createRun", "summary": "Run an agent", "responses": {"200": {"description": "The completed run (JSON), or its Server-Sent Events with `stream: true`", "headers": {"X-Request-Id": {"schema": {"type": "string"}, "description": "The run's `run_id`."}, "X-Dyadic-Credits": {"schema": {"type": "string"}, "description": "What it was charged (JSON only)."}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunCompleted"}}, "text/event-stream": {"schema": {"type": "string"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Body too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "Unsupported media type", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "502": {"description": "The model provider failed to answer", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Ask one of the account's agents (by id) or the application's own inline agent to answer a conversation, with the built-in plugins and tools it allows and the functions the application runs itself (the run then ends `requires_action`). With `stream: true` the events arrive as Server-Sent Events: `run.started`, `run.recording` (its Black Box record), `status`, `tool.started`, `tool.completed`, `plan.updated` (a plan the run made or moved, as [`GET /plans/{id}`](https://dyadic.app/developers/api/#platform/tag/plans/GET/plans/{id}) returns it), `delta`, `sources`, `image.generated`, `audio.generated`, `pog.*` (a POG the run made), `requires_action`, then `run.completed` or `error`; a `: keep-alive` comment every 15 quiet seconds. A request moderation refuses is still HTTP 400 `content_flagged`: the stream opens only after it. A failure answered as an HTTP error says what the run spent in `X-Dyadic-Cost-USD` and `X-Dyadic-Operation`. A `traceparent` header joins the caller's W3C trace.\n\nPlans (the key's `plans` switch): `plan_mode: true` investigates read-only and proposes a plan (a draft to approve with [`POST /plans/{id}/approve`](https://dyadic.app/developers/api/#platform/tag/plans/POST/plans/{id}/approve)); every tool that would change something is refused. `plan_id` carries out a plan: refused with error code `plan_not_runnable` unless a Plan Mode plan is approved at its current revision. A run that ends with steps left pauses the plan (`plan.interrupted`); another run with the same `plan_id` resumes it. `conversation_id` scopes the application's plans: a run is told about that conversation's plan under way.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunRequest"}}}}}}, "/plans": {"get": {"tags": ["Plans"], "operationId": "listPlans", "summary": "List this key's plans", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanList"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Newest change first, without their history (`events`). An unknown `status` or an `after` that isn't a plan id answers 400.\n\nNeeds the key's `plans` switch.", "parameters": [{"name": "conversation", "in": "query", "schema": {"type": "string"}, "description": "Only the plans of this conversation (a run's `conversation_id`)."}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["draft", "approved", "running", "paused", "completed", "failed", "cancelled"]}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 20}}, {"name": "after", "in": "query", "schema": {"type": "string", "format": "uuid"}, "description": "A plan id: the page after it (`last_id`)."}]}, "post": {"tags": ["Plans"], "operationId": "createPlan", "summary": "Make a plan", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Plan"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`mode: plan` (the default) makes a draft that waits for approval before any run carries it out; `mode: live` makes a plan running from the start (a Visual Plan of work under way). Steps may be strings (numbered in order) or {key, title, detail, depends_on}; up to 60, nested three deep (2.1, 2.1.1). Accounts may retain up to 10,000 plans, including up to 1,000 per API key. All statuses count; deleting a key does not remove its plans from the account total. Creation at capacity returns 400; existing plans can still be read, revised, approved and canceled.\n\nNeeds the key's `plans` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanCreate"}}}}}}, "/plans/{id}": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A plan id."}], "get": {"tags": ["Plans"], "operationId": "getPlan", "summary": "A plan, with its recent history", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Plan"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `plans` switch."}, "patch": {"tags": ["Plans"], "operationId": "revisePlan", "summary": "Revise a plan", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Plan"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "From the revision you saw (`revision`): refused with **409** `invalid_plan` if the plan moved on since. Fields left out stay as they are. Steps that keep their key keep their progress. An approved Plan Mode plan goes back to `draft` and is approved again before a run carries it out. A completed or cancelled plan can't be revised (400).\n\nNeeds the key's `plans` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanRevision"}}}}}}, "/plans/{id}/approve": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A plan id."}], "post": {"tags": ["Plans"], "operationId": "approvePlan", "summary": "Approve a revision", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Plan"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Approve the revision you reviewed (**409** if the plan was revised since). A draft, paused or approved plan can be approved (any other answers 400); a paused one stays paused, to resume where it stopped. Carrying it out is a run: [`POST /runs`](https://dyadic.app/developers/api/#platform/tag/runs/POST/runs) with `plan_id`.\n\nNeeds the key's `plans` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanApproval"}}}}}}, "/plans/{id}/cancel": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A plan id."}], "post": {"tags": ["Plans"], "operationId": "cancelPlan", "summary": "Cancel a plan", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Plan"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "No run carries it out after this. A completed or cancelled plan answers 400.\n\nNeeds the key's `plans` switch."}}, "/plans/{id}/steps/{key}": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A plan id."}, {"name": "key", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){0,2}$"}, "description": "A step's key: 2 is a top-level step, 2.1 a step inside it."}], "post": {"tags": ["Plans"], "operationId": "movePlanStep", "summary": "Move a step", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Plan"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Mark a step done by hand, skip it, fail or block it, or put it back to pending, once the plan is approved, running or paused (a draft or a finished plan answers 400, as does a step key it doesn't have). A step with sub-steps follows them (it starts when one starts and completes when all are completed or skipped): move its sub-steps instead (only `failed` and `blocked` apply to it directly). A step can't be completed before the steps it depends on are completed or skipped. Completed without `verified_by` keeps a note that the application marked it, not a run's check. When every step is done the plan is completed. Answers the plan as it is now.\n\nNeeds the key's `plans` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanStepMove"}}}}}}, "/plans/{id}/events": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A plan id."}], "get": {"tags": ["Plans"], "operationId": "listPlanEvents", "summary": "A plan's history, or follow it live", "responses": {"200": {"description": "The events (JSON), or Server-Sent Events", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlanEventList"}}, "text/event-stream": {"schema": {"type": "string"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "As JSON (the default): the plan's changes after `after`, oldest first. Asked with `Accept: text/event-stream` (or `stream=true`): Server-Sent Events. First `plan.snapshot` (the plan as it is now, no id), then each change as it is saved: `id` the event's id, `event` its type (`plan.created`, `plan.revised`, `plan.edited`, `plan.approved`, `plan.started`, `plan.resumed`, `plan.step`, `plan.interrupted`, `plan.completed`, `plan.cancelled`, `plan.patched`: a Workspace Patch corrected an earlier step and the plan is a new revision), `data` the PlanEvent with `plan` (the plan as it is then). `end` ({plan_id, status, last_id}) once the plan is completed, cancelled or failed; `reconnect` ({after}) after 30 minutes. A `: keep-alive` comment every 15 quiet seconds. Reconnect with `Last-Event-ID` (or `after`) to resume after the last event seen: nothing is missed or repeated.\n\nNeeds the key's `plans` switch.", "parameters": [{"name": "after", "in": "query", "schema": {"type": "integer", "minimum": 0, "default": 0}, "description": "The last event id seen."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 500, "default": 200}, "description": "JSON only."}, {"name": "stream", "in": "query", "schema": {"type": "boolean"}, "description": "Server-Sent Events (`true` or `1`), as `Accept: text/event-stream` asks."}, {"name": "Last-Event-ID", "in": "header", "schema": {"type": "integer"}, "description": "Resume a stream after this event (takes precedence over `after`)."}]}}, "/pog": {"get": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "listPogs", "summary": "List Predictive Operation Graphs (POGs)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PogList"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "This key's POGs, newest first: the latest `limit`, with no further pages.", "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["compiling", "running", "completed", "partial", "failed", "cancelled"]}}, {"name": "run_id", "in": "query", "schema": {"type": "string"}, "description": "Only the POGs made with this `run_id`."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 20}}]}, "post": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "createPog", "summary": "Compile and run a Predictive Operation Graph (POG)", "responses": {"200": {"description": "A dry run's compiled graph (`status: dry_run`, nothing ran), an idempotent replay, or the POG's events with `stream=true`", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pog"}}, "text/event-stream": {"schema": {"type": "string"}}}}, "201": {"description": "The POG as it ended (completed, partial, failed or cancelled), with its EvidencePackage", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pog"}}}}, "202": {"description": "Accepted (background=true)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pog"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "Idempotency-Key reused for another body", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Compiles a high-level intent and/or explicit DAG steps into an asynchronous POG with safe read-only speculation, `$future`/`$ref`/`${...}` data dependencies, conditional `when` branches, live graph updates, and a consolidated `EvidencePackage`. Pass `dry_run=true` to inspect the compiled graph without running nodes, `background=true` to return `202` immediately and follow [`GET /pog/{pog_id}/events`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/GET/pog/{pog_id}/events), or `stream=true` (without `background`) to have this response stream those events. Otherwise it answers once the POG has ended. A key's POGs count against its requests at once and usage limits (429). An `Idempotency-Key` sent again with the same body returns the POG it made (200, or 202 while a background one runs).", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PogCreate"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 200}, "description": "Up to 200 printable characters, this API key's own: sent again with the same body, nothing is done twice and the answer is what it did; with another body, 422."}]}}, "/pog/{pog_id}": {"parameters": [{"name": "pog_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A Predictive Operation Graph (POG) id."}], "get": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "getPog", "summary": "Read a POG and its current node states", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pog"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "modifyPog", "summary": "Modify an active POG (add, cancel, or reprioritize nodes)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pog"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Body too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "Idempotency-Key reused for another body", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Answers the POG with `modification` (what changed). A POG that has ended can't be modified (400). One running in another API process is changed by that process: 409 `pog_orphaned` when no process runs it (its process stopped, or it records an agent's turn; cancel it to end it), 503 `pog_owner_unavailable` with `Retry-After` when it doesn't answer within 10 seconds (the change may have been made: read the POG before sending it again), and 413 `pog_change_too_large` for a change too large to hand over (about 8 KB as JSON; send smaller ones).", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PogModify"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 200}, "description": "Up to 200 printable characters, this API key's own: sent again with the same body, nothing is done twice and the answer is what it did; with another body, 422."}]}}, "/pog/{pog_id}/graph": {"parameters": [{"name": "pog_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A Predictive Operation Graph (POG) id."}], "get": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "getPogGraph", "summary": "Read a POG's status, compiled DAG (nodes and edges) and metrics", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PogGraph"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/pog/{pog_id}/evidence": {"parameters": [{"name": "pog_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A Predictive Operation Graph (POG) id."}], "get": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "getPogEvidence", "summary": "Read a POG's consolidated EvidencePackage (409 while running)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvidencePackage"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/pog/{pog_id}/cancel": {"parameters": [{"name": "pog_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A Predictive Operation Graph (POG) id."}], "post": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "cancelPog", "summary": "Cancel an active POG and cascade cancellation to pending nodes", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Pog"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "Idempotency-Key reused for another body", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "A POG that has already ended is answered as it ended. One running in another API process is cancelled by that process and answered once it has stopped; one whose process is gone is ended at once. 503 `pog_owner_unavailable` with `Retry-After` when the process running it doesn't answer within 10 seconds.", "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 200}, "description": "Up to 200 printable characters, this API key's own: sent again with the same body, nothing is done twice and the answer is what it did; with another body, 422."}]}}, "/pog/{pog_id}/events": {"parameters": [{"name": "pog_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "A Predictive Operation Graph (POG) id."}], "get": {"tags": ["POG (Predictive Operation Graphs)"], "operationId": "listPogEvents", "summary": "Read or stream reconnectable POG lifecycle events", "responses": {"200": {"description": "The events after `after` (JSON), or Server-Sent Events", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PogEventList"}}, "text/event-stream": {"schema": {"type": "string"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "An `after`, `Last-Event-ID` or `limit` out of range answers 400. Asked with `Accept: text/event-stream` (or `stream=true`): Server-Sent Events. From the start (no `after`), first `pog.snapshot` (the POG as it is now); then each event as it is recorded (`id` its `seq`, `event` its type: `pog.compiled`, `pog.node.started`, `pog.node.completed`, `pog.future.resolved`, `pog.graph.modified`, `pog.completed`, `pog.cancelled`...); `end` ({pog_id, status, last_seq}) once it has ended, or `reconnect` ({pog_id, after}) after 30 minutes. A `: keep-alive` comment every 15 quiet seconds.", "parameters": [{"name": "after", "in": "query", "schema": {"type": "integer", "minimum": 0, "maximum": 2147483647, "default": 0}, "description": "The last `seq` seen."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 500, "default": 500}, "description": "JSON only: the most events in one page."}, {"name": "stream", "in": "query", "schema": {"type": "boolean"}, "description": "Server-Sent Events (`true` or `1`), as `Accept: text/event-stream` asks."}, {"name": "Last-Event-ID", "in": "header", "schema": {"type": "integer", "minimum": 0, "maximum": 2147483647}, "description": "Resume an SSE stream after this sequence number (takes precedence over `after`)."}]}}, "/connections/discord/{discord_id}": {"get": {"tags": ["Connections"], "operationId": "connectionStatus", "summary": "Whether a person let this app save to their Workspace", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ConnectionStatus"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Until the person approves this app the answer is the same whether or not they have a Dyadic account: `linked` and `authorized` false, and `authorize_url` to send them (they sign in, or link Discord, there). Counts against the key's limits like any request.", "parameters": [{"name": "discord_id", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^\\d{15,21}$"}, "description": "The person's Discord id."}]}}, "/workspace/saves": {"post": {"tags": ["Connections"], "operationId": "createWorkspaceSave", "summary": "Save a message, conversation, image or file to a person's Workspace", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceSave"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Body too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "Unsupported media type", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`user.discord_id` names the person; without their approval the answer is 403 `authorization_required` with `authorize_url` beside the error. A conversation becomes a chat they can carry on (or, with `as_chat: false`, a saved reference); a message, image or file is saved to their Saved items. Each save keeps this app's name and id with its `source`. A save is not idempotent: the SDKs never retry one that may have happened.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceSaveRequest"}}}}}}, "/openapi.json": {"get": {"tags": ["Meta"], "operationId": "platformOpenAPI", "summary": "This document", "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}}}}, "/blackbox/events": {"post": {"tags": ["Black Box: recording"], "operationId": "recordEvents", "summary": "Record a batch of events", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/BatchResult"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Body too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "Idempotency-Key reused for another body", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Up to 1,000 events of 64 KB in a body of up to 4 MB. Bad events are refused one by one; event ids make retries safe. A replay of an `Idempotency-Key` says `Idempotent-Replayed: true`. Events add only to a run this key reported (404 for any other `run.id`); 409 while the account's recording is off (`recording_off`) or for an archived run (`run_archived`).\n\nNeeds the key's `blackbox_write` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EventBatch"}}}}, "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 200}, "description": "Up to 200 printable characters, this API key's own: sent again with the same body, nothing is done twice and the answer is what it did; with another body, 422."}]}}, "/blackbox/otlp/v1/traces": {"post": {"tags": ["Black Box: recording"], "operationId": "recordOtlp", "summary": "Record OpenTelemetry traces", "responses": {"200": {"description": "OTLP's ExportTraceServiceResponse: `partialSuccess` ({rejectedSpans, errorMessage}) when some spans were refused", "content": {"application/json": {"schema": {"type": "object"}}, "application/x-protobuf": {"schema": {"type": "string", "format": "binary"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Body too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "415": {"description": "Unsupported media type", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "422": {"description": "Idempotency-Key reused for another body", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "OTLP/HTTP, JSON (`application/json`) or protobuf (`application/x-protobuf`), optionally gzipped, up to 4 MB. GenAI semantic conventions and OpenInference spans map onto events; one run per trace. Answered in the request's own format.\n\nNeeds the key's `blackbox_write` switch.", "parameters": [{"name": "Idempotency-Key", "in": "header", "schema": {"type": "string", "maxLength": 200}, "description": "Up to 200 printable characters, this API key's own: sent again with the same body, nothing is done twice and the answer is what it did; with another body, 422."}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}, "application/x-protobuf": {"schema": {"type": "string", "format": "binary"}}}}}}, "/blackbox/overview": {"get": {"tags": ["Black Box: runs"], "operationId": "blackboxOverview", "summary": "This key's runs of a range, open findings, gaps", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`week`: the range's runs by status (`by_status`) and outcome (`by_outcome`) and `runs_with_gaps`, each count what [`GET /blackbox/runs`](https://dyadic.app/developers/api/#platform/tag/black-box-runs/GET/blackbox/runs) gives with the same filter and range; `days`, the range; `open_findings` by severity; `daily`, the last 14 days' runs by how they ended.\n\nNeeds the key's `blackbox_read` switch.", "parameters": [{"name": "days", "in": "query", "schema": {"type": "integer", "enum": [7, 30], "default": 7}, "description": "The range: the last 7 days (the default) or the last 30."}]}}, "/blackbox/runs": {"get": {"tags": ["Black Box: runs"], "operationId": "listRuns", "summary": "List this key's runs", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunList"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Newest first. A run of a W3C trace on the page brings that trace's other runs of this key after the page, marked `family: true`.\n\nNeeds the key's `blackbox_read` switch.", "parameters": [{"name": "q", "in": "query", "schema": {"type": "string"}, "description": "Text in a run's title, agent, id, trace id or operation id."}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["running", "completed", "failed", "cancelled", "interrupted", "abandoned", "requires_action"]}}, {"name": "outcome", "in": "query", "schema": {"type": "string", "enum": ["unknown", "not_applicable", "unverified", "contradicted", "verified", "blocked", "no_effects", "failed"]}}, {"name": "agent", "in": "query", "schema": {"type": "string"}, "description": "An agent's id or name, whole, in any case."}, {"name": "model", "in": "query", "schema": {"type": "string"}, "description": "A model id, whole, in any case."}, {"name": "tool", "in": "query", "schema": {"type": "string"}, "description": "A tool name, whole, in any case."}, {"name": "environment", "in": "query", "schema": {"type": "string", "enum": ["production", "staging", "development", "test", "simulation"]}}, {"name": "source", "in": "query", "schema": {"type": "string"}}, {"name": "since", "in": "query", "schema": {"type": "string", "format": "date-time"}, "description": "Started at or after."}, {"name": "until", "in": "query", "schema": {"type": "string", "format": "date-time"}, "description": "Started before."}, {"name": "severity", "in": "query", "schema": {"type": "string", "enum": ["info", "low", "medium", "high", "critical"]}, "description": "Runs with a finding of this severity or higher."}, {"name": "cursor", "in": "query", "schema": {"type": "string"}, "description": "The page after this one: the last page's `next`."}, {"name": "key", "in": "query", "schema": {"type": "string"}, "description": "The app that made them: a key's id, or `workspace`."}, {"name": "gaps", "in": "query", "schema": {"type": "string", "enum": ["1", "true"]}, "description": "Only runs whose record has a gap (events dropped or missing)."}, {"name": "simulations", "in": "query", "schema": {"type": "string", "enum": ["1", "true"]}, "description": "Include simulated runs, which are left out unless `environment` asks for them."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 50}}]}}, "/blackbox/runs/options": {"get": {"tags": ["Black Box: runs"], "operationId": "listRunOptions", "summary": "What this key's runs can be filtered by", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Agents, models and tools in the runs, most used first, and the apps (keys) that made them with each key's color, group and library.\n\nNeeds the key's `blackbox_read` switch."}}, "/blackbox/runs/stream": {"get": {"tags": ["Black Box: live"], "operationId": "watchRuns", "summary": "Follow this key's runs as they change", "responses": {"200": {"description": "Server-Sent Events", "content": {"text/event-stream": {"schema": {"type": "string"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Events: `ready`, `run` (a run's summary, id = its id, at most once a second each), `reconnect` after 30 minutes; a `: keep-alive` comment every 15 quiet seconds.\n\nNeeds the key's `blackbox_read` switch."}}, "/blackbox/runs/{id}": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: runs"], "operationId": "getRun", "summary": "A run", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RunDetail"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch."}, "delete": {"tags": ["Black Box: privacy"], "operationId": "deleteRun", "summary": "Delete a run", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"deleted": {"type": "string"}, "checkpoint": {"type": "integer"}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Removes the run; a signed deletion record stays in the account's log. 409 `run_running` while it is still recorded.\n\nNeeds the key's `blackbox_manage` switch.", "parameters": [{"name": "reason", "in": "query", "schema": {"type": "string"}, "description": "Kept in the deletion record (up to 200 characters)."}]}}, "/blackbox/runs/{id}/events": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: runs"], "operationId": "listRunEvents", "summary": "A run's events", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"run_id": {"type": "string"}, "events": {"type": "array", "items": {"type": "object"}}, "has_more": {"type": "boolean"}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "In chain order, each event's envelope with its `hash`.\n\nNeeds the key's `blackbox_read` switch.", "parameters": [{"name": "after", "in": "query", "schema": {"type": "integer", "minimum": 0, "default": 0}, "description": "The last `seq` seen."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 5000, "default": 1000}}, {"name": "types", "in": "query", "schema": {"type": "string"}, "description": "Comma-separated event types (up to 20)."}]}}, "/blackbox/runs/{id}/stream": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: live"], "operationId": "streamRun", "summary": "Follow a run as it is recorded", "responses": {"200": {"description": "Server-Sent Events", "content": {"text/event-stream": {"schema": {"type": "string"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Events: `event` (id = seq, data = the envelope), then `end` ({run_id, status, outcome, events}), `deleted` ({run_id}), or `reconnect` ({after}) after 30 minutes (resume with `Last-Event-ID`); a `: keep-alive` comment every 15 quiet seconds.\n\nNeeds the key's `blackbox_read` switch.", "parameters": [{"name": "after", "in": "query", "schema": {"type": "integer", "minimum": 0, "default": 0}, "description": "The last `seq` seen."}, {"name": "Last-Event-ID", "in": "header", "schema": {"type": "integer", "minimum": 0}, "description": "Resume after this `seq` (takes precedence over `after`)."}]}}, "/blackbox/runs/{id}/graph": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: investigation"], "operationId": "getRunGraph", "summary": "Reconstruction: spans, causal edges, timeline, outcome, gaps", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`run`, `spans`, `root`, `edges`, `timeline`, `decisions`, `outcome`, `gaps`, `clock`, `limitations`, `tainted_at`, `duration_ms`.\n\nNeeds the key's `blackbox_read` switch."}}, "/blackbox/runs/{id}/lineage": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: investigation"], "operationId": "getRunLineage", "summary": "The file versions a run made, each with the plan steps under way", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`revisions`, each version: `path`, `sha256` (null: removed), `previous`, `size`, `span` (the tool call), `during` (the plan steps under way when that call was made: observed, never a claim that the step caused it) and `basis` (`observed`, or `unknown` for a version made outside a recorded tool call), and `content_kept` / `previous_kept` (false once that version's contents are past their keeping: its record stays); `artifact_revisions`, the compositional artifacts it changed; `steps` lists the plan steps the run moved; `unfinished`, once the run has ended, the calls it wrote ahead and never reported back (each may or may not have happened; `versioned` when the call made a file version). A run an application reported has none: `missing` says why.\n\nNeeds the key's `blackbox_content` switch."}}, "/blackbox/runs/{id}/content": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "post": {"tags": ["Black Box: runs"], "operationId": "getRunContent", "summary": "The content kept for a run", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"run_id": {"type": "string"}, "erased": {"type": "boolean"}, "content": {"type": "array", "items": {"type": "object", "properties": {"ref": {"type": "string"}, "kind": {"type": "string"}, "salt": {"type": "string"}, "value": {}}}}}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Empty once erased (`erased: true`).\n\nNeeds the key's `blackbox_content` switch.", "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"refs": {"type": "array", "items": {"type": "string"}, "maxItems": 500, "description": "Content references from its events; all of it when left out."}}}}}}}}, "/blackbox/runs/{id}/verify": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: evidence"], "operationId": "verifyRun", "summary": "Verify a run's chain and signatures", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VerifyReport"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch."}}, "/blackbox/runs/{id}/checkpoints": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: evidence"], "operationId": "getRunCheckpoints", "summary": "A run's signed checkpoints and its anchor", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`run_id`, `tenant`, `checkpoints` and `anchors`.\n\nNeeds the key's `blackbox_read` switch."}}, "/blackbox/runs/{id}/export": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: evidence"], "operationId": "exportRun", "summary": "An evidence bundle", "responses": {"200": {"description": "The bundle (JSON), or a zip with verify.py", "content": {"application/json": {"schema": {"type": "object"}}, "application/zip": {"schema": {"type": "string", "format": "binary"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch.", "parameters": [{"name": "format", "in": "query", "schema": {"type": "string", "enum": ["json", "zip"], "default": "json"}}, {"name": "content", "in": "query", "schema": {"type": "boolean"}, "description": "`true` or `1`: with the content kept. Needs `blackbox_content` too."}]}, "post": {"tags": ["Black Box: evidence"], "operationId": "exportRunPost", "summary": "An evidence bundle (options in the body)", "responses": {"200": {"description": "The bundle (JSON), or a zip with verify.py", "content": {"application/json": {"schema": {"type": "object"}}, "application/zip": {"schema": {"type": "string", "format": "binary"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch.", "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"format": {"type": "string", "enum": ["json", "zip"], "default": "json"}, "content": {"type": "boolean", "description": "Needs `blackbox_content` too."}}}}}}}}, "/blackbox/runs/{id}/otlp": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: evidence"], "operationId": "exportRunOtlp", "summary": "A run as OTLP/JSON (GenAI conventions, OpenInference)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch.", "parameters": [{"name": "content", "in": "query", "schema": {"type": "boolean"}, "description": "`true` or `1`: with the content kept. Needs `blackbox_content` too."}]}}, "/blackbox/runs/{id}/simulate": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "post": {"tags": ["Black Box: investigation"], "operationId": "simulateRun", "summary": "Reconstruct, simulate or fork a run (never evidence)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`simulate` and `counterfactual` need `blackbox_content` too. Nothing real runs. A simulation is a request like any other of the key's (its rate, limits and requests at once; 429), logged with what a counterfactual's model calls cost. A counterfactual continues only with the run's own model or one of the platform's chat models.\n\nNeeds the key's `blackbox_read` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SimulationRequest"}}}}}}, "/blackbox/runs/{id}/erase": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "post": {"tags": ["Black Box: privacy"], "operationId": "eraseRunContent", "summary": "Erase a run's content (its key is destroyed)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"erased": {"type": "integer"}, "checkpoint": {"type": ["integer", "null"]}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "409 `run_running` while it is still recorded, `run_archived` once it is archived.\n\nNeeds the key's `blackbox_manage` switch.", "parameters": [{"name": "reason", "in": "query", "schema": {"type": "string"}, "description": "Kept in the erasure record (up to 200 characters)."}]}}, "/blackbox/runs/{id}/bookmarks": {"parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}, "description": "A run id."}], "get": {"tags": ["Black Box: investigation"], "operationId": "listBookmarks", "summary": "A run's bookmarks", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"bookmarks": {"type": "array", "items": {"$ref": "#/components/schemas/Bookmark"}}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch."}, "post": {"tags": ["Black Box: investigation"], "operationId": "addBookmark", "summary": "Bookmark an event", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Bookmark"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Up to 500 bookmarks a run.\n\nNeeds the key's `blackbox_write` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["seq"], "properties": {"seq": {"type": "integer", "minimum": 1, "description": "One of the run's events."}, "note": {"type": "string", "maxLength": 2000}}}}}}}}, "/blackbox/bookmarks/{bid}": {"parameters": [{"name": "bid", "in": "path", "required": true, "schema": {"type": "integer"}}], "delete": {"tags": ["Black Box: investigation"], "operationId": "deleteBookmark", "summary": "Delete one of this key's bookmarks", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"deleted": {"const": true}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_write` switch."}}, "/blackbox/diff": {"get": {"tags": ["Black Box: investigation"], "operationId": "diffRuns", "summary": "Where two runs part", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`a`, `b`, `similarity`, `first_divergence`, the aligned `steps`, `totals`, and `usage` (what each cost).\n\nNeeds the key's `blackbox_read` switch.", "parameters": [{"name": "a", "in": "query", "schema": {"type": "string", "format": "uuid"}, "required": true}, {"name": "b", "in": "query", "schema": {"type": "string", "format": "uuid"}, "required": true}]}}, "/blackbox/findings": {"get": {"tags": ["Black Box: findings"], "operationId": "listFindings", "summary": "What the detection rules noticed", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "410": {"description": "Deleted; the signed deletion record is attached", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Most severe first, then newest. Each is a hypothesis (`hypothesis: true`).\n\nNeeds the key's `blackbox_read` switch.", "parameters": [{"name": "run_id", "in": "query", "schema": {"type": "string", "format": "uuid"}, "description": "Only this run's findings (of any status)."}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["open", "dismissed", "confirmed", "all"]}, "description": "`open` by default; `all` with `run_id`."}, {"name": "severity", "in": "query", "schema": {"type": "string", "enum": ["info", "low", "medium", "high", "critical"]}, "description": "This severity or higher."}, {"name": "rule", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 500, "default": 100}}]}}, "/blackbox/findings/{fid}": {"parameters": [{"name": "fid", "in": "path", "required": true, "schema": {"type": "integer"}}], "patch": {"tags": ["Black Box: findings"], "operationId": "triageFinding", "summary": "Confirm or dismiss a finding", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"id": {"type": "integer"}, "status": {"type": "string"}, "triaged_by": {"type": "string"}}}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Only a finding of one of this key's runs.\n\nNeeds the key's `blackbox_write` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["status"], "properties": {"status": {"type": "string", "enum": ["open", "confirmed", "dismissed"]}, "note": {"type": "string", "maxLength": 2000}}}}}}}}, "/blackbox/rules": {"get": {"tags": ["Black Box: findings"], "operationId": "listRules", "summary": "The detection rules and the account's settings", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_read` switch."}}, "/blackbox/rules/preview": {"post": {"tags": ["Black Box: findings"], "operationId": "previewRules", "summary": "What other rule settings would raise on recent runs", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Over this key's recent runs; nothing is saved.\n\nNeeds the key's `blackbox_read` switch.", "requestBody": {"required": false, "content": {"application/json": {"schema": {"type": "object", "properties": {"rules": {"type": "object"}, "runs": {"type": "integer", "minimum": 1, "maximum": 300, "default": 100}, "days": {"type": "integer", "minimum": 1, "maximum": 365, "default": 30}}}}}}}}, "/blackbox/settings": {"get": {"tags": ["Black Box: runs"], "operationId": "getRecordingSettings", "summary": "What the account keeps, and for how long", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`recording`, `capture`, `retention_content_days`, `retention_days` and `sample_rate`.\n\nNeeds the key's `blackbox_read` switch."}}, "/blackbox/sinks": {"get": {"tags": ["Black Box: sinks"], "operationId": "listSinks", "summary": "This key's sinks", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"sinks": {"type": "array", "items": {"$ref": "#/components/schemas/Sink"}}, "events": {"type": "array", "items": {"type": "string"}}, "protocols": {"type": "array", "items": {"type": "string"}}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_manage` switch."}, "post": {"tags": ["Black Box: sinks"], "operationId": "createSink", "summary": "Add a webhook or an OpenTelemetry export", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Sink"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "`kind` and `url` are required. A webhook's `secret` is returned once. Webhooks follow Standard Webhooks (webhook-id, webhook-timestamp, webhook-signature). An export with content needs `blackbox_content`. Up to 20 sinks an account.\n\nNeeds the key's `blackbox_manage` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SinkRequest"}}}}}}, "/blackbox/sinks/{sid}": {"parameters": [{"name": "sid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "get": {"tags": ["Black Box: sinks"], "operationId": "getSink", "summary": "A sink", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Sink"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_manage` switch."}, "patch": {"tags": ["Black Box: sinks"], "operationId": "updateSink", "summary": "Change a sink", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Sink"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Only the fields sent change. `kind` can't: a different one is a 400. Turning it back on resets its failures.\n\nNeeds the key's `blackbox_manage` switch.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SinkRequest"}}}}}, "delete": {"tags": ["Black Box: sinks"], "operationId": "deleteSink", "summary": "Remove a sink", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"deleted": {"const": true}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_manage` switch."}}, "/blackbox/sinks/{sid}/test": {"parameters": [{"name": "sid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "post": {"tags": ["Black Box: sinks"], "operationId": "testSink", "summary": "Send a ping", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"message_id": {"type": "string"}, "queued": {"const": true}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Needs the key's `blackbox_manage` switch."}}, "/blackbox/sinks/{sid}/rotate": {"parameters": [{"name": "sid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "post": {"tags": ["Black Box: sinks"], "operationId": "rotateSinkSecret", "summary": "A new webhook secret (shown once)", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Sink"}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Webhooks only: any other sink answers 404.\n\nNeeds the key's `blackbox_manage` switch."}}, "/blackbox/sinks/{sid}/deliveries": {"parameters": [{"name": "sid", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "get": {"tags": ["Black Box: sinks"], "operationId": "listDeliveries", "summary": "Recent deliveries", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"deliveries": {"type": "array", "items": {"type": "object"}}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "Newest first.\n\nNeeds the key's `blackbox_manage` switch.", "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 50}}]}}, "/blackbox/deliveries/{did}/retry": {"parameters": [{"name": "did", "in": "path", "required": true, "schema": {"type": "integer"}}], "post": {"tags": ["Black Box: sinks"], "operationId": "retryDelivery", "summary": "Send a delivery again", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"queued": {"const": true}}}}}}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not this key's)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "A delivery already waiting to be sent answers 404.\n\nNeeds the key's `blackbox_manage` switch."}}, "/blackbox/keys": {"get": {"tags": ["Black Box: evidence"], "operationId": "blackboxKeys", "summary": "The public signing keys", "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"keys": {"type": "array", "items": {"type": "object"}}, "alg": {"const": "Ed25519"}, "note": {"type": "string"}}}}}}}}}, "/blackbox/verify": {"post": {"tags": ["Black Box: evidence"], "operationId": "verifyBundle", "summary": "Verify a bundle", "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VerifyReport"}}}}, "400": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "408": {"description": "Request timeout", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Body too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Temporarily unavailable (content keys, the archive, the database or the public verifier): retry shortly", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "description": "The same check as the bundle's own verify.py, against the published keys. The public service accepts a bounded convenience-size bundle; use the included verify.py for a larger bundle or a complete untruncated report."}}, "/blackbox/mcp": {"post": {"tags": ["Black Box: MCP"], "operationId": "blackboxMcp", "summary": "MCP (Streamable HTTP)", "description": "Protocol 2025-06-18 (2025-03-26 accepted, with its JSON-RPC batches). Tools, resources (blackbox://runs/{id}, subscribable; blackbox://findings; pog://{pog_id}) and prompts, offered by the key's switches. `initialize` returns an Mcp-Session-Id (signed, bound to the key, 24 hours); later requests send it back. Asked with `Accept: text/event-stream` and a `_meta.progressToken`, a call answers as SSE: progress notifications, then the result. Requests from other origins are refused (403).", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "JSON-RPC response (JSON, or SSE with progress)", "content": {"application/json": {"schema": {"type": "object"}}, "text/event-stream": {"schema": {"type": "string"}}}}, "202": {"description": "Notification accepted"}, "400": {"description": "Parse error, an empty batch or an unsupported MCP-Protocol-Version"}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Session not found; initialize again"}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "get": {"tags": ["Black Box: MCP"], "operationId": "blackboxMcpStream", "summary": "The session's server messages (SSE)", "description": "`notifications/resources/updated` for the session's subscribed runs as they are recorded; a `: keep-alive` comment every 15 quiet seconds; it ends after 30 minutes.", "responses": {"200": {"description": "Server-Sent Events", "content": {"text/event-stream": {"schema": {"type": "string"}}}}, "400": {"description": "No Mcp-Session-Id"}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Session not found"}, "405": {"description": "Not asked as text/event-stream"}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"tags": ["Black Box: MCP"], "operationId": "blackboxMcpEnd", "summary": "End the session", "responses": {"204": {"description": "Ended"}, "401": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "The key lacks the permission", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Session not found"}, "429": {"description": "Rate limit or quota", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}}, "components": {"securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer", "bearerFormat": "dya-..."}}, "schemas": {"Error": {"type": "object", "properties": {"error": {"type": "object", "properties": {"message": {"type": "string"}, "type": {"type": "string"}, "param": {"type": ["string", "null"]}, "code": {"type": ["string", "null"]}, "deletion": {"type": "object", "description": "On 410 `run_deleted`: the signed deletion record (tenant_seq, payload, hash, signature, key_id, deleted_at)."}}}}}, "RunRequest": {"type": "object", "required": ["agent", "messages"], "properties": {"agent": {"oneOf": [{"type": "string", "description": "One of the account's agents the key allows."}, {"type": "object", "required": ["id", "name"], "description": "The application's own agent.", "properties": {"id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$", "description": "A short lowercase id that isn't one of Dyadic's own agents."}, "name": {"type": "string", "minLength": 1, "maxLength": 60}, "instructions": {"type": "string", "maxLength": 20000}, "behaviour": {"type": "object"}, "tools": {"type": "object"}, "models": {"type": "object", "additionalProperties": {"type": "string", "maxLength": 120}, "description": "Model categories to model ids."}}}]}, "messages": {"type": "array", "minItems": 1, "maxItems": 1000, "description": "OpenAI chat messages.", "items": {"type": "object", "required": ["role"], "properties": {"role": {"type": "string", "enum": ["system", "developer", "user", "assistant", "tool"]}, "content": {"oneOf": [{"type": "string"}, {"type": "array", "items": {"type": "object"}, "description": "Parts: text, image_url, file or input_audio."}]}, "name": {"type": "string"}, "tool_calls": {"type": "array", "items": {"type": "object"}}, "tool_call_id": {"type": "string", "description": "Required on a tool message."}}}}, "builtin_tools": {"type": "array", "items": {"type": "string"}, "description": "data.web_search, data.web_fetch, image.generate (with the `images` switch), vision.describe_image, audio.speak, audio.transcribe (with the `audio` switch), pog.execute and pog.inspect; these need the key's built-in plugins (`agent_tools`). plans.propose, plans.step, plans.get (with the `plans` switch; a run with `plan_mode` or `plan_id` has them anyway). plans.propose without `plan_mode` makes a plan running from the start. artifacts.read, artifacts.work, decisions.evaluate provide scoped persistent compositional work (requires conversation_id); answers.handbook and answers.assemble expose the existing construction grammar. Artifact edits retain revision preconditions and domain validation; evaluations are advisory, not permissions."}, "functions": {"type": "array", "maxItems": 2048, "description": "The application's own functions (the key's client tools switch): calling one ends the run `requires_action`. Their names may not reuse a built-in tool's.", "items": {"type": "object", "required": ["type", "function"], "properties": {"type": {"const": "function"}, "function": {"type": "object", "required": ["name"], "properties": {"name": {"type": "string", "pattern": "^[a-zA-Z0-9_-]{1,64}$"}, "description": {"type": "string"}, "parameters": {"type": "object"}, "strict": {"type": "boolean"}}}}}}, "end_user": {"type": "string", "pattern": "^[\\w.:@/+=-]{1,200}$", "description": "The application's own id for its user."}, "conversation_id": {"type": "string", "pattern": "^[\\w.:@/+=-]{1,200}$", "description": "The application's own conversation id; also the scope of its plans (`conversation`)."}, "stream": {"type": "boolean", "default": false}, "approval_mode": {"type": "string", "enum": ["ask", "edits", "auto", "bypass", "autonomous", "custom"], "default": "ask", "description": "Explicit built-in tool policy. Bypass retains the account's Safety gate and reports its effective mode. Custom freezes an owned saved profile; unavailable policies fail closed. Noninteractive Ask never executes without real authorization. Caller functions execute in the application's process, outside Dyadic's tool policy."}, "permission_profile_id": {"type": "string", "format": "uuid", "description": "Owned saved profile for Custom. Omit to use the account's selected profile. Does not expand the key's tools, billing rights or private Workspace access."}, "max_tokens": {"type": "integer", "minimum": 1, "maximum": 32000, "default": 4096, "description": "The most any call of the run may write; the key's own cap lowers it."}, "temperature": {"type": "number", "minimum": 0, "maximum": 2, "default": 0.7}, "think": {"type": "boolean", "default": false, "description": "Answer with the reasoning model (the key's Thinking switch)."}, "effort": {"type": "string", "enum": ["low", "medium", "high", "max"], "description": "How hard the model reasons on each step: low (no reasoning, the default), medium, high or max."}, "research": {"type": "string", "enum": ["auto", "deep"], "description": "auto (the default) or deep research."}, "max_cost_usd": {"type": "number", "exclusiveMinimum": 0, "maximum": 10, "description": "A cap on this run's spend, above $0 and up to $10."}, "followups": {"type": "boolean", "default": false, "description": "Suggest up to four follow-up questions with the answer."}, "plan_mode": {"type": "boolean", "default": false, "description": "Plan Mode: investigate read-only and propose a plan (plans.propose) for approval; nothing that changes anything runs. Needs the `plans` switch; not with `plan_id`."}, "plan_id": {"type": "string", "format": "uuid", "description": "Carry out this plan of the key's, picking up where it left off: a Plan Mode plan only once approved at its current revision (else the run fails with `plan_not_runnable`). Needs the `plans` switch."}, "pog": {"oneOf": [{"type": "boolean"}, {"type": "object"}], "description": "Predictive Operation Graph configuration (`{enabled, mode, speculative, confidence_threshold, max_concurrency, max_speculative_nodes, max_nodes, max_speculative_cost_usd, max_speculative_seconds, allow_partial}`). Mode values: `deterministic`, `model_assisted`, `hybrid` (default), or `explicit`."}}}, "RunCompleted": {"type": "object", "description": "The run's result: `completed`, or `requires_action` when it paused for the application's own functions. A run that fails answers with an error (an `error` event when streamed: `{type: 'error', error: {message, code, type}, operation_id, usage, cost_usd, estimated}`; otherwise the usual error object): 400 `content_flagged` or an execution limit (`model_call_limit`, `token_budget`, `time_budget`); 409 `plan_not_runnable`; 429 `insufficient_quota` (a run out of budget: the key's activity log records it as 402); 502 for anything else (`upstream_error`, `server_error`, `permission_policy_unavailable`).", "properties": {"type": {"const": "run.completed"}, "object": {"const": "run"}, "run_id": {"type": "string", "description": "The request's id (`X-Request-Id`), not the Black Box run's: that is `blackbox.run_id`."}, "status": {"type": "string", "enum": ["completed", "requires_action"]}, "agent": {"type": "string"}, "output_text": {"type": "string"}, "function_calls": {"type": "array", "items": {"type": "object"}}, "permissions": {"type": "object", "properties": {"requested_mode": {"type": "string"}, "effective_mode": {"type": "string"}, "profile_id": {"type": "string", "format": "uuid"}, "snapshot_id": {"type": "string", "format": "uuid"}}, "description": "Actual admitted mode and optional frozen Custom selection; explanatory metadata, never an execution grant."}, "messages": {"type": "array", "items": {"type": "object"}}, "tools": {"type": "array", "items": {"type": "string"}}, "images": {"type": "array", "items": {"type": "object"}}, "audio": {"type": "array", "items": {"type": "object"}}, "sources": {"type": "array", "items": {"type": "object", "properties": {"title": {"type": "string"}, "url": {"type": "string"}}}}, "usage": {"type": "object", "properties": {"prompt_tokens": {"type": "integer"}, "completion_tokens": {"type": "integer"}, "total_tokens": {"type": "integer"}}}, "credits": {"type": "number"}, "cost_usd": {"type": "number"}, "estimated": {"type": "boolean", "description": "True while a provider's final usage hasn't settled the cost."}, "model_calls": {"type": "integer"}, "seconds": {"type": "number"}, "followups": {"type": "array", "items": {"type": "string"}, "description": "Suggested next questions, when asked for."}, "finish_reason": {"type": "string", "enum": ["content_filter"], "description": "Present only when the answer was replaced by a refusal."}, "stopped": {"const": "incomplete", "description": "Present only when the run stopped short of a whole answer."}, "trouble": {"type": "string", "description": "With `stopped`: why (`tools`, `model_calls`, `provider`, `output`, `execution`, `evidence`, `authorization`...)."}, "continuation_required": {"const": true, "description": "With `stopped`: the work needs another run to finish."}, "log_id": {"type": "string", "description": "The request's row in the key's activity log; on a response that isn't streamed (a stream's run.completed goes out before the row is written)."}, "model": {"type": "string"}, "models": {"type": "array", "items": {"type": "string"}}, "operation_id": {"type": "string"}, "blackbox": {"type": "object", "description": "Where this run is recorded: read it with [`GET /blackbox/runs/{run_id}`](https://dyadic.app/developers/api/#platform/tag/black-box-runs/GET/blackbox/runs/{id}).", "properties": {"run_id": {"type": "string"}, "trace_id": {"type": "string"}}}, "plans": {"type": "array", "description": "The plans this run made or moved, as it left them (only when it touched any).", "items": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "title": {"type": "string"}, "status": {"type": "string", "enum": ["draft", "approved", "running", "paused", "completed", "failed", "cancelled"]}, "revision": {"type": "integer"}}}}, "pog": {"type": "object", "description": "Predictive Operation Graph summary when POG ran on this turn.", "properties": {"pog_id": {"type": "string"}, "status": {"type": "string"}, "metrics": {"type": "object"}, "sources": {"type": "array", "items": {"type": "object"}}, "conflicts": {"type": "array", "items": {"type": "object"}}}}}}, "ConnectionStatus": {"type": "object", "properties": {"linked": {"type": "boolean"}, "authorized": {"type": "boolean"}, "scopes": {"type": "array", "items": {"type": "string"}}, "authorize_url": {"type": "string"}, "link_url": {"type": "string"}}}, "WorkspaceSaveRequest": {"type": "object", "required": ["user", "kind"], "properties": {"user": {"type": "object", "required": ["discord_id"], "properties": {"discord_id": {"type": "string", "pattern": "^\\d{15,21}$"}}}, "kind": {"type": "string", "enum": ["message", "conversation", "image", "file"]}, "title": {"type": "string", "maxLength": 300}, "text": {"type": "string", "description": "A message's text (a message needs text or files)."}, "messages": {"type": "array", "minItems": 1, "maxItems": 200, "description": "A conversation's messages.", "items": {"type": "object", "required": ["text"], "properties": {"role": {"type": "string", "enum": ["user", "assistant"], "default": "user"}, "name": {"type": "string", "maxLength": 80}, "text": {"type": "string", "maxLength": 8000}, "url": {"type": "string", "pattern": "^https://"}}}}, "as_chat": {"type": "boolean", "default": true, "description": "A conversation as a chat they can carry on."}, "files": {"type": "array", "maxItems": 10, "description": "An image or file is sent here.", "items": {"type": "object", "required": ["data"], "properties": {"name": {"type": "string", "maxLength": 255}, "media_type": {"type": "string", "default": "application/octet-stream"}, "data": {"type": "string", "contentEncoding": "base64", "description": "Up to 8 MB; an image is a PNG, JPEG, WebP or GIF."}}}}, "url": {"type": "string", "pattern": "^https://"}, "source": {"type": "object", "description": "The app's own note on where it came from, up to 4 KB of JSON."}}}, "WorkspaceSave": {"type": "object", "properties": {"saved": {"type": "array", "items": {"type": "object", "properties": {"type": {"type": "string", "enum": ["chat", "reference", "file"]}, "id": {"type": "string"}}}}, "url": {"type": "string", "description": "Where the person finds it."}}}, "RunPlanUpdated": {"type": "object", "description": "A streamed run's event when it made or moved a plan.", "properties": {"type": {"const": "plan.updated"}, "plan": {"$ref": "#/components/schemas/Plan"}}}, "PlanStepInput": {"oneOf": [{"type": "string", "description": "A step's title; keys are numbered in order."}, {"type": "object", "required": ["title"], "properties": {"key": {"type": "string", "pattern": "^\\d{1,3}(\\.\\d{1,3}){0,2}$", "description": "1, 2, or 2.1 for a step inside 2; numbered in order when left out."}, "title": {"type": "string", "maxLength": 200}, "detail": {"type": "string", "maxLength": 2000, "description": "How it will be done and checked."}, "depends_on": {"oneOf": [{"type": "array", "items": {"type": "string"}, "maxItems": 20}, {"type": "string", "description": "Comma-separated keys."}], "description": "Keys of steps that must be completed or skipped first."}}}]}, "PlanCreate": {"type": "object", "required": ["title", "steps"], "properties": {"title": {"type": "string", "maxLength": 200}, "summary": {"type": "string", "maxLength": 4000}, "steps": {"type": "array", "minItems": 1, "maxItems": 60, "items": {"$ref": "#/components/schemas/PlanStepInput"}}, "mode": {"type": "string", "enum": ["plan", "live"], "default": "plan", "description": "plan: a draft that waits for approval; live: running from the start."}, "conversation": {"type": "string", "maxLength": 200, "description": "The application's conversation it belongs to."}, "metadata": {"type": "object", "maxProperties": 16, "propertyNames": {"maxLength": 64}, "additionalProperties": {"type": "string", "maxLength": 512}}}}, "PlanRevision": {"type": "object", "required": ["revision"], "properties": {"revision": {"type": "integer", "description": "The revision you revised (409 if the plan moved on since)."}, "title": {"type": "string", "maxLength": 200}, "summary": {"type": "string", "maxLength": 4000}, "steps": {"type": "array", "minItems": 1, "maxItems": 60, "items": {"$ref": "#/components/schemas/PlanStepInput"}, "description": "The whole list; steps keeping their key keep their progress."}, "metadata": {"type": "object", "maxProperties": 16, "propertyNames": {"maxLength": 64}, "additionalProperties": {"type": "string", "maxLength": 512}, "description": "Replaces the plan's metadata when given."}}}, "PlanApproval": {"type": "object", "required": ["revision"], "properties": {"revision": {"type": "integer", "description": "The revision you reviewed and approve."}}}, "PlanStepMove": {"type": "object", "required": ["status"], "properties": {"status": {"type": "string", "enum": ["pending", "in_progress", "completed", "failed", "blocked", "skipped"]}, "note": {"type": "string", "maxLength": 1000}, "verified_by": {"type": "string", "maxLength": 1000, "description": "The check that shows it's done."}}}, "PlanStep": {"type": "object", "properties": {"key": {"type": "string"}, "parent": {"type": "string", "description": "The key of the step it sits in; empty at the top."}, "title": {"type": "string"}, "detail": {"type": "string"}, "status": {"type": "string", "enum": ["pending", "in_progress", "completed", "failed", "blocked", "skipped"]}, "depends_on": {"type": "array", "items": {"type": "string"}}, "verified_by": {"type": "string", "description": "How completion was checked (a run must say it)."}, "note": {"type": "string"}, "evidence": {"type": "array", "items": {"type": "object"}, "description": "The latest tool calls that moved it, with the run's operation id."}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "finished_at": {"type": ["string", "null"], "format": "date-time"}, "updated_at": {"type": ["string", "null"], "format": "date-time"}}}, "PlanEvent": {"type": "object", "properties": {"id": {"type": "integer", "description": "In order: a stream resumes after the last one it saw."}, "object": {"const": "plan.event"}, "plan_id": {"type": "string", "format": "uuid"}, "kind": {"type": "string", "enum": ["created", "revised", "edited", "approved", "started", "resumed", "step", "interrupted", "completed", "cancelled", "patched"]}, "type": {"type": "string", "description": "plan.<kind>"}, "step": {"type": ["string", "null"]}, "status": {"type": ["string", "null"]}, "detail": {"type": "object"}, "actor": {"type": "string", "description": "iris (an agent in a run), owner (the Workspace) or application (an API key)."}, "operation_id": {"type": ["string", "null"], "description": "The run that made the change (its Black Box record)."}, "at": {"type": "string", "format": "date-time"}, "plan": {"$ref": "#/components/schemas/Plan", "description": "On the event stream only: the plan as it is after this change."}}}, "Plan": {"type": "object", "properties": {"id": {"type": "string", "format": "uuid"}, "object": {"const": "plan"}, "chat_id": {"type": ["string", "null"], "description": "A Workspace conversation's plan; null for an application's."}, "api_key_id": {"type": ["string", "null"]}, "conversation": {"type": "string"}, "metadata": {"type": "object", "additionalProperties": {"type": "string"}}, "title": {"type": "string"}, "summary": {"type": "string"}, "origin": {"type": "string", "enum": ["plan", "live"], "description": "plan: from Plan Mode, approved before it runs; live: made as the work runs."}, "status": {"type": "string", "enum": ["draft", "approved", "running", "paused", "completed", "failed", "cancelled"]}, "revision": {"type": "integer"}, "approved_revision": {"type": ["integer", "null"]}, "approved_at": {"type": ["string", "null"], "format": "date-time"}, "created_at": {"type": "string", "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}, "progress": {"type": "object", "description": "Over the steps with no sub-steps.", "properties": {"done": {"type": "integer"}, "total": {"type": "integer"}, "percent": {"type": "integer"}, "failed": {"type": "integer"}, "blocked": {"type": "integer"}}}, "steps": {"type": "array", "items": {"$ref": "#/components/schemas/PlanStep"}}, "events": {"type": "array", "items": {"$ref": "#/components/schemas/PlanEvent"}, "description": "Its recent history (up to 60), oldest first; not in lists."}}}, "PlanList": {"type": "object", "properties": {"object": {"const": "list"}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Plan"}}, "has_more": {"type": "boolean"}, "first_id": {"type": ["string", "null"]}, "last_id": {"type": ["string", "null"]}}}, "PlanEventList": {"type": "object", "properties": {"object": {"const": "list"}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/PlanEvent"}}, "has_more": {"type": "boolean"}, "last_id": {"type": ["integer", "null"]}}}, "EventBatch": {"type": "object", "required": ["run", "events"], "properties": {"run": {"type": "object", "description": "Names the run (`id`) or its trace (`trace_id`, or `parent`'s): one run per trace per key.", "properties": {"id": {"type": "string", "format": "uuid"}, "trace_id": {"type": "string", "pattern": "^[0-9a-fA-F]{32}$"}, "parent": {"type": "string", "description": "A W3C traceparent."}, "agent": {"oneOf": [{"type": "string"}, {"type": "object", "properties": {"id": {"type": "string", "maxLength": 200}, "name": {"type": "string", "maxLength": 200}}}]}, "title": {"type": "string", "maxLength": 300}, "environment": {"type": "string", "enum": ["production", "staging", "development", "test"], "default": "production"}, "root_span_id": {"type": "string", "pattern": "^[0-9a-fA-F]{16}$"}}}, "events": {"type": "array", "minItems": 1, "maxItems": 1000, "items": {"$ref": "#/components/schemas/Event"}}, "sent_at": {"type": "string", "format": "date-time", "description": "The producer's clock, to measure its skew."}}}, "Event": {"type": "object", "required": ["id", "type"], "properties": {"id": {"type": "string", "pattern": "^[A-Za-z0-9._:@/+=-]{1,128}$", "description": "The producer's own event id."}, "type": {"type": "string", "description": "run.*, agent.*, model.*, tool.*, approval.*, policy.decision, effect.observed, outcome.*, note, x.<app>.<what>"}, "status": {"type": "string", "enum": ["ok", "error", "blocked", "denied", "approved", "expired", "pending", "cancelled", "timeout", "skipped", "allow", "deny", "require_approval"]}, "name": {"type": "string", "maxLength": 200}, "time": {"type": "string", "format": "date-time", "description": "RFC 3339 with an offset; when it arrived when left out."}, "seq": {"type": "integer", "minimum": 0, "description": "The producer's own sequence number (exposes lost events)."}, "trace_id": {"type": "string", "description": "The run's trace, if given."}, "span_id": {"type": "string", "pattern": "^[0-9a-fA-F]{16}$"}, "parent_span_id": {"type": "string", "pattern": "^[0-9a-fA-F]{16}$"}, "agent": {"type": "string", "maxLength": 200}, "actor": {"type": "string", "maxLength": 200}, "attrs": {"type": "object"}, "content": {"type": "object", "propertyNames": {"enum": ["task.prompt", "model.input", "agent.task", "run.output", "model.output", "agent.answer", "tool.args", "tool.result"]}, "description": "Kept only where the account keeps that kind."}, "basis": {"type": "string", "enum": ["reported", "inferred"], "default": "reported"}}}, "BatchResult": {"type": "object", "properties": {"object": {"const": "blackbox.batch"}, "run_id": {"type": "string"}, "trace_id": {"type": "string"}, "accepted": {"type": "integer"}, "duplicates": {"type": "integer"}, "rejected": {"type": "array", "items": {"type": "object", "properties": {"index": {"type": "integer"}, "reason": {"type": "string"}}}}, "head": {"type": ["object", "null"], "properties": {"seq": {"type": "integer"}, "hash": {"type": "string"}}}, "status": {"type": ["string", "null"]}, "ended": {"type": "boolean"}}}, "Run": {"type": "object", "description": "A run as the key that made it reads it.", "properties": {"id": {"type": "string"}, "title": {"type": "string"}, "agent_id": {"type": "string"}, "agent_name": {"type": "string"}, "environment": {"type": "string", "enum": ["production", "staging", "development", "test", "simulation"]}, "source": {"type": "string", "enum": ["platform", "sdk", "otlp", "mcp", "simulation"]}, "status": {"type": "string", "enum": ["running", "completed", "failed", "cancelled", "interrupted", "abandoned", "requires_action"]}, "outcome": {"type": "string", "enum": ["unknown", "not_applicable", "unverified", "contradicted", "verified", "blocked", "no_effects", "failed"]}, "started_at": {"type": "string"}, "ended_at": {"type": ["string", "null"]}, "duration_ms": {"type": ["integer", "null"], "description": "Null while the run is open."}, "last_event_at": {"type": "string"}, "trace_id": {"type": "string"}, "root_span_id": {"type": "string"}, "parent_trace": {"type": ["string", "null"], "description": "The W3C traceparent the run joined, when its caller sent one."}, "operation_id": {"type": ["string", "null"]}, "api_key_id": {"type": ["string", "null"]}, "purpose": {"type": "string"}, "models": {"type": "array", "items": {"type": "string"}}, "tools": {"type": "array", "items": {"type": "string"}}, "agents": {"type": "array", "items": {"type": "string"}}, "events": {"type": "integer"}, "head_hash": {"type": "string"}, "signed_through": {"type": "integer"}, "dropped": {"type": "integer"}, "errors": {"type": "integer"}, "findings": {"type": "integer"}, "max_severity": {"type": ["string", "null"]}, "capture": {"type": "object"}, "flags": {"type": "object"}, "simulation_of": {"type": ["string", "null"]}, "simulation_mode": {"type": ["string", "null"], "enum": ["simulation", "counterfactual", null]}, "content_erased_at": {"type": ["string", "null"]}, "tenant_ref": {"type": "string"}, "archived_at": {"type": ["string", "null"]}, "actor": {"type": "object", "description": "Who started it: an account, an API key, the platform's own work, or not recorded (older runs).", "properties": {"kind": {"type": "string", "enum": ["account", "api_key", "system", "not_recorded"]}, "id": {"type": ["string", "null"]}}}, "request_id": {"type": ["string", "null"]}, "tokens": {"type": ["integer", "null"]}, "credits": {"type": ["number", "null"], "description": "What its request in the key's activity log was charged; null when unknown."}, "client": {"type": ["string", "null"]}, "key_name": {"type": ["string", "null"]}, "endpoint": {"type": ["string", "null"]}, "sdk": {"type": ["string", "null"]}, "chat_id": {"type": ["string", "null"]}, "message_id": {"type": ["integer", "null"]}, "chat": {"type": ["object", "null"]}}}, "RunDetail": {"allOf": [{"$ref": "#/components/schemas/Run"}, {"type": "object", "properties": {"costs": {"type": ["object", "null"], "description": "What it cost, from the usage ledger: for the owner and the key that made it."}, "links": {"type": "array", "items": {"type": "object"}, "description": "What it links to (a batch, a plan), each with how many runs share it: for a key, its own runs only."}, "bookmarks": {"type": "array", "items": {"$ref": "#/components/schemas/Bookmark"}}, "evaluation": {"type": ["object", "null"], "description": "The run's latest Run Evaluation, when it was evaluated."}, "reruns": {"type": "array", "items": {"type": "object"}}, "simulations": {"type": "array", "items": {"type": "object"}}}}]}, "RunList": {"type": "object", "properties": {"runs": {"type": "array", "items": {"allOf": [{"$ref": "#/components/schemas/Run"}, {"type": "object", "properties": {"family": {"const": true, "description": "Not on the page itself: another run of a W3C trace that a run on the page is in."}}}]}}, "next": {"type": ["string", "null"], "description": "The next page's `cursor`; null on the last page."}}}, "Bookmark": {"type": "object", "properties": {"id": {"type": "integer"}, "run_id": {"type": "string"}, "seq": {"type": "integer"}, "note": {"type": "string"}, "author": {"type": "string"}, "created_at": {"type": "string", "format": "date-time"}}}, "VerifyReport": {"type": "object", "properties": {"ok": {"type": "boolean"}, "events": {"type": "integer"}, "signed_through": {"type": "integer"}, "trusted_keys": {"type": "boolean"}, "checks": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "ok": {"type": "boolean"}, "detail": {"type": "string"}}}}, "errors": {"type": "array", "items": {"type": "string"}}, "warnings": {"type": "array", "items": {"type": "string"}}, "limitations": {"type": "array", "items": {"type": "string"}}, "run_id": {"type": "string", "description": "[`GET /blackbox/runs/{id}/verify`](https://dyadic.app/developers/api/#platform/tag/black-box-evidence/GET/blackbox/runs/{id}/verify): the run checked."}, "checked_at": {"type": "string", "format": "date-time", "description": "[`GET /blackbox/runs/{id}/verify`](https://dyadic.app/developers/api/#platform/tag/black-box-evidence/GET/blackbox/runs/{id}/verify): when."}, "keys": {"type": "string", "description": "[`POST /blackbox/verify`](https://dyadic.app/developers/api/#platform/tag/black-box-evidence/POST/blackbox/verify): whose keys it was checked against."}, "report_truncated": {"type": "boolean", "description": "[`POST /blackbox/verify`](https://dyadic.app/developers/api/#platform/tag/black-box-evidence/POST/blackbox/verify): lists were cut to fit (`omitted` counts what was left out)."}, "omitted": {"type": "object", "additionalProperties": {"type": "integer"}}}}, "SimulationRequest": {"type": "object", "required": ["mode"], "properties": {"mode": {"type": "string", "enum": ["reconstruct", "simulate", "counterfactual"]}, "policy": {"type": "object", "description": "An alternative policy for a counterfactual.", "properties": {"deny_tools": {"type": "array", "items": {"type": "string"}, "maxItems": 200}, "require_approval": {"type": "array", "items": {"type": "string"}, "maxItems": 200}, "deny_hosts": {"type": "array", "items": {"type": "string"}, "maxItems": 200}, "allow_hosts": {"type": "array", "items": {"type": "string"}, "maxItems": 200}, "approve": {"type": "boolean"}, "approval_mode": {"type": "string", "enum": ["ask", "auto"]}, "untrusted_requires_approval": {"type": "boolean"}, "max_tool_calls": {"type": "integer", "minimum": 0}}, "additionalProperties": false}, "tool_results": {"type": "object", "maxProperties": 50, "additionalProperties": {"type": "object"}, "description": "Results to use instead of the recorded ones: a call's span id or request seq, or a tool name, to {ok, data, error}."}, "model": {"type": "string", "minLength": 1, "maxLength": 120}, "continue_with_model": {"type": "boolean", "description": "Implied by `model` or `tool_results`."}, "max_steps": {"type": "integer", "minimum": 1, "maximum": 12, "default": 6}, "max_cost_usd": {"type": "number", "exclusiveMinimum": 0, "maximum": 5, "description": "A cap on a counterfactual's model spend, above $0 and up to $5; $0.50 when it's left out or out of range."}}}, "SinkRequest": {"type": "object", "additionalProperties": false, "properties": {"kind": {"type": "string", "enum": ["webhook", "otlp"]}, "url": {"type": "string", "format": "uri", "maxLength": 2000, "description": "HTTPS to a public host name on port 443; credentials go in `headers`, not here."}, "name": {"type": "string", "maxLength": 100}, "events": {"type": "array", "items": {"type": "string", "enum": ["finding.created", "run.completed", "run.failed", "run.cancelled", "run.interrupted", "run.abandoned", "run.requires_action"]}, "description": "A webhook's, at least one; `finding.created` and `run.completed` when left out."}, "min_severity": {"type": "string", "enum": ["info", "low", "medium", "high", "critical"], "default": "low"}, "environments": {"type": "array", "minItems": 1, "items": {"type": "string", "enum": ["production", "staging", "development", "test", "simulation"]}, "default": ["production"]}, "protocol": {"type": "string", "enum": ["http/json", "http/protobuf"], "default": "http/json"}, "content": {"type": "boolean", "default": false, "description": "OpenTelemetry exports only."}, "enabled": {"type": "boolean", "default": true}, "headers": {"type": "object", "additionalProperties": {"type": "string", "maxLength": 4096}, "maxProperties": 10, "description": "OpenTelemetry exports only; kept sealed, shown by name only."}}}, "Sink": {"type": "object", "properties": {"id": {"type": "string"}, "kind": {"type": "string", "enum": ["webhook", "otlp"]}, "name": {"type": "string"}, "url": {"type": "string"}, "events": {"type": "array", "items": {"type": "string"}}, "min_severity": {"type": "string"}, "environments": {"type": "array", "items": {"type": "string"}}, "protocol": {"type": "string"}, "content": {"type": "boolean"}, "enabled": {"type": "boolean"}, "header_names": {"type": "array", "items": {"type": "string"}}, "api_key_id": {"type": ["string", "null"]}, "created_by": {"type": "string"}, "failures": {"type": "integer"}, "last_success_at": {"type": ["string", "null"]}, "last_failure_at": {"type": ["string", "null"]}, "last_error": {"type": "string"}, "created_at": {"type": ["string", "null"]}, "updated_at": {"type": ["string", "null"]}, "secret": {"type": "string", "description": "Only when created or rotated."}}}, "POGConfig": {"type": "object", "properties": {"enabled": {"type": "boolean", "default": true}, "mode": {"type": "string", "enum": ["deterministic", "model_assisted", "hybrid", "explicit"], "default": "hybrid"}, "speculative": {"type": "boolean", "default": true, "description": "Enable safe read-only speculation when intent compilation produces speculative nodes."}, "confidence_threshold": {"type": "number", "minimum": 0.0, "maximum": 1.0, "default": 0.65}, "max_speculative_nodes": {"type": "integer", "minimum": 0, "maximum": 16, "default": 6}, "max_nodes": {"type": "integer", "minimum": 1, "maximum": 64, "default": 64}, "max_concurrency": {"type": "integer", "minimum": 1, "maximum": 16, "default": 8}, "max_speculative_cost_usd": {"type": "number", "minimum": 0.0, "maximum": 5.0, "default": 0.25}, "max_speculative_seconds": {"type": "number", "minimum": 0.1, "maximum": 120.0, "default": 20.0}, "allow_partial": {"type": "boolean", "default": true}}}, "POGBudget": {"type": "object", "properties": {"max_nodes": {"type": "integer", "minimum": 1, "maximum": 64, "default": 64}, "max_speculative_nodes": {"type": "integer", "minimum": 0, "maximum": 16, "default": 8}, "max_concurrency": {"type": "integer", "minimum": 1, "maximum": 16, "default": 8}, "max_cost_usd": {"type": ["number", "null"], "minimum": 0.0}, "max_speculative_cost_usd": {"type": "number", "minimum": 0.0, "maximum": 5.0, "default": 0.25}, "timeout_seconds": {"type": "number", "exclusiveMinimum": 0.0, "maximum": 900.0, "default": 120.0}, "node_timeout_seconds": {"type": "number", "exclusiveMinimum": 0.0, "maximum": 660.0, "default": 35.0}, "max_tool_calls": {"type": "integer", "minimum": 1, "maximum": 256, "default": 64}}}, "PogCreate": {"type": "object", "description": "`intent` or explicit nodes (`nodes`, `steps` or `graph.nodes`) is required.", "properties": {"intent": {"type": "string", "description": "Natural-language goal compiled into a Predictive Operation Graph; with explicit nodes, only its label."}, "nodes": {"type": "array", "maxItems": 64, "items": {"type": "object"}, "description": "Explicit DAG nodes (`{id, tool, args, depends_on?, condition?, when?, priority?, speculative?, allow_partial?, timeout_seconds?, retries?, max_retries?, backoff_ms?}`; retries 0 to 3, backoff_ms 10 to 10,000, timeout_seconds up to 660), run as given: `explicit` mode, speculation off. Arguments may use `$future`, `$ref`, or `${node.path}` expressions. A `condition` (`when`) is `{ref, path, op, value}` with op `truthy` (the default), `equals`, `not_equals`, `contains`, `in`, `gt`, `lt`, `exists` or `not_exists`."}, "steps": {"type": "array", "items": {"type": "object"}, "description": "Alias for `nodes`."}, "graph": {"type": "object", "description": "Explicit graph object containing `nodes`."}, "tools": {"type": "array", "items": {"type": "string"}, "description": "Optional allowlist within the key's Agent Tools scope (data.web_search, data.web_fetch, image.generate, vision.describe_image, audio.speak, audio.transcribe); any other answers 403 `tools_not_allowed`."}, "config": {"$ref": "#/components/schemas/POGConfig"}, "budget": {"$ref": "#/components/schemas/POGBudget", "description": "The graph's limits. Those `config` also names (`max_nodes`, `max_speculative_nodes`, `max_concurrency`, `max_speculative_cost_usd`) default to `config`'s; a value here replaces it."}, "dry_run": {"type": "boolean", "default": false, "description": "Compile and validate the graph without executing nodes (returns HTTP 200)."}, "background": {"type": "boolean", "default": false, "description": "Start the POG in the background and return HTTP 202 immediately (`status: running`)."}, "stream": {"type": "boolean", "default": false, "description": "This response streams the POG's events as Server-Sent Events (not with `background`)."}, "approval_mode": {"type": "string", "enum": ["ask", "edits", "auto", "bypass", "autonomous", "custom"], "default": "ask"}, "permission_profile_id": {"type": "string", "format": "uuid", "description": "With `custom`: an owned saved profile."}, "run_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Your own id to group POGs by (the `run_id` filter of [`GET /pog`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/GET/pog))."}}}, "PogModify": {"type": "object", "properties": {"add_nodes": {"type": "array", "items": {"type": "object"}, "description": "Nodes to append to the active graph (up to its budget's `max_nodes` in all)."}, "cancel_nodes": {"type": "array", "items": {"type": "string"}, "description": "Node ids to cancel before completion (cascades to dependents)."}, "reprioritize": {"type": "object", "additionalProperties": {"type": "integer"}, "description": "Map of node_id to updated integer priority."}}}, "EvidencePackage": {"type": "object", "properties": {"schema_version": {"type": "integer"}, "object": {"const": "pog.evidence"}, "pog_id": {"type": "string"}, "intent": {"type": "string"}, "compiler_mode": {"type": "string"}, "status": {"type": "string"}, "generated_at": {"type": "string", "format": "date-time"}, "operations": {"type": "array", "items": {"type": "object"}}, "sources": {"type": "array", "items": {"type": "object"}}, "dependencies": {"type": "array", "items": {"type": "object"}}, "conflicts": {"type": "array", "items": {"type": "object"}}, "failures_and_cancellations": {"type": "array", "items": {"type": "object"}}, "validation": {"type": "object"}, "metrics": {"type": "object"}}}, "Pog": {"type": "object", "properties": {"id": {"type": "string"}, "object": {"const": "pog"}, "status": {"type": "string", "enum": ["compiling", "running", "completed", "partial", "failed", "cancelled", "dry_run"], "description": "`dry_run` only on a dry run's answer."}, "intent": {"type": "string"}, "surface": {"type": "string"}, "compiler_mode": {"type": "string"}, "api_key_id": {"type": ["string", "null"]}, "operation_id": {"type": ["string", "null"]}, "run_id": {"type": ["string", "null"]}, "chat_id": {"type": ["string", "null"]}, "confidence_threshold": {"type": "number"}, "max_speculative_nodes": {"type": "integer"}, "budget": {"type": "object"}, "version": {"type": "integer"}, "modification": {"type": "object", "description": "[`PATCH /pog/{pog_id}`](https://dyadic.app/developers/api/#platform/tag/pog-predictive-operation-graphs/PATCH/pog/{pog_id}) only: what changed.", "properties": {"version": {"type": "integer"}, "added": {"type": "array", "items": {"type": "string"}}, "cancelled": {"type": "array", "items": {"type": "string"}}, "reprioritized": {"type": "array", "items": {"type": "string"}}}}, "graph": {"type": "object", "description": "The compiled DAG: `nodes` (by id), `edges`, `budget`, `version`."}, "metrics": {"type": "object"}, "evidence": {"anyOf": [{"$ref": "#/components/schemas/EvidencePackage"}, {"type": "null"}]}, "created_at": {"type": "number", "description": "Epoch seconds, as the POG is stored."}, "updated_at": {"type": "number", "description": "Epoch seconds."}, "completed_at": {"type": ["number", "null"], "description": "Epoch seconds; null until it ends."}}}, "PogList": {"type": "object", "properties": {"object": {"const": "list"}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/Pog"}}, "first_id": {"type": ["string", "null"]}, "last_id": {"type": ["string", "null"]}}}, "PogGraph": {"type": "object", "properties": {"pog_id": {"type": "string"}, "status": {"type": "string", "enum": ["compiling", "running", "completed", "partial", "failed", "cancelled"]}, "version": {"type": "integer"}, "graph": {"type": "object"}, "metrics": {"type": "object"}}}, "PogEventList": {"type": "object", "properties": {"object": {"const": "list"}, "pog_id": {"type": "string"}, "status": {"type": "string", "enum": ["compiling", "running", "completed", "partial", "failed", "cancelled"]}, "data": {"type": "array", "items": {"type": "object", "properties": {"seq": {"type": "integer"}, "pog_id": {"type": "string"}, "type": {"type": "string"}, "data": {"type": "object"}, "at": {"type": "number", "description": "Epoch seconds."}}}}, "last_seq": {"type": "integer", "description": "The last event's `seq` (`after` itself when there are none)."}}}}}}