{"openapi":"3.1.0","info":{"title":"ALDO AI Control Plane API","version":"0.0.0","description":"REST surface for the ALDO AI control plane. LLM-agnostic by design — agents declare capability classes, the model gateway picks a provider.\n\nPrivacy tiers (`public` / `internal` / `sensitive`) are enforced platform-side: a `sensitive` agent cannot reach a cloud model. The router fails closed before any provider contact (`422 privacy_tier_unroutable`).\n\nAuthentication: bearer token (HS256 JWT) for users, or `aldo_live_…` API key for service principals. Every non-public route requires one of the two; the WHO/WHAT lives in `components.securitySchemes`.","license":{"name":"Proprietary","url":"https://ai.aldo.tech/docs/license"},"contact":{"name":"ALDO TECH LABS","url":"https://ai.aldo.tech"}},"servers":[{"url":"https://ai.aldo.tech","description":"Production"},{"url":"http://localhost:8080","description":"Local dev"}],"tags":[{"name":"API Keys","description":"Programmatic API keys (`aldo_live_…`) with scope-based RBAC."},{"name":"Agents","description":"Agent specs (data, versioned, eval-gated). Per CLAUDE.md non-negotiable #4."},{"name":"Alerts","description":"Alert rules + event log + manual silencing/test."},{"name":"Annotations","description":"Threaded comments + reactions on runs, sweeps, and agents."},{"name":"Audit","description":"Tenant audit log (admin-only)."},{"name":"Auth","description":"Sign up, log in, switch tenant, fetch the current session."},{"name":"Billing","description":"Stripe subscriptions, checkout, customer portal, usage rollups."},{"name":"Cache","description":"LLM-response cache. Tenant-scoped; sensitive privacy tier SKIPS the cache by default."},{"name":"Dashboards","description":"Custom dashboards: KPI cards, time-series, heatmaps, pies, bars."},{"name":"Datasets","description":"Tenant-scoped collections of (input, expected, metadata, label, split) examples backing dataset-driven eval suites."},{"name":"Design Partners","description":"Public application form + admin review surfaces."},{"name":"Domains","description":"Per-tenant custom domains. Verification is via TXT record; SSL provisioned automatically by Fly / Vercel."},{"name":"Eval","description":"Suites, sweeps, evaluators, datasets, failure clustering — the promotion gate."},{"name":"Evaluators","description":"Tenant-scoped scoring functions: built-in (exact_match, contains, regex, json_schema) + llm_judge."},{"name":"Health","description":"Liveness probe."},{"name":"Integrations","description":"Outbound integrations: Slack, GitHub, Discord, generic webhooks."},{"name":"Invitations","description":"Tenant invitations + acceptance flow."},{"name":"Members","description":"Tenant member listing + role updates."},{"name":"Models","description":"Live model catalog (frontier + local discovery) + savings analytics. LLM-agnostic — provider strings are opaque."},{"name":"Notifications","description":"Per-user notification inbox + activity feed + SSE live-tail."},{"name":"Observability","description":"Aggregated metrics + traces for the observability surface."},{"name":"Playground","description":"Multi-model prompt fan-out — capability-class + privacy-tier driven."},{"name":"Quotas","description":"Per-tenant monthly run + cost allowance. Enforced server-side; clients read for UI."},{"name":"Runs","description":"Run lifecycle, search, comparison, and SSE event tail."},{"name":"Saved Views","description":"User-defined preset filters on the runs, sweeps, and dashboards surfaces."},{"name":"Secrets","description":"Tenant-scoped secrets for tool integrations. Values are write-only over the wire."},{"name":"Shares","description":"Public, password-gated read-only handles for runs / sweeps / agents."},{"name":"Tenants","description":"Tenant-scoped admin surfaces."}],"paths":{"/health":{"get":{"summary":"Liveness probe","description":"Returns `{ ok: true, version }`. Public — no auth.","tags":["Health"],"responses":{"200":{"description":"Process is alive.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"version":{"type":"string"}},"required":["ok","version"]},"example":{"ok":true,"version":"0.0.0"}}}}},"security":[]}},"/v1/auth/signup":{"post":{"summary":"Create a tenant + owner account","description":"Creates a new tenant and the first owner-role user. Returns a JWT session token. Public — no auth required.","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}}},"responses":{"200":{"description":"Session created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[]}},"/v1/auth/login":{"post":{"summary":"Log in with email + password","description":"Returns a JWT session token bound to the caller's default tenant. Public — no auth required.","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Session created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[]}},"/v1/auth/logout":{"post":{"summary":"Invalidate the current session","description":"Best-effort logout — server-side it merely confirms the call; the JWT continues to verify until expiry, so clients should also drop the token locally.","tags":["Auth"],"responses":{"200":{"description":"Logged out.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]}]}},"/v1/auth/me":{"get":{"summary":"Resolve the current session","description":"Returns the authenticated user, their current tenant, and all tenant memberships with role.","tags":["Auth"],"responses":{"200":{"description":"Current session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthMeResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]}]}},"/v1/auth/switch-tenant":{"post":{"summary":"Mint a session bound to a different tenant","description":"Re-issues the session JWT with the requested tenant pinned. The user must already be a member of the target tenant.","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchTenantRequest"}}}},"responses":{"200":{"description":"New session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchTenantResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Tenant not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"tenant not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]}]}},"/v1/agents":{"get":{"summary":"List all agents in the current tenant","description":"Lists every agent visible to the calling tenant with its current version and metadata.","tags":["Agents"],"responses":{"200":{"description":"Agents list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Register a new agent version","description":"Creates a new agent version from a YAML body. Re-registering the same name appends a new version row; the current version pointer is unchanged unless `setCurrent: true`.","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAgentJsonRequest"}}}},"responses":{"200":{"description":"Agent registered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterAgentResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/agents/{name}":{"get":{"summary":"Fetch a single agent by name","description":"Returns the agent's currently-promoted version with its full spec.","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name (slug).","schema":{"type":"string"},"example":"<agent-name>"}],"responses":{"200":{"description":"Agent detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAgentResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Agent not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"agent not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete an agent and all its versions","description":"Hard-deletes the agent record. Past runs that reference this agent retain their snapshot.","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name.","schema":{"type":"string"},"example":"<agent-name>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Agent not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"agent not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/agents/{name}/versions":{"get":{"summary":"List all versions of an agent","description":"Returns every recorded version of the agent in registration order.","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name.","schema":{"type":"string"},"example":"<agent-name>"}],"responses":{"200":{"description":"Version list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentVersionsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Agent not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"agent not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/agents/{name}/versions/{version}":{"get":{"summary":"Fetch a specific agent version","description":"Returns the spec exactly as registered for that version.","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name.","schema":{"type":"string"},"example":"<agent-name>"},{"name":"version","in":"path","required":true,"description":"Version string (e.g. `v3`).","schema":{"type":"string"},"example":"<version>"}],"responses":{"200":{"description":"Version detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAgentResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Agent version not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"agent version not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/agents/{name}/check":{"post":{"summary":"Run pre-flight privacy-tier + capability check","description":"Resolves the agent's privacy tier + capability requirements against the live model catalog WITHOUT executing the agent. Surfaces routing audit so an operator can debug `privacy_tier_unroutable` failures before kicking off a run.","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name.","schema":{"type":"string"},"example":"<agent-name>"}],"responses":{"200":{"description":"Routing trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckAgentResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Agent not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"agent not found"}}}}},"422":{"description":"Run cannot be routed under the agent's privacy tier (CLAUDE.md non-negotiable #3).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"privacy_tier_unroutable","message":"no eligible model for sensitive privacy tier","details":{"agentName":"<agent-name>","privacyTier":"sensitive","requiredCapability":"reasoning","attempted":["ollama:llama-3.3","mlx:phi-4"]}}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/agents/{name}/promote":{"post":{"summary":"Promote a YAML body as the new current version","description":"Validates + persists the YAML and atomically points the current version pointer to it (eval-gate enforced server-side).","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name.","schema":{"type":"string"},"example":"<agent-name>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteAgentRequest"}}}},"responses":{"200":{"description":"Promoted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteAgentResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/agents/{name}/set-current":{"post":{"summary":"Set the current version pointer to an existing version","description":"No new content; just pivots the `current_version` to a previously-registered version. Used to roll back an unhealthy promotion.","tags":["Agents"],"parameters":[{"name":"name","in":"path","required":true,"description":"Agent name.","schema":{"type":"string"},"example":"<agent-name>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRegisteredAgentRequest"}}}},"responses":{"200":{"description":"Pointer updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRegisteredAgentResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"404":{"description":"Agent version not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"agent version not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs":{"get":{"summary":"List runs (paginated)","description":"Lists runs in reverse-chronological order. Filter by `agentName` and `status` via query params.","tags":["Runs"],"parameters":[{"name":"agentName","in":"query","required":false,"description":"Filter by agent name.","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Filter by lifecycle status.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"Opaque pagination cursor from a previous response.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size (1–200).","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Runs page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListRunsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a new run","description":"Creates and queues a run for the specified agent. Returns 422 `privacy_tier_unroutable` BEFORE any provider contact if the agent's privacy tier cannot be satisfied by the live catalog.","tags":["Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunRequest"}}}},"responses":{"200":{"description":"Run created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Run cannot be routed under the agent's privacy tier (CLAUDE.md non-negotiable #3).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"privacy_tier_unroutable","message":"no eligible model for sensitive privacy tier","details":{"agentName":"<agent-name>","privacyTier":"sensitive","requiredCapability":"reasoning","attempted":["ollama:llama-3.3","mlx:phi-4"]}}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/search":{"get":{"summary":"Full-text + faceted run search","description":"Searches runs by free-text + status[] + agent[] + cost / duration / time ranges. Cursor-paginated; returns total match count.","tags":["Runs"],"parameters":[{"name":"q","in":"query","required":false,"description":"Free-text query (matches agent name, run id, error msg, tool args/results).","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"Repeatable. Restrict to these lifecycle states.","schema":{"type":"string"}},{"name":"agent","in":"query","required":false,"description":"Repeatable. Restrict to these agent names.","schema":{"type":"string"}},{"name":"cost_gte","in":"query","required":false,"description":"Minimum total USD.","schema":{"type":"number","minimum":0}},{"name":"cost_lte","in":"query","required":false,"description":"Maximum total USD.","schema":{"type":"number","minimum":0}},{"name":"limit","in":"query","required":false,"description":"Page size (1–100).","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Search results.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSearchResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/bulk":{"post":{"summary":"Bulk action on a list of runs","description":"Atomic batch action (archive / unarchive / add-tag / remove-tag) on up to 500 run ids.","tags":["Runs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRunActionRequest"}}}},"responses":{"200":{"description":"Action applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRunActionResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/compare":{"get":{"summary":"Side-by-side diff of two runs","description":"Returns a structural diff (events, tool calls, usage) between two runs. Used by the runs diff viewer.","tags":["Runs"],"parameters":[{"name":"a","in":"query","required":true,"description":"First run id.","schema":{"type":"string"}},{"name":"b","in":"query","required":true,"description":"Second run id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Diff payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCompareResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Run not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"run not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}":{"get":{"summary":"Fetch a single run","description":"Full run detail (events + usage + status). Used by the run detail page.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"responses":{"200":{"description":"Run detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRunResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Run not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"run not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/tree":{"get":{"summary":"Composite-run tree","description":"For composite (multi-agent) runs, returns the rooted tree of supervisor + subagent runs with per-node usage rollups.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id (parent or descendant).","schema":{"type":"string"},"example":"<run-id>"}],"responses":{"200":{"description":"Run tree.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetRunTreeResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Run not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"run not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/events":{"get":{"summary":"Server-sent event stream of run timeline events","description":"Long-lived SSE stream. The server writes one `event: <type>` + `data: <json>` block per RunEvent. Disconnects close the stream.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"responses":{"200":{"description":"Server-sent event stream.","content":{"text/event-stream":{"schema":{"type":"string","description":"newline-delimited SSE frames"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Run not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"run not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/breakpoints":{"get":{"summary":"List breakpoints attached to a run","description":"Returns the live breakpoint set for the in-flight or completed run. Used by the debugger panel.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"responses":{"200":{"description":"Breakpoint list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListBreakpointsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a breakpoint on a run","description":"Attaches a breakpoint that pauses the run when its trigger condition is met.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBreakpointRequest"}}}},"responses":{"200":{"description":"Breakpoint created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakpoint"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/breakpoints/{bp}":{"delete":{"summary":"Delete a breakpoint","description":"Removes a breakpoint by id; idempotent.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"},{"name":"bp","in":"path","required":true,"description":"Breakpoint id.","schema":{"type":"string"},"example":"<bp-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/continue":{"post":{"summary":"Resume a paused run","description":"Resumes execution past a breakpoint. Body carries an optional override for the next step.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContinueCommand"}}}},"responses":{"200":{"description":"Resumed.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/edit-and-resume":{"post":{"summary":"Edit step inputs and resume","description":"Mutates the next-step inputs of a paused run and resumes. The original event is retained for replay.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditAndResumeCommand"}}}},"responses":{"200":{"description":"Resumed.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/approvals":{"get":{"summary":"List pending approvals for a run","description":"Lists every approval the engine is currently blocked on for this run. Empty when nothing is pending. The engine pauses the iterative loop on every tool call whose spec marks `tools.approvals: always`; an approver POSTs `/approve` or `/reject` (below) to resolve.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"responses":{"200":{"description":"Pending approvals (possibly empty).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPendingApprovalsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/approve":{"post":{"summary":"Approve a pending tool call","description":"Resolves a pending approval as approved. The engine resumes the loop and dispatches the tool. The decision is auditable — both `tool.pending_approval` and `tool.approval_resolved` events land on the run-event log. Returns 404 when no pending approval matches `(runId, callId)`; 503 when the runtime / approval controller isn't wired for this tenant (typically because no providers are enabled).","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveRunRequest"}}}},"responses":{"200":{"description":"Approval resolved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"approval not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"approval not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/reject":{"post":{"summary":"Reject a pending tool call","description":"Resolves a pending approval as rejected. The engine appends a synthetic `tool_result` payload of `{ rejected: true, reason, approver }` and resumes the loop — the agent observes the rejection and decides what to do next (no exception thrown). `reason` is REQUIRED so operators justify the denial.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRunRequest"}}}},"responses":{"200":{"description":"Rejection resolved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"approval not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"approval not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/runs/{id}/swap-model":{"post":{"summary":"Swap the model on the next step and resume","description":"Resumes a paused run with a different model selection. The replay path enforces the agent's privacy tier — a swap to a model that violates it is rejected with `privacy_tier_unroutable`.","tags":["Runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"Run id.","schema":{"type":"string"},"example":"<run-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapModelCommand"}}}},"responses":{"200":{"description":"Swapped + resumed.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Run cannot be routed under the agent's privacy tier (CLAUDE.md non-negotiable #3).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"privacy_tier_unroutable","message":"no eligible model for sensitive privacy tier","details":{"agentName":"<agent-name>","privacyTier":"sensitive","requiredCapability":"reasoning","attempted":["ollama:llama-3.3","mlx:phi-4"]}}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/playground/run":{"post":{"summary":"Fan a prompt out to N models (SSE)","description":"Accepts a prompt + capability class + privacy tier. The router selects models that match the capability/tier, and the response streams interleaved frames per model. LLM-agnostic — no provider strings on the request.","tags":["Playground"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaygroundRunRequest"}}}},"responses":{"200":{"description":"SSE stream of interleaved playground frames (one event per chunk).","content":{"text/event-stream":{"schema":{"type":"string"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Run cannot be routed under the agent's privacy tier (CLAUDE.md non-negotiable #3).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"privacy_tier_unroutable","message":"no eligible model for sensitive privacy tier","details":{"agentName":"<agent-name>","privacyTier":"sensitive","requiredCapability":"reasoning","attempted":["ollama:llama-3.3","mlx:phi-4"]}}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/models":{"get":{"summary":"List available models","description":"Returns the merged model catalog: cloud models from the registry + locally-running models discovered on the request host (Ollama, llama.cpp, vLLM, MLX, TGI). Each entry includes capability classes, context window, pricing, and a privacy-tier compatibility flag.","tags":["Models"],"responses":{"200":{"description":"Model catalog.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListModelsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/models/savings":{"get":{"summary":"Estimated savings analysis","description":"Compares actual run cost to the cheapest router-eligible alternative model for the same capability class. Aggregated by period.","tags":["Models"],"parameters":[{"name":"period","in":"query","required":false,"description":"One of `day`, `week`, `month`, `quarter`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Savings rollup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavingsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/suites":{"get":{"summary":"List eval suites","description":"Lists every suite registered for the current tenant.","tags":["Eval"],"responses":{"200":{"description":"Suite list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSuitesResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create or replace an eval suite","description":"Persists the suite spec. Re-posting the same name overwrites in place.","tags":["Eval"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSuiteRequest"}}}},"responses":{"200":{"description":"Suite created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSuiteResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/suites/{name}":{"get":{"summary":"Fetch an eval suite by name","description":"Returns the suite definition + cases.","tags":["Eval"],"parameters":[{"name":"name","in":"path","required":true,"description":"Suite name.","schema":{"type":"string"},"example":"<suite>"}],"responses":{"200":{"description":"Suite detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalSuite"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Suite not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"suite not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/sweeps":{"get":{"summary":"List eval sweeps","description":"Returns recent sweep executions with their lifecycle status.","tags":["Eval"],"responses":{"200":{"description":"Sweeps list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSweepsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Start a sweep over (suite × variants)","description":"Kicks off a parameter sweep. Returns immediately with the sweep id; polling `/v1/eval/sweeps/{id}` reports progress.","tags":["Eval"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSweepRequest"}}}},"responses":{"200":{"description":"Sweep started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSweepResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/sweeps/{id}":{"get":{"summary":"Fetch a sweep with its cell results","description":"Returns the sweep spec + per-cell pass/fail/cost stats. Long-lived sweeps continue to update.","tags":["Eval"],"parameters":[{"name":"id","in":"path","required":true,"description":"Sweep id.","schema":{"type":"string"},"example":"<sweep-id>"}],"responses":{"200":{"description":"Sweep detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sweep"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Sweep not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"sweep not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/failure-clusters":{"get":{"summary":"Cluster sweep failures","description":"Returns clusters of failure modes computed across recent sweep runs (similar inputs / similar errors).","tags":["Eval"],"responses":{"200":{"description":"Cluster list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFailureClustersResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/sweeps/{id}/cluster":{"post":{"summary":"Recompute clusters for a single sweep","description":"Forces a fresh clustering pass for the supplied sweep. Returns the updated cluster set.","tags":["Eval"],"parameters":[{"name":"id","in":"path","required":true,"description":"Sweep id.","schema":{"type":"string"},"example":"<sweep-id>"}],"responses":{"200":{"description":"Recomputed clusters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterSweepResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Sweep not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"sweep not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/evaluators":{"get":{"summary":"List evaluator configs","description":"Returns all evaluator configs for the tenant.","tags":["Evaluators"],"responses":{"200":{"description":"Evaluator list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEvaluatorsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create an evaluator","description":"Registers a new evaluator config.","tags":["Evaluators"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEvaluatorRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluator"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/evaluators/{id}":{"patch":{"summary":"Update an evaluator","description":"Partial update; only provided fields are mutated.","tags":["Evaluators"],"parameters":[{"name":"id","in":"path","required":true,"description":"Evaluator id.","schema":{"type":"string"},"example":"<evaluator-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEvaluatorRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluator"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Evaluator not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"evaluator not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/evaluators/test":{"post":{"summary":"Dry-run an evaluator on a sample","description":"Executes the evaluator against an inline sample and returns the verdict + cost. No state is mutated.","tags":["Evaluators"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEvaluatorRequest"}}}},"responses":{"200":{"description":"Verdict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEvaluatorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/datasets":{"get":{"summary":"List datasets","description":"Returns all datasets for the tenant.","tags":["Datasets"],"responses":{"200":{"description":"Dataset list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatasetsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a dataset","description":"Creates a new dataset.","tags":["Datasets"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/datasets/{id}":{"patch":{"summary":"Update a dataset","description":"Partial update of dataset metadata + schema.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatasetRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/datasets/{id}/examples":{"get":{"summary":"List examples in a dataset","description":"Paginated list of dataset examples.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"responses":{"200":{"description":"Examples page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatasetExamplesResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Append an example to a dataset","description":"Adds a single example.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetExampleRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetExample"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/datasets/{id}/examples/bulk":{"post":{"summary":"Bulk append examples","description":"Atomic bulk append of up to 1,000 examples.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateDatasetExamplesRequest"}}}},"responses":{"200":{"description":"Bulk insert result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateDatasetExamplesResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/eval/datasets/{id}/examples/{exampleId}":{"patch":{"summary":"Update an example","description":"Partial update of a dataset example.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"},{"name":"exampleId","in":"path","required":true,"description":"Example id.","schema":{"type":"string"},"example":"<example-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatasetExampleRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetExample"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Example not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"example not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/datasets":{"get":{"summary":"List datasets","description":"Returns every dataset in the current tenant.","tags":["Datasets"],"responses":{"200":{"description":"Dataset list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatasetsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a dataset","description":"Creates a new tenant-scoped dataset.","tags":["Datasets"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/datasets/{id}":{"get":{"summary":"Fetch a dataset","description":"Returns the dataset metadata + example count.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"responses":{"200":{"description":"Dataset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"patch":{"summary":"Update a dataset","description":"Partial update of dataset metadata + schema.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatasetRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dataset"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete a dataset","description":"Hard-deletes the dataset and cascades all examples. Idempotent on subsequent calls.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/datasets/{id}/examples":{"get":{"summary":"List examples in a dataset","description":"Cursor-paginated examples list. `split` filters to a single bucket (`all` / `train` / `eval` / `holdout`).","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"},{"name":"split","in":"query","required":false,"description":"Optional split filter.","schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"description":"Pagination cursor (opaque).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size (default 100, max 500).","schema":{"type":"integer","minimum":1,"maximum":500}}],"responses":{"200":{"description":"Examples page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDatasetExamplesResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Append an example to a dataset","description":"Adds a single example.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetExampleRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetExample"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/datasets/{id}/examples/bulk":{"post":{"summary":"Bulk append examples","description":"Bulk append of up to 10,000 examples. Accepts `application/json` (the wave-14 contract shape) OR `text/csv` (header row + `input,expected,label,split`). Body is capped at 10MB. Duplicate `(input, expected)` pairs are skipped via SHA-1 dedup.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateDatasetExamplesRequest"}},"text/csv":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Bulk import result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateDatasetExamplesResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dataset not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dataset not found"}}}}},"413":{"description":"Body exceeds the 10MB import cap.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"payload_too_large","message":"bulk-import body exceeds the limit"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/datasets/{id}/examples/{exampleId}":{"patch":{"summary":"Update an example","description":"Inline edit of input / expected / metadata / label / split.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"},{"name":"exampleId","in":"path","required":true,"description":"Example id.","schema":{"type":"string"},"example":"<example-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDatasetExampleRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetExample"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Example not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"example not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete an example","description":"Hard-deletes the example.","tags":["Datasets"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dataset id.","schema":{"type":"string"},"example":"<dataset-id>"},{"name":"exampleId","in":"path","required":true,"description":"Example id.","schema":{"type":"string"},"example":"<example-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Example not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"example not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/evaluators":{"get":{"summary":"List evaluators","description":"Returns every evaluator visible to the current tenant.","tags":["Evaluators"],"responses":{"200":{"description":"Evaluator list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEvaluatorsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create an evaluator","description":"Creates a tenant-scoped evaluator. The author may flip `isShared` to expose it read-only across the tenant; only the author may edit / delete.","tags":["Evaluators"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEvaluatorRequest"}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluator"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/evaluators/{id}":{"get":{"summary":"Fetch an evaluator","description":"Returns the evaluator config.","tags":["Evaluators"],"parameters":[{"name":"id","in":"path","required":true,"description":"Evaluator id.","schema":{"type":"string"},"example":"<evaluator-id>"}],"responses":{"200":{"description":"Evaluator.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluator"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Evaluator not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"evaluator not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"patch":{"summary":"Update an evaluator","description":"Partial update of name / config / share flag. Only the author may patch.","tags":["Evaluators"],"parameters":[{"name":"id","in":"path","required":true,"description":"Evaluator id.","schema":{"type":"string"},"example":"<evaluator-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEvaluatorRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluator"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Evaluator not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"evaluator not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete an evaluator","description":"Hard-deletes the evaluator. Only the author may delete.","tags":["Evaluators"],"parameters":[{"name":"id","in":"path","required":true,"description":"Evaluator id.","schema":{"type":"string"},"example":"<evaluator-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Evaluator not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"evaluator not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/evaluators/{id}/test":{"post":{"summary":"Run an evaluator on a sample","description":"Executes the evaluator against an inline (input, output, expected) tuple and returns pass/score/detail. For `llm_judge`: dispatches via the platform model gateway, which respects the agent / call-context privacy tier (LLM-agnostic per CLAUDE.md non-negotiable #1).","tags":["Evaluators"],"parameters":[{"name":"id","in":"path","required":true,"description":"Evaluator id (or `__inline__` for kind+config).","schema":{"type":"string"},"example":"<evaluator-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEvaluatorRequest"}}}},"responses":{"200":{"description":"Verdict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEvaluatorResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Evaluator not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"evaluator not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/secrets":{"get":{"summary":"List secrets (redacted)","description":"Returns secret names + metadata. The actual values are never echoed back.","tags":["Secrets"],"responses":{"200":{"description":"Secret list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSecretsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Set or rotate a secret","description":"Creates or replaces a secret value for the tenant. The response carries the redacted summary only.","tags":["Secrets"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSecretRequest"}}}},"responses":{"200":{"description":"Secret persisted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSecretResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/secrets/{name}":{"delete":{"summary":"Delete a secret","description":"Hard-deletes the secret value. Pre-existing references in agent specs will fail their next run.","tags":["Secrets"],"parameters":[{"name":"name","in":"path","required":true,"description":"Secret name.","schema":{"type":"string"},"example":"<secret-name>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Secret not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"secret not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/billing/subscription":{"get":{"summary":"Fetch the current tenant subscription","description":"Returns the subscription status (trial, active, past-due, etc.) and the trial end date.","tags":["Billing"],"responses":{"200":{"description":"Subscription detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSubscriptionResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"503":{"description":"Billing is not wired up in this deploy (STRIPE_* env vars unset).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_configured","message":"billing not configured"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/billing/usage":{"get":{"summary":"Per-period usage rollup","description":"Aggregates usage by day, model, and agent for the requested period.","tags":["Billing"],"parameters":[{"name":"period","in":"query","required":false,"description":"One of `day`, `week`, `month`, `quarter`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Usage rollup.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsageResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/billing/checkout":{"post":{"summary":"Start a Stripe Checkout session","description":"Returns a Stripe Checkout URL. The web client redirects to it.","tags":["Billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"Checkout session created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}},"503":{"description":"Billing is not wired up in this deploy (STRIPE_* env vars unset).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_configured","message":"billing not configured"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/billing/portal":{"post":{"summary":"Open the Stripe customer portal","description":"Returns a portal URL for the active subscription. Used for plan + payment-method management.","tags":["Billing"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalRequest"}}}},"responses":{"200":{"description":"Portal URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"503":{"description":"Billing is not wired up in this deploy (STRIPE_* env vars unset).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_configured","message":"billing not configured"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/billing/webhook":{"post":{"summary":"Stripe webhook receiver","description":"Public route — auth is by the Stripe-Signature HMAC header, not the bearer token. The handler verifies the signature against the raw body BEFORE touching state.","tags":["Billing"],"requestBody":{"required":true,"description":"Stripe event envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Event accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"400":{"description":"Bad signature or replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"http_error","message":"invalid signature"}}}}},"503":{"description":"Billing is not wired up in this deploy (STRIPE_* env vars unset).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_configured","message":"billing not configured"}}}}}},"security":[]}},"/v1/dashboards":{"get":{"summary":"List dashboards","description":"Returns every dashboard the caller can read.","tags":["Dashboards"],"responses":{"200":{"description":"Dashboard list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDashboardsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a dashboard","description":"Creates a new dashboard with widgets + layout.","tags":["Dashboards"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDashboardRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dashboard"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/dashboards/{id}":{"get":{"summary":"Fetch a dashboard","description":"Returns the dashboard spec.","tags":["Dashboards"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string"},"example":"<dashboard-id>"}],"responses":{"200":{"description":"Dashboard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dashboard"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dashboard not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dashboard not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"patch":{"summary":"Update a dashboard","description":"Partial update of dashboard metadata, widgets, or layout.","tags":["Dashboards"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string"},"example":"<dashboard-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDashboardRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dashboard"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dashboard not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dashboard not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete a dashboard","description":"Hard-deletes the dashboard. Idempotent.","tags":["Dashboards"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string"},"example":"<dashboard-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/dashboards/{id}/data":{"post":{"summary":"Materialise widget data","description":"Runs the dashboard's widget queries and returns a per-widget data payload.","tags":["Dashboards"],"parameters":[{"name":"id","in":"path","required":true,"description":"Dashboard id.","schema":{"type":"string"},"example":"<dashboard-id>"}],"responses":{"200":{"description":"Widget data payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardDataPayload"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Dashboard not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"dashboard not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/alerts":{"get":{"summary":"List alert rules","description":"Returns every alert rule for the tenant.","tags":["Alerts"],"responses":{"200":{"description":"Alert rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAlertRulesResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create an alert rule","description":"Creates a new alert rule (with thresholds + targets).","tags":["Alerts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAlertRuleRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRule"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/alerts/{id}":{"get":{"summary":"Fetch one alert rule","description":"Returns the alert rule by id.","tags":["Alerts"],"parameters":[{"name":"id","in":"path","required":true,"description":"Alert rule id.","schema":{"type":"string"},"example":"<alert-id>"}],"responses":{"200":{"description":"Alert rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRule"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Alert not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"alert not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"patch":{"summary":"Update an alert rule","description":"Partial update of an alert rule.","tags":["Alerts"],"parameters":[{"name":"id","in":"path","required":true,"description":"Alert rule id.","schema":{"type":"string"},"example":"<alert-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAlertRuleRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRule"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Alert not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"alert not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete an alert rule","description":"Hard-deletes the rule.","tags":["Alerts"],"parameters":[{"name":"id","in":"path","required":true,"description":"Alert rule id.","schema":{"type":"string"},"example":"<alert-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/alerts/{id}/events":{"get":{"summary":"List events for an alert rule","description":"Returns the recent firing/clearing events for the rule.","tags":["Alerts"],"parameters":[{"name":"id","in":"path","required":true,"description":"Alert rule id.","schema":{"type":"string"},"example":"<alert-id>"}],"responses":{"200":{"description":"Event list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAlertEventsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Alert not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"alert not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/alerts/{id}/silence":{"post":{"summary":"Silence an alert rule","description":"Suppresses firings for the configured silence window.","tags":["Alerts"],"parameters":[{"name":"id","in":"path","required":true,"description":"Alert rule id.","schema":{"type":"string"},"example":"<alert-id>"}],"responses":{"200":{"description":"Silenced.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SilenceAlertResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Alert not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"alert not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/alerts/{id}/test":{"post":{"summary":"Trigger a test fire","description":"Sends a synthetic event through the rule's targets to verify wiring.","tags":["Alerts"],"parameters":[{"name":"id","in":"path","required":true,"description":"Alert rule id.","schema":{"type":"string"},"example":"<alert-id>"}],"responses":{"200":{"description":"Test fired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestAlertResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Alert not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"alert not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/annotations":{"get":{"summary":"List annotations","description":"Lists annotations for a target (run, sweep, agent). Filter by `targetKind` + `targetId`.","tags":["Annotations"],"responses":{"200":{"description":"Annotation list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAnnotationsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create an annotation","description":"Posts a new annotation (top-level or reply via `parentId`).","tags":["Annotations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAnnotationRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Annotation"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/annotations/{id}":{"patch":{"summary":"Edit an annotation","description":"Edits the body of an annotation. Author-only.","tags":["Annotations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Annotation id.","schema":{"type":"string"},"example":"<annotation-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAnnotationRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Annotation"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Annotation not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"annotation not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete an annotation","description":"Soft-deletes the annotation.","tags":["Annotations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Annotation id.","schema":{"type":"string"},"example":"<annotation-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/annotations/{id}/reactions":{"post":{"summary":"Toggle a reaction on an annotation","description":"Adds or removes a reaction (👍 / 👀 / ❤️ / 🚀) by the caller.","tags":["Annotations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Annotation id.","schema":{"type":"string"},"example":"<annotation-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleReactionRequest"}}}},"responses":{"200":{"description":"Reaction toggled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToggleReactionResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Annotation not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"annotation not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/annotations/feed":{"get":{"summary":"Recent annotations across the org","description":"Cross-resource feed of recent annotations, used by the activity surface.","tags":["Annotations"],"responses":{"200":{"description":"Annotation feed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnotationFeedResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/shares":{"get":{"summary":"List share links","description":"Lists all share links the caller can manage.","tags":["Shares"],"responses":{"200":{"description":"Share-link list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListShareLinksResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a share link","description":"Mints a public read-only handle. Optional password gating + expiry.","tags":["Shares"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareLinkRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareLinkResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/shares/{id}/revoke":{"post":{"summary":"Revoke a share link","description":"Marks the share link revoked; subsequent reads return 404.","tags":["Shares"],"parameters":[{"name":"id","in":"path","required":true,"description":"Share id.","schema":{"type":"string"},"example":"<share-id>"}],"responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareLink"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Share not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"share not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/shares/{id}":{"delete":{"summary":"Delete a share link","description":"Hard-delete; idempotent.","tags":["Shares"],"parameters":[{"name":"id","in":"path","required":true,"description":"Share id.","schema":{"type":"string"},"example":"<share-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/public/share/{slug}":{"get":{"summary":"Resolve a public share slug","description":"Public route — no auth. Returns the shared resource if the slug is live (and the password supplied via `?password=` matches when one is set). Returns the locked envelope when a password is required but missing/wrong.","tags":["Shares"],"parameters":[{"name":"slug","in":"path","required":true,"description":"Public share slug.","schema":{"type":"string"},"example":"<share-slug>"}],"responses":{"200":{"description":"Public share resolved.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PublicShareResponse"},{"$ref":"#/components/schemas/PublicShareLockedResponse"}]},"example":{"ok":false,"locked":true}}}},"404":{"description":"Share not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"share not found"}}}}}},"security":[]}},"/v1/notifications":{"get":{"summary":"List notifications for the current user","description":"Cursor-paginated. Filter by `read` state.","tags":["Notifications"],"parameters":[{"name":"read","in":"query","required":false,"description":"When `true`, only read; when `false`, only unread.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Notifications page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListNotificationsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/notifications/{id}/mark-read":{"post":{"summary":"Mark a notification read","description":"Idempotent.","tags":["Notifications"],"parameters":[{"name":"id","in":"path","required":true,"description":"Notification id.","schema":{"type":"string"},"example":"<notification-id>"}],"responses":{"200":{"description":"Marked read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkNotificationReadResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Notification not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"notification not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/notifications/mark-all-read":{"post":{"summary":"Mark all notifications read","description":"Bulk operation; returns the count affected.","tags":["Notifications"],"responses":{"200":{"description":"Marked all.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkAllNotificationsReadResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/activity":{"get":{"summary":"Activity feed","description":"Cross-resource activity events (annotation posted, run completed, alert fired, …).","tags":["Notifications"],"responses":{"200":{"description":"Activity page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListActivityResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/sse/events":{"get":{"summary":"SSE live-tail of activity events","description":"Server-sent event stream of new activity for the caller. One frame per event.","tags":["Notifications"],"responses":{"200":{"description":"SSE stream.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/integrations":{"get":{"summary":"List integrations","description":"Returns the list of configured outbound integrations for the tenant.","tags":["Integrations"],"responses":{"200":{"description":"Integration list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListIntegrationsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create an integration","description":"Registers a new outbound integration. Secrets (e.g. webhook signing) are stored encrypted.","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntegrationRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/integrations/{id}":{"get":{"summary":"Fetch one integration","description":"Returns the integration record.","tags":["Integrations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Integration id.","schema":{"type":"string"},"example":"<integration-id>"}],"responses":{"200":{"description":"Integration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Integration not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"integration not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"patch":{"summary":"Update an integration","description":"Partial update.","tags":["Integrations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Integration id.","schema":{"type":"string"},"example":"<integration-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateIntegrationRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Integration not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"integration not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete an integration","description":"Hard-delete; the integration is no longer dispatched to.","tags":["Integrations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Integration id.","schema":{"type":"string"},"example":"<integration-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/integrations/{id}/test":{"post":{"summary":"Send a test payload","description":"Exercises the integration end-to-end with a synthetic event. Useful for verifying webhook signatures.","tags":["Integrations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Integration id.","schema":{"type":"string"},"example":"<integration-id>"}],"responses":{"200":{"description":"Test result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestFireResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Integration not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"integration not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/observability/summary":{"get":{"summary":"Aggregate observability summary","description":"Returns KPI cards + time-series for runs, costs, latency, and error rate over the requested period.","tags":["Observability"],"parameters":[{"name":"period","in":"query","required":false,"description":"One of `day`, `week`, `month`, `quarter`.","schema":{"type":"string"}}],"responses":{"200":{"description":"Summary payload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ObservabilitySummary"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/views":{"get":{"summary":"List saved views","description":"Lists saved views for the caller, optionally filtered by `surface`.","tags":["Saved Views"],"parameters":[{"name":"surface","in":"query","required":false,"description":"Restrict to one surface (e.g. `runs`).","schema":{"type":"string"}}],"responses":{"200":{"description":"Saved views.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSavedViewsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create a saved view","description":"Creates a new saved view.","tags":["Saved Views"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSavedViewRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedView"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/views/{id}":{"patch":{"summary":"Update a saved view","description":"Partial update.","tags":["Saved Views"],"parameters":[{"name":"id","in":"path","required":true,"description":"View id.","schema":{"type":"string"},"example":"<view-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSavedViewRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedView"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"View not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"view not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Delete a saved view","description":"Hard-delete; idempotent.","tags":["Saved Views"],"parameters":[{"name":"id","in":"path","required":true,"description":"View id.","schema":{"type":"string"},"example":"<view-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/api-keys":{"get":{"summary":"List API keys for the tenant","description":"Returns the redacted summary of every active API key. Plaintext is only returned at create time.","tags":["API Keys"],"responses":{"200":{"description":"API key list.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Mint a new API key","description":"Creates a new key. The plaintext token is in the response body — store it; subsequent reads return only the redacted summary.","tags":["API Keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"200":{"description":"Created (plaintext token in body).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/api-keys/{id}/revoke":{"post":{"summary":"Revoke an API key","description":"Marks the key revoked; subsequent bearer use returns 401.","tags":["API Keys"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-key id (the prefix-tagged uuid).","schema":{"type":"string"},"example":"<api-key-id>"}],"responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"API key not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"api key not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/api-keys/{id}":{"delete":{"summary":"Delete an API key record","description":"Hard-delete after revocation. Idempotent.","tags":["API Keys"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-key id.","schema":{"type":"string"},"example":"<api-key-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/invitations":{"get":{"summary":"List pending invitations","description":"Lists invitations for the tenant.","tags":["Invitations"],"responses":{"200":{"description":"Invitations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInvitationsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"post":{"summary":"Create an invitation","description":"Mints an invitation token and (when mailer is configured) emails it.","tags":["Invitations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationRequest"}}}},"responses":{"200":{"description":"Created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/invitations/{id}/revoke":{"post":{"summary":"Revoke an invitation","description":"Marks the invitation revoked.","tags":["Invitations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Invitation id.","schema":{"type":"string"},"example":"<invitation-id>"}],"responses":{"200":{"description":"Revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invitation"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"404":{"description":"Invitation not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"invitation not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/invitations/{id}":{"delete":{"summary":"Delete an invitation","description":"Hard-delete; idempotent.","tags":["Invitations"],"parameters":[{"name":"id","in":"path","required":true,"description":"Invitation id.","schema":{"type":"string"},"example":"<invitation-id>"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/invitations/accept":{"post":{"summary":"Accept an invitation by token","description":"Public route — bearer auth is replaced by argon2 verification of the invitation token. Returns a session for the new member.","tags":["Invitations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationRequest"}}}},"responses":{"200":{"description":"Joined.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthSessionResponse"}}}},"404":{"description":"Invitation not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"invitation not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[]}},"/v1/members":{"get":{"summary":"List members of the tenant","description":"Returns the user records and their roles.","tags":["Members"],"responses":{"200":{"description":"Members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMembersResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/members/{userId}":{"patch":{"summary":"Update a member's role","description":"Owner-only. Cannot demote the last owner.","tags":["Members"],"parameters":[{"name":"userId","in":"path","required":true,"description":"Target user id.","schema":{"type":"string"},"example":"<user-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"404":{"description":"Member not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"member not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"delete":{"summary":"Remove a member from the tenant","description":"Owner-only. Cannot remove the last owner.","tags":["Members"],"parameters":[{"name":"userId","in":"path","required":true,"description":"Target user id.","schema":{"type":"string"},"example":"<user-id>"}],"responses":{"204":{"description":"Removed."},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"404":{"description":"Member not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"member not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/audit":{"get":{"summary":"Read the tenant audit log","description":"Owner-only. Returns the audit entries with cursor pagination.","tags":["Audit"],"responses":{"200":{"description":"Audit page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAuditLogResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/tenants/me/seed-default":{"post":{"summary":"Seed the tenant with the default agency","description":"Copies the bundled `agency/` reference org's agents + suites into the calling tenant. Idempotent.","tags":["Tenants"],"responses":{"200":{"description":"Seeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeedDefaultResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/design-partners/apply":{"post":{"summary":"Submit a design-partner application","description":"Public route — applicants haven't signed up yet. The API persists the application; an admin reviews it later.","tags":["Design Partners"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignPartnerApplyRequest"}}}},"responses":{"200":{"description":"Application accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignPartnerApplyResponse"}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[]}},"/v1/admin/design-partner-applications":{"get":{"summary":"List design-partner applications (admin)","description":"Admin-only. Returns the applications with their review status.","tags":["Design Partners"],"responses":{"200":{"description":"Applications.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDesignPartnerApplicationsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/admin/design-partner-applications/{id}":{"patch":{"summary":"Update a design-partner application","description":"Admin-only. Status transitions: `new` -> `contacted` / `accepted` / `declined`.","tags":["Design Partners"],"parameters":[{"name":"id","in":"path","required":true,"description":"Application id.","schema":{"type":"string"},"example":"<application-id>"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDesignPartnerApplicationRequest"}}}},"responses":{"200":{"description":"Updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesignPartnerApplication"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"404":{"description":"Application not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"application not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/cache/stats":{"get":{"summary":"Cache hit/miss + savings snapshot","description":"Returns hit count, miss count, hit rate, total $ saved, and a per-model breakdown for the selected period.","tags":["Cache"],"parameters":[{"name":"period","in":"query","required":false,"description":"Time window — `24h`, `7d`, or `30d`. Defaults to `24h`.","schema":{"type":"string","enum":["24h","7d","30d"]}}],"responses":{"200":{"description":"Cache stats snapshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheStatsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/cache/purge":{"post":{"summary":"Purge cached entries (owner only)","description":"Removes cached entries matching the optional `olderThan` (ISO ts) and/or `model` filters. Empty body purges everything for the tenant.","tags":["Cache"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CachePurgeRequest"}}}},"responses":{"200":{"description":"Number of rows purged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CachePurgeResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/cache/policy":{"get":{"summary":"Read the per-tenant cache policy","description":"Returns enabled flag, TTL in seconds, and the sensitive-tier opt-in flag. Defaults to enabled + 24h + sensitive-skip when unset.","tags":["Cache"],"responses":{"200":{"description":"Current policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CachePolicyResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"patch":{"summary":"Update the per-tenant cache policy (admin/owner)","description":"Patch any subset of `enabled` / `ttlSeconds` / `cacheSensitive`. TTL is clamped to the supported range (1 minute … 30 days).","tags":["Cache"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCachePolicyRequest"}}}},"responses":{"200":{"description":"Updated policy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CachePolicyResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/quotas/me":{"get":{"summary":"Read this tenant's monthly quota snapshot","description":"Returns the caller's plan + run / cost caps + month-to-date usage + reset timestamp. The row is lazily seeded with the trial-plan defaults on first read.","tags":["Quotas"],"responses":{"200":{"description":"Current quota snapshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMyQuotaResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/domains":{"post":{"summary":"Create / replace this tenant custom domain","description":"Seeds a `tenant_domains` row with a freshly-generated verification token. Returns the TXT record name + value the caller must publish at their DNS provider before calling /verify.","tags":["Domains"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainRequest"}}}},"responses":{"201":{"description":"Domain created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDomainResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]},"get":{"summary":"List custom domains for this tenant","description":"Returns the (at most one) custom domain registered for the caller tenant.","tags":["Domains"],"responses":{"200":{"description":"Custom domains.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDomainsResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/domains/{hostname}/verify":{"post":{"summary":"Verify a custom domain via TXT record lookup","description":"Resolves `_aldo-verification.<hostname>` and matches the TXT value against the stored verification token. Caps the lookup at 10 seconds. Returns 200 with `verified=false` + `reason` on a TXT mismatch / DNS timeout.","tags":["Domains"],"parameters":[{"name":"hostname","in":"path","required":true,"description":"The hostname to verify (e.g. agents.acme-corp.com).","schema":{"type":"string"}}],"responses":{"200":{"description":"Verification result. `verified=false` with a `reason` field is also returned at this status when the TXT record check failed (the API uses a single 200 envelope rather than mapping deny to 4xx — clients render the `reason` inline).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyDomainResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"404":{"description":"domain not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"domain not found"}}}}},"422":{"description":"Request validation failed (Zod schema mismatch).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"validation_error","message":"invalid request body"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}},"/v1/domains/{hostname}":{"delete":{"summary":"Remove a custom domain","description":"Removes the `tenant_domains` row. SSL certificates issued by Fly / Vercel are NOT revoked here — operators must clean those up out of band.","tags":["Domains"],"parameters":[{"name":"hostname","in":"path","required":true,"description":"The hostname to remove.","schema":{"type":"string"}}],"responses":{"200":{"description":"Domain removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteDomainResponse"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"unauthenticated","message":"authentication required"}}}}},"403":{"description":"The caller is authenticated but cannot reach the resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"forbidden","message":"forbidden"}}}}},"404":{"description":"domain not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"},"example":{"error":{"code":"not_found","message":"domain not found"}}}}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}]}}},"components":{"schemas":{"AcceptInvitationRequest":{"type":"object","properties":{"token":{"type":"string","minLength":1},"password":{"type":"string","minLength":12}},"required":["token"],"additionalProperties":false},"ActivityEvent":{"type":"object","properties":{"id":{"type":"string"},"actorUserId":{"type":["string","null"]},"actorLabel":{"type":["string","null"]},"verb":{"$ref":"#/components/schemas/ActivityVerb"},"objectKind":{"$ref":"#/components/schemas/ActivityObjectKind"},"objectId":{"type":"string"},"metadata":{"type":"object","additionalProperties":{}},"at":{"type":"string"}},"required":["id","actorUserId","actorLabel","verb","objectKind","objectId","metadata","at"],"additionalProperties":false},"ActivityObjectKind":{"type":"string"},"ActivityVerb":{"type":"string"},"AddRunTagRequest":{"type":"object","properties":{"tag":{"type":"string","minLength":1,"maxLength":64}},"required":["tag"],"additionalProperties":false},"AgentDetail":{"type":"object","properties":{"name":{"type":"string"},"owner":{"type":"string"},"latestVersion":{"type":"string"},"promoted":{"type":"boolean"},"description":{"type":"string"},"privacyTier":{"$ref":"#/components/schemas/PrivacyTier"},"team":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"projectId":{"type":["string","null"]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersionEntry"}},"spec":{},"guards":{"oneOf":[{"$ref":"#/components/schemas/ToolsGuardsWire"},{"type":"null"}]},"sandbox":{"oneOf":[{"$ref":"#/components/schemas/SandboxConfigWire"},{"type":"null"}]},"composite":{"oneOf":[{"$ref":"#/components/schemas/CompositeWire"},{"type":"null"}]},"termination":{"oneOf":[{"$ref":"#/components/schemas/TerminationWire"},{"type":"null"}]},"iteration":{"oneOf":[{"$ref":"#/components/schemas/IterationWire"},{"type":"null"}]},"promptRef":{"oneOf":[{"$ref":"#/components/schemas/PromptRefWire"},{"type":"null"}]}},"required":["name","owner","latestVersion","promoted","description","privacyTier","team","tags","versions","spec"],"additionalProperties":false},"AgentSummary":{"type":"object","properties":{"name":{"type":"string"},"owner":{"type":"string"},"latestVersion":{"type":"string"},"promoted":{"type":"boolean"},"description":{"type":"string"},"privacyTier":{"$ref":"#/components/schemas/PrivacyTier"},"team":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"projectId":{"type":["string","null"]}},"required":["name","owner","latestVersion","promoted","description","privacyTier","team","tags"],"additionalProperties":false,"description":"Compact agent record for list views."},"AgentVersionEntry":{"type":"object","properties":{"version":{"type":"string"},"promoted":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["version","promoted","createdAt"],"additionalProperties":false},"AlertComparator":{"type":"string","enum":["gt","gte","lt","lte"]},"AlertEvent":{"type":"object","properties":{"id":{"type":"string"},"alertRuleId":{"type":"string"},"triggeredAt":{"type":"string"},"value":{"type":"number"},"dimensions":{"type":"object","additionalProperties":{}},"notifiedChannels":{"type":"array","items":{"type":"string"}}},"required":["id","alertRuleId","triggeredAt","value","dimensions","notifiedChannels"],"additionalProperties":false},"AlertKind":{"type":"string","enum":["cost_spike","error_rate","latency_p95","guards_blocked","budget_threshold"]},"AlertPeriod":{"type":"string","enum":["5m","1h","24h","7d"]},"AlertRule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/AlertKind"},"threshold":{"$ref":"#/components/schemas/AlertThreshold"},"targets":{"$ref":"#/components/schemas/AlertTargets"},"notificationChannels":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"}},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":["string","null"]},"lastSilencedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"ownedByMe":{"type":"boolean"}},"required":["id","name","kind","threshold","targets","notificationChannels","enabled","lastTriggeredAt","lastSilencedAt","createdAt","ownedByMe"],"additionalProperties":false},"AlertTargets":{"type":"object","properties":{"agent":{"type":"string"},"model":{"type":"string"},"locality":{"type":"string"}},"additionalProperties":false},"AlertThreshold":{"type":"object","properties":{"value":{"type":"number"},"comparator":{"$ref":"#/components/schemas/AlertComparator"},"period":{"$ref":"#/components/schemas/AlertPeriod"}},"required":["value","comparator","period"],"additionalProperties":false},"Annotation":{"type":"object","properties":{"id":{"type":"string"},"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string"},"parentId":{"type":["string","null"]},"authorUserId":{"type":"string"},"authorEmail":{"type":"string"},"body":{"type":"string"},"reactions":{"type":"array","items":{"$ref":"#/components/schemas/AnnotationReactionSummary"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","targetKind","targetId","parentId","authorUserId","authorEmail","body","reactions","createdAt","updatedAt"],"additionalProperties":false},"AnnotationFeedQuery":{"type":"object","properties":{"since":{"type":"string"},"limit":{"type":"integer","minimum":0,"maximum":200}},"required":["limit"],"additionalProperties":false},"AnnotationFeedResponse":{"type":"object","properties":{"annotations":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"}}},"required":["annotations"],"additionalProperties":false},"AnnotationReactionKind":{"type":"string","enum":["thumbs_up","thumbs_down","eyes","check"]},"AnnotationReactionSummary":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/AnnotationReactionKind"},"count":{"type":"integer","minimum":0},"reactedByMe":{"type":"boolean"}},"required":["kind","count","reactedByMe"],"additionalProperties":false},"AnnotationTargetKind":{"type":"string","enum":["run","sweep","agent"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false,"description":"Standard error envelope returned for any non-2xx response."},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"lastUsedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]}},"required":["id","name","prefix","scopes","createdAt","lastUsedAt","expiresAt","revokedAt"],"additionalProperties":false},"ApiKeyScope":{"type":"string","enum":["runs:write","runs:read","agents:read","agents:write","secrets:read","secrets:write","admin:*"]},"ApprovalDecisionResponse":{"type":"object","properties":{"runId":{"type":"string"},"callId":{"type":"string"},"kind":{"type":"string","enum":["approved","rejected"]},"approver":{"type":"string"},"reason":{"type":["string","null"]},"at":{"type":"string"}},"required":["runId","callId","kind","approver","reason","at"],"additionalProperties":false,"description":"Response for both `/approve` and `/reject` — echoes the decision (approver, reason, at) so the caller can render the audit row."},"ApproveRunRequest":{"type":"object","properties":{"callId":{"type":"string","minLength":1},"reason":{"type":"string","minLength":1}},"required":["callId"],"additionalProperties":false,"description":"Body for `POST /v1/runs/:id/approve` — resolves the pending approval keyed by `callId` as approved. Optional free-form `reason` for audit."},"AuditLogEntry":{"type":"object","properties":{"id":{"type":"string"},"verb":{"type":"string"},"objectKind":{"type":"string"},"objectId":{"type":["string","null"]},"actorUserId":{"type":["string","null"]},"actorApiKeyId":{"type":["string","null"]},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"at":{"type":"string"}},"required":["id","verb","objectKind","objectId","actorUserId","actorApiKeyId","ip","userAgent","metadata","at"],"additionalProperties":false},"AuthMeResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/AuthUser"},"tenant":{"$ref":"#/components/schemas/AuthTenant"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/AuthMembership"}}},"required":["user","tenant","memberships"],"additionalProperties":false},"AuthMembership":{"type":"object","properties":{"tenantId":{"type":"string"},"tenantSlug":{"type":"string"},"tenantName":{"type":"string"},"role":{"type":"string"}},"required":["tenantId","tenantSlug","tenantName","role"],"additionalProperties":false},"AuthSessionResponse":{"type":"object","properties":{"token":{"type":"string","minLength":1},"user":{"$ref":"#/components/schemas/AuthUser"},"tenant":{"$ref":"#/components/schemas/AuthTenant"},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/AuthMembership"}}},"required":["token","user","tenant","memberships"],"additionalProperties":false},"AuthTenant":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"}},"required":["id","slug","name"],"additionalProperties":false},"AuthUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","format":"email"},"createdAt":{"type":"string"}},"required":["id","email"],"additionalProperties":false},"BarData":{"type":"object","properties":{"shape":{"type":"string","const":"bar"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/BarRow"}}},"required":["shape","rows"],"additionalProperties":false},"BarRow":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"}},"required":["label","value"],"additionalProperties":false},"BillingUsageByAgent":{"type":"object","properties":{"agent":{"type":"string"},"usd":{"type":"number","minimum":0}},"required":["agent","usd"],"additionalProperties":false},"BillingUsageByDay":{"type":"object","properties":{"date":{"type":"string"},"usd":{"type":"number","minimum":0}},"required":["date","usd"],"additionalProperties":false},"BillingUsageByModel":{"type":"object","properties":{"model":{"type":"string"},"usd":{"type":"number","minimum":0}},"required":["model","usd"],"additionalProperties":false},"BillingUsagePeriod":{"type":"string","enum":["24h","7d","30d"]},"BillingUsageQuery":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/BillingUsagePeriod"}},"additionalProperties":false},"BillingUsageResponse":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/BillingUsagePeriod"},"totalUsd":{"type":"number","minimum":0},"byDay":{"type":"array","items":{"$ref":"#/components/schemas/BillingUsageByDay"}},"byModel":{"type":"array","items":{"$ref":"#/components/schemas/BillingUsageByModel"}},"byAgent":{"type":"array","items":{"$ref":"#/components/schemas/BillingUsageByAgent"}},"monthlyProjectionUsd":{"type":["number","null"],"minimum":0}},"required":["period","totalUsd","byDay","byModel","byAgent","monthlyProjectionUsd"],"additionalProperties":false},"Breakpoint":{"type":"object","properties":{"id":{"type":"string"},"runId":{"type":"string"},"kind":{"type":"string","enum":["before_tool_call","before_model_call","after_node","on_event"]},"match":{"type":"string"},"enabled":{"type":"boolean"},"hitCount":{"type":"integer","minimum":0}},"required":["id","runId","kind","match","enabled","hitCount"],"additionalProperties":false},"BulkCreateDatasetExamplesRequest":{"type":"object","properties":{"examples":{"type":"array","items":{"$ref":"#/components/schemas/CreateDatasetExampleRequest"}}},"required":["examples"],"additionalProperties":false},"BulkCreateDatasetExamplesResponse":{"type":"object","properties":{"inserted":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0},"errors":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":0},"message":{"type":"string"}},"required":["index","message"],"additionalProperties":false}}},"required":["inserted","skipped","errors"],"additionalProperties":false},"BulkRunActionRequest":{"type":"object","properties":{"runIds":{"type":"array","items":{"type":"string","minLength":1}},"action":{"type":"string","enum":["archive","unarchive","add-tag","remove-tag"]},"tag":{"type":"string","minLength":1,"maxLength":64}},"required":["runIds","action"],"additionalProperties":false},"BulkRunActionResponse":{"type":"object","properties":{"affected":{"type":"integer","minimum":0}},"required":["affected"],"additionalProperties":false},"CachePolicy":{"type":"object","properties":{"enabled":{"type":"boolean"},"ttlSeconds":{"type":"integer","minimum":0},"cacheSensitive":{"type":"boolean"}},"required":["enabled","ttlSeconds","cacheSensitive"],"additionalProperties":false},"CachePolicyResponse":{"type":"object","properties":{"policy":{"$ref":"#/components/schemas/CachePolicy"}},"required":["policy"],"additionalProperties":false},"CachePurgeRequest":{"type":"object","properties":{"olderThan":{"type":"string"},"model":{"type":"string"}},"additionalProperties":false},"CachePurgeResponse":{"type":"object","properties":{"purged":{"type":"integer","minimum":0}},"required":["purged"],"additionalProperties":false},"CacheStatsByModel":{"type":"object","properties":{"model":{"type":"string"},"hits":{"type":"integer","minimum":0},"savedUsd":{"type":"number","minimum":0}},"required":["model","hits","savedUsd"],"additionalProperties":false},"CacheStatsPeriod":{"type":"string","enum":["24h","7d","30d"]},"CacheStatsResponse":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/CacheStatsPeriod"},"hitCount":{"type":"integer","minimum":0},"missCount":{"type":"integer","minimum":0},"hitRate":{"type":"number","minimum":0,"maximum":1},"totalSavedUsd":{"type":"number","minimum":0},"byModel":{"type":"array","items":{"$ref":"#/components/schemas/CacheStatsByModel"}}},"required":["period","hitCount","missCount","hitRate","totalSavedUsd","byModel"],"additionalProperties":false},"CheckAgentResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"agent":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"privacyTier":{"$ref":"#/components/schemas/PrivacyTier"},"required":{"type":"array","items":{"type":"string"}},"primaryClass":{"type":"string"},"fallbackClasses":{"type":"array","items":{"type":"string"}}},"required":["name","version","privacyTier","required","primaryClass","fallbackClasses"],"additionalProperties":false},"chosen":{"oneOf":[{"$ref":"#/components/schemas/RoutingChosenWire"},{"type":"null"}]},"trace":{"type":"array","items":{"$ref":"#/components/schemas/RoutingClassTraceWire"}},"reason":{"type":["string","null"]},"fix":{"type":["string","null"]}},"required":["ok","agent","chosen","trace","reason","fix"],"additionalProperties":false},"CheckoutRequest":{"type":"object","properties":{"plan":{"type":"string","enum":["solo","team"]},"returnTo":{"type":"string","minLength":1}},"required":["plan"],"additionalProperties":false},"CheckoutResponse":{"type":"object","properties":{"url":{"type":"string","minLength":1}},"required":["url"],"additionalProperties":false},"ClusterSweepResponse":{"type":"object","properties":{"clusters":{"type":"array","items":{"$ref":"#/components/schemas/FailureCluster"}},"failedCount":{"type":"integer","minimum":0}},"required":["clusters","failedCount"],"additionalProperties":false},"Comment":{"type":"object","properties":{"id":{"type":"string"},"engagementId":{"type":"string"},"tenantId":{"type":"string"},"runId":{"type":["string","null"]},"authorUserId":{"type":["string","null"]},"body":{"type":"string"},"kind":{"$ref":"#/components/schemas/CommentKind"},"at":{"type":"string"}},"required":["id","engagementId","tenantId","runId","authorUserId","body","kind","at"],"additionalProperties":false},"CommentKind":{"type":"string","enum":["comment","change_request","architecture_decision"]},"CommentResponse":{"type":"object","properties":{"comment":{"$ref":"#/components/schemas/Comment"}},"required":["comment"],"additionalProperties":false},"CompositeIterationWire":{"type":"object","properties":{"maxRounds":{"type":"integer","minimum":0},"terminate":{"type":"string","minLength":1}},"required":["maxRounds","terminate"],"additionalProperties":false},"CompositeStrategyWire":{"type":"string","enum":["sequential","parallel","debate","iterative"]},"CompositeSubagentWire":{"type":"object","properties":{"agent":{"type":"string","minLength":1},"as":{"type":"string","minLength":1},"inputMap":{"type":"object","additionalProperties":{"type":"string","minLength":1}}},"required":["agent"],"additionalProperties":false},"CompositeWire":{"type":"object","properties":{"strategy":{"$ref":"#/components/schemas/CompositeStrategyWire"},"subagents":{"type":"array","items":{"$ref":"#/components/schemas/CompositeSubagentWire"}},"aggregator":{"type":"string","minLength":1},"iteration":{"$ref":"#/components/schemas/CompositeIterationWire"}},"required":["strategy","subagents"],"additionalProperties":false},"ContinueCommand":{"type":"object","properties":{"mode":{"type":"string","enum":["run","step"]}},"required":["mode"],"additionalProperties":false},"CreateAlertRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"$ref":"#/components/schemas/AlertKind"},"threshold":{"$ref":"#/components/schemas/AlertThreshold"},"targets":{"$ref":"#/components/schemas/AlertTargets"},"notificationChannels":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"}},"enabled":{"type":"boolean"}},"required":["name","kind","threshold","notificationChannels"],"additionalProperties":false},"CreateAnnotationRequest":{"type":"object","properties":{"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string","minLength":1,"maxLength":256},"body":{"type":"string","minLength":1,"maxLength":8192},"parentId":{"type":"string","minLength":1}},"required":["targetKind","targetId","body"],"additionalProperties":false},"CreateApiKeyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"scopes":{"type":"array","items":{"type":"string"}},"expiresInDays":{"type":"integer","minimum":0,"maximum":3650}},"required":["name","scopes"],"additionalProperties":false},"CreateApiKeyResponse":{"type":"object","properties":{"key":{"type":"string"},"apiKey":{"$ref":"#/components/schemas/ApiKey"}},"required":["key","apiKey"],"additionalProperties":false},"CreateBreakpointRequest":{"type":"object","properties":{"kind":{"type":"string","enum":["before_tool_call","before_model_call","after_node","on_event"]},"match":{"type":"string"},"enabled":{"type":"boolean"}},"required":["kind","match","enabled"],"additionalProperties":false},"CreateCommentRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":8000},"kind":{"$ref":"#/components/schemas/CommentKind"},"runId":{"type":"string","minLength":1}},"required":["body"],"additionalProperties":false},"CreateDashboardRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":2000},"isShared":{"type":"boolean"},"layout":{"type":"array","items":{"$ref":"#/components/schemas/DashboardWidget"}}},"required":["name"],"additionalProperties":false},"CreateDatasetExampleRequest":{"type":"object","properties":{"input":{},"expected":{},"metadata":{"type":"object","additionalProperties":{}},"label":{"type":"string"},"split":{"type":"string"}},"required":["input"],"additionalProperties":false},"CreateDatasetRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":2000},"schema":{"$ref":"#/components/schemas/DatasetSchema"},"tags":{"type":"array","items":{"type":"string"}}},"required":["name","description","tags"],"additionalProperties":false},"CreateDomainRequest":{"type":"object","properties":{"hostname":{"type":"string","minLength":1,"maxLength":253,"pattern":"^(?=.{1,253}$)(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))+$"}},"required":["hostname"],"additionalProperties":false},"CreateDomainResponse":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/TenantDomain"}},"required":["domain"],"additionalProperties":false},"CreateEngagementRequest":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9][a-z0-9-]*$"},"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":4000}},"required":["slug","name"],"additionalProperties":false},"CreateEvaluatorRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"kind":{"$ref":"#/components/schemas/EvaluatorKind"},"config":{"$ref":"#/components/schemas/EvaluatorConfig"},"isShared":{"type":"boolean"}},"required":["name","kind","config"],"additionalProperties":false},"CreateIntegrationRequest":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/IntegrationKindContract"},"name":{"type":"string","minLength":1,"maxLength":100},"config":{"type":"object","additionalProperties":{}},"events":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEventContract"}},"enabled":{"type":"boolean"}},"required":["kind","name","config","events","enabled"],"additionalProperties":false},"CreateInvitationRequest":{"type":"object","properties":{"email":{"type":"string","minLength":3,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"role":{"$ref":"#/components/schemas/Role"}},"required":["email","role"],"additionalProperties":false},"CreateInvitationResponse":{"type":"object","properties":{"invitation":{"$ref":"#/components/schemas/Invitation"},"acceptUrl":{"type":"string"},"token":{"type":"string"}},"required":["invitation","acceptUrl","token"],"additionalProperties":false},"CreateMilestoneRequest":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":4000},"dueAt":{"type":["string","null"],"format":"date-time"}},"required":["title"],"additionalProperties":false},"CreateProjectRequest":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},"name":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":2000}},"required":["slug","name","description"],"additionalProperties":false},"CreatePromptRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[a-z][a-z0-9-]*$"},"description":{"type":"string","maxLength":2000},"body":{"type":"string","minLength":1,"maxLength":64000},"variablesSchema":{"$ref":"#/components/schemas/PromptVariablesSchema"},"modelCapability":{"type":"string","minLength":1,"maxLength":120},"project":{"type":"string","minLength":1},"notes":{"type":"string","maxLength":2000}},"required":["name","description","body","modelCapability"],"additionalProperties":false},"CreatePromptVersionRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":64000},"variablesSchema":{"$ref":"#/components/schemas/PromptVariablesSchema"},"modelCapability":{"type":"string","minLength":1,"maxLength":120},"notes":{"type":"string","minLength":1,"maxLength":2000},"parentVersionId":{"type":"string","minLength":1}},"required":["body","notes"],"additionalProperties":false},"CreateRunRequest":{"type":"object","properties":{"agentName":{"type":"string","minLength":1},"agentVersion":{"type":"string","minLength":1},"inputs":{},"project":{"type":"string","minLength":1}},"required":["agentName"],"additionalProperties":false,"description":"Body for `POST /v1/runs` — creates a new run."},"CreateRunResponse":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"status":{"$ref":"#/components/schemas/RunStatus"},"startedAt":{"type":"string"}},"required":["id","agentName","agentVersion","status","startedAt"],"additionalProperties":false}},"required":["run"],"additionalProperties":false,"description":"`POST /v1/runs` response — the freshly-created run summary."},"CreateSavedViewRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"surface":{"$ref":"#/components/schemas/SavedViewSurface"},"query":{"type":"object","additionalProperties":{}},"isShared":{"type":"boolean"}},"required":["name","surface","query"],"additionalProperties":false},"CreateShareLinkRequest":{"type":"object","properties":{"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string","minLength":1,"maxLength":256},"expiresInHours":{"type":"integer","minimum":0,"maximum":8760},"password":{"type":"string","minLength":4,"maxLength":128}},"required":["targetKind","targetId"],"additionalProperties":false},"CreateShareLinkResponse":{"type":"object","properties":{"share":{"$ref":"#/components/schemas/ShareLink"}},"required":["share"],"additionalProperties":false},"CreateSuiteRequest":{"type":"object","properties":{"yaml":{"type":"string","minLength":1}},"required":["yaml"],"additionalProperties":false},"CreateSuiteResponse":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"caseCount":{"type":"integer","minimum":0}},"required":["name","version","caseCount"],"additionalProperties":false},"Dashboard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isShared":{"type":"boolean"},"layout":{"type":"array","items":{"$ref":"#/components/schemas/DashboardWidget"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"ownedByMe":{"type":"boolean"}},"required":["id","name","description","isShared","layout","createdAt","updatedAt","ownedByMe"],"additionalProperties":false},"DashboardDataPayload":{"type":"object","properties":{"widgets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/WidgetData"}}},"required":["widgets"],"additionalProperties":false},"DashboardPeriod":{"type":"string","enum":["1h","24h","7d","30d"]},"DashboardWidget":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"kind":{"$ref":"#/components/schemas/DashboardWidgetKind"},"title":{"type":"string","minLength":1,"maxLength":120},"query":{"type":"object","additionalProperties":{}},"layout":{"$ref":"#/components/schemas/WidgetLayout"}},"required":["id","kind","title","query","layout"],"additionalProperties":false},"DashboardWidgetKind":{"type":"string","enum":["timeseries-cost","timeseries-runs","timeseries-latency","pie-models","pie-locality","bar-agents","bar-errors","heatmap-cost-by-hour","heatmap-errors-by-model","kpi-runs-24h","kpi-cost-mtd","kpi-error-rate","kpi-active-agents"]},"Dataset":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"schema":{"$ref":"#/components/schemas/DatasetSchema"},"tags":{"type":"array","items":{"type":"string"}},"exampleCount":{"type":"integer","minimum":0},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","schema","tags","exampleCount","createdAt","updatedAt"],"additionalProperties":false},"DatasetExample":{"type":"object","properties":{"id":{"type":"string"},"datasetId":{"type":"string"},"input":{},"expected":{"oneOf":[{"type":"null"}]},"metadata":{"type":"object","additionalProperties":{}},"label":{"type":["string","null"]},"split":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","datasetId","input","expected","metadata","label","split","createdAt"],"additionalProperties":false},"DatasetSchema":{"type":"object","properties":{"columns":{"type":"array","items":{"$ref":"#/components/schemas/DatasetSchemaColumn"}}},"required":["columns"],"additionalProperties":false},"DatasetSchemaColumn":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","object","array"]},"description":{"type":"string"}},"required":["name","type"],"additionalProperties":false},"DatasetSplit":{"type":"string","enum":["all","train","eval","holdout"]},"DebugRunEvent":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"checkpoint"},"runId":{"type":"string"},"checkpointId":{"type":"string"},"nodePath":{"type":"string"},"at":{"type":"string"},"payload":{}},"required":["kind","runId","checkpointId","nodePath","at","payload"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"message"},"runId":{"type":"string"},"role":{"type":"string","enum":["system","user","assistant","tool"]},"text":{"type":"string"},"at":{"type":"string"}},"required":["kind","runId","role","text","at"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"tool_call"},"runId":{"type":"string"},"callId":{"type":"string"},"tool":{"type":"string"},"args":{},"at":{"type":"string"}},"required":["kind","runId","callId","tool","args","at"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"tool_result"},"runId":{"type":"string"},"callId":{"type":"string"},"result":{},"isError":{"type":"boolean"},"at":{"type":"string"}},"required":["kind","runId","callId","result","at"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"paused"},"runId":{"type":"string"},"reason":{"type":"string"},"checkpointId":{"type":"string"},"at":{"type":"string"}},"required":["kind","runId","reason","checkpointId","at"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"resumed"},"runId":{"type":"string"},"fromCheckpoint":{"type":"string"},"at":{"type":"string"}},"required":["kind","runId","fromCheckpoint","at"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"completed"},"runId":{"type":"string"},"finishReason":{"type":"string","enum":["stop","length","tool_use","error","cancelled"]},"at":{"type":"string"}},"required":["kind","runId","finishReason","at"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"error"},"runId":{"type":"string"},"message":{"type":"string"},"at":{"type":"string"}},"required":["kind","runId","message","at"],"additionalProperties":false}],"discriminator":{"propertyName":"kind"}},"DeleteDomainResponse":{"type":"object","properties":{"hostname":{"type":"string"},"deleted":{"type":"boolean"}},"required":["hostname","deleted"],"additionalProperties":false},"DesignPartnerApplication":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"company":{"type":["string","null"]},"role":{"type":["string","null"]},"repoUrl":{"type":["string","null"]},"useCase":{"type":"string"},"teamSize":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","accepted","declined"]},"reviewedBy":{"type":["string","null"]},"reviewedAt":{"type":["string","null"]},"adminNotes":{"type":["string","null"]}},"required":["id","createdAt","name","email","company","role","repoUrl","useCase","teamSize","status","reviewedBy","reviewedAt","adminNotes"],"additionalProperties":false},"DesignPartnerApplyRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"email":{"type":"string","minLength":1,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"company":{"type":"string","maxLength":120},"role":{"type":"string","enum":["Engineer","Founder","Researcher","Other"]},"repoUrl":{"type":"string","format":"uri","maxLength":500},"useCase":{"type":"string","minLength":50,"maxLength":500},"teamSize":{"type":"string","enum":["1-5","6-20","21-100","100+"]}},"required":["name","email","useCase"],"additionalProperties":false},"DesignPartnerApplyResponse":{"type":"object","properties":{"id":{"type":"string","minLength":1}},"required":["id"],"additionalProperties":false},"EditAndResumeCommand":{"type":"object","properties":{"checkpointId":{"type":"string"},"messageIndex":{"type":"integer","minimum":0},"newText":{"type":"string"}},"required":["checkpointId","messageIndex","newText"],"additionalProperties":false},"Engagement":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"$ref":"#/components/schemas/EngagementStatus"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"archivedAt":{"type":["string","null"]}},"required":["id","tenantId","slug","name","description","status","createdAt","updatedAt","archivedAt"],"additionalProperties":false},"EngagementStatus":{"type":"string","enum":["active","paused","complete","archived"]},"EvalCase":{"type":"object","properties":{"id":{"type":"string"},"input":{},"expect":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"contains"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"not_contains"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"exact"},"value":{"type":"string"}},"required":["kind","value"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"json_schema"},"schema":{}},"required":["kind","schema"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"rubric"},"criterion":{"type":"string"},"judgeCapabilityClass":{"type":"string"}},"required":["kind","criterion","judgeCapabilityClass"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"evaluator"},"evaluatorId":{"type":"string"}},"required":["kind","evaluatorId"],"additionalProperties":false}],"discriminator":{"propertyName":"kind"}},"weight":{"type":"number","minimum":0},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","input","expect","weight","tags"],"additionalProperties":false},"EvalSuite":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"agent":{"type":"string"},"cases":{"type":"array","items":{"$ref":"#/components/schemas/EvalCase"}},"passThreshold":{"type":"number","minimum":0,"maximum":1},"dataset":{"type":"string"}},"required":["name","version","description","agent","cases","passThreshold"],"additionalProperties":false},"Evaluator":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/EvaluatorKind"},"config":{"$ref":"#/components/schemas/EvaluatorConfig"},"isShared":{"type":"boolean"},"ownedByMe":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","kind","config","isShared","createdAt","updatedAt"],"additionalProperties":false},"EvaluatorConfig":{"type":"object","additionalProperties":{}},"EvaluatorKind":{"type":"string","enum":["exact_match","contains","json_schema","llm_judge","regex"]},"FailureCluster":{"type":"object","properties":{"id":{"type":"string"},"sweepId":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer","minimum":0},"examplesSample":{"type":"array","items":{"type":"object","properties":{"caseId":{"type":"string"},"model":{"type":"string"},"output":{"type":"string"}},"required":["caseId","model","output"],"additionalProperties":false}},"topTerms":{"type":"array","items":{"type":"string"}},"sampleRunIds":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"}},"required":["id","sweepId","label","count","examplesSample","topTerms","sampleRunIds","createdAt"],"additionalProperties":false},"GalleryForkRequest":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9-]*$"},"projectSlug":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"pattern":"^[a-z][a-z0-9-]*$"}},"required":["templateId"],"additionalProperties":false},"GalleryForkResponse":{"type":"object","properties":{"agentName":{"type":"string"},"version":{"type":"string"},"projectId":{"type":"string"},"projectSlug":{"type":"string"}},"required":["agentName","version","projectId","projectSlug"],"additionalProperties":false},"GetAgentResponse":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/AgentDetail"}},"required":["agent"],"additionalProperties":false},"GetEngagementResponse":{"type":"object","properties":{"engagement":{"$ref":"#/components/schemas/Engagement"}},"required":["engagement"],"additionalProperties":false},"GetMyQuotaResponse":{"type":"object","properties":{"quota":{"$ref":"#/components/schemas/QuotaSnapshot"}},"required":["quota"],"additionalProperties":false},"GetPlaygroundRunResponse":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/PlaygroundRun"}},"required":["run"],"additionalProperties":false},"GetPromptResponse":{"type":"object","properties":{"prompt":{"$ref":"#/components/schemas/PromptDetail"}},"required":["prompt"],"additionalProperties":false},"GetPromptVersionResponse":{"type":"object","properties":{"version":{"$ref":"#/components/schemas/PromptVersion"}},"required":["version"],"additionalProperties":false},"GetRunResponse":{"type":"object","properties":{"run":{"$ref":"#/components/schemas/RunDetail"}},"required":["run"],"additionalProperties":false},"GetRunTreeResponse":{"type":"object","properties":{"tree":{"$ref":"#/components/schemas/RunTreeNode"}},"required":["tree"],"additionalProperties":false},"GetSubscriptionResponse":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/Subscription"}},"required":["subscription"],"additionalProperties":false},"GetThreadResponse":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/Thread"},"runs":{"type":"array","items":{"$ref":"#/components/schemas/RunSummary"}}},"required":["thread","runs"],"additionalProperties":false},"GetThreadTimelineResponse":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/Thread"},"events":{"type":"array","items":{"$ref":"#/components/schemas/ThreadTimelineEvent"}}},"required":["thread","events"],"additionalProperties":false},"GuardSeverityWire":{"type":"string","enum":["info","warn","error","critical"]},"HeatmapCell":{"type":"object","properties":{"x":{"type":"integer"},"y":{"type":"string"},"value":{"type":"number"}},"required":["x","y","value"],"additionalProperties":false},"HeatmapData":{"type":"object","properties":{"shape":{"type":"string","const":"heatmap"},"xLabels":{"type":"array","items":{"type":"string"}},"yLabels":{"type":"array","items":{"type":"string"}},"cells":{"type":"array","items":{"$ref":"#/components/schemas/HeatmapCell"}},"min":{"type":"number"},"max":{"type":"number"}},"required":["shape","xLabels","yLabels","cells","min","max"],"additionalProperties":false},"HeatmapMetric":{"type":"string","enum":["cost","errors","runs","latency-p95"]},"HeatmapXAxis":{"type":"string","enum":["hour-of-day","day-of-week"]},"HeatmapYAxis":{"type":"string","enum":["model","agent","capability","locality"]},"IntegrationContract":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/IntegrationKindContract"},"name":{"type":"string"},"config":{"type":"object","additionalProperties":{}},"events":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEventContract"}},"enabled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"lastFiredAt":{"type":["string","null"]}},"required":["id","kind","name","config","events","enabled","createdAt","updatedAt","lastFiredAt"],"additionalProperties":false},"IntegrationEventContract":{"type":"string","enum":["run_completed","run_failed","sweep_completed","guards_blocked","budget_threshold","invitation_received","approval_requested"]},"IntegrationKindContract":{"type":"string","enum":["slack","github","webhook","discord","telegram","email"]},"IntegrationResponse":{"type":"object","properties":{"integration":{"$ref":"#/components/schemas/IntegrationContract"}},"required":["integration"],"additionalProperties":false},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"$ref":"#/components/schemas/Role"},"invitedBy":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"acceptedAt":{"type":["string","null"]},"acceptedBy":{"type":["string","null"]},"revokedAt":{"type":["string","null"]}},"required":["id","email","role","invitedBy","createdAt","expiresAt","acceptedAt","acceptedBy","revokedAt"],"additionalProperties":false},"IterationSummaryStrategyWire":{"type":"string","enum":["rolling-window","periodic-summary"],"description":"rolling-window | periodic-summary — picks how `IterativeAgentRun` compresses history when token utilisation crosses 80% of `contextWindow`."},"IterationTerminationConditionWire":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"text-includes"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"tool-result"},"tool":{"type":"string","minLength":1},"match":{"type":"object","properties":{"exitCode":{"type":"integer"},"contains":{"type":"string","minLength":1}},"additionalProperties":false}},"required":["kind","tool","match"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"budget-exhausted"}},"required":["kind"],"additionalProperties":false}],"discriminator":{"propertyName":"kind"},"description":"Discriminated union of declarative termination matchers — text-includes | tool-result | budget-exhausted. The loop fires the FIRST match in spec order."},"IterationWire":{"type":"object","properties":{"maxCycles":{"type":"integer","minimum":0},"contextWindow":{"type":"integer","minimum":0},"summaryStrategy":{"$ref":"#/components/schemas/IterationSummaryStrategyWire"},"terminationConditions":{"type":"array","items":{"$ref":"#/components/schemas/IterationTerminationConditionWire"}}},"required":["maxCycles","contextWindow","summaryStrategy","terminationConditions"],"additionalProperties":false,"description":"Wave-Iter — leaf-loop iteration block on an agent spec. Distinct from `composite.iteration` (multi-agent supervisor); this one drives `IterativeAgentRun`."},"KpiData":{"type":"object","properties":{"shape":{"type":"string","const":"kpi"},"value":{"type":"number"},"delta":{"type":["number","null"]},"unit":{"type":"string"}},"required":["shape","value","delta"],"additionalProperties":false},"ListActivityQuery":{"type":"object","properties":{"actorUserId":{"type":"string"},"verb":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"},"cursor":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":200}},"required":["limit"],"additionalProperties":false},"ListActivityResponse":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/ActivityEvent"}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["events","nextCursor","hasMore"],"additionalProperties":false},"ListAgentVersionsResponse":{"type":"object","properties":{"name":{"type":"string"},"current":{"type":["string","null"]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersionEntry"}}},"required":["name","current","versions"],"additionalProperties":false},"ListAgentsQuery":{"type":"object","properties":{"cursor":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":200},"team":{"type":"string"},"owner":{"type":"string"},"project":{"type":"string","minLength":1}},"required":["limit"],"additionalProperties":false},"ListAgentsResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/AgentSummary"}},"meta":{"$ref":"#/components/schemas/PaginatedMeta"}},"required":["agents","meta"],"additionalProperties":false,"description":"Paginated list of agents."},"ListAlertEventsResponse":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AlertEvent"}}},"required":["events"],"additionalProperties":false},"ListAlertRulesResponse":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/components/schemas/AlertRule"}}},"required":["rules"],"additionalProperties":false},"ListAnnotationsQuery":{"type":"object","properties":{"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string","minLength":1}},"required":["targetKind","targetId"],"additionalProperties":false},"ListAnnotationsResponse":{"type":"object","properties":{"annotations":{"type":"array","items":{"$ref":"#/components/schemas/Annotation"}}},"required":["annotations"],"additionalProperties":false},"ListApiKeysResponse":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}},"required":["keys"],"additionalProperties":false},"ListAuditLogQuery":{"type":"object","properties":{"verb":{"type":"string"},"objectKind":{"type":"string"},"actorUserId":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"},"limit":{"type":"integer","minimum":0,"maximum":200},"cursor":{"type":"string"}},"required":["limit"],"additionalProperties":false},"ListAuditLogResponse":{"type":"object","properties":{"entries":{"type":"array","items":{"$ref":"#/components/schemas/AuditLogEntry"}},"meta":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false}},"required":["entries","meta"],"additionalProperties":false},"ListBreakpointsResponse":{"type":"object","properties":{"breakpoints":{"type":"array","items":{"$ref":"#/components/schemas/Breakpoint"}}},"required":["breakpoints"],"additionalProperties":false},"ListCommentsResponse":{"type":"object","properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}}},"required":["comments"],"additionalProperties":false},"ListDashboardsResponse":{"type":"object","properties":{"dashboards":{"type":"array","items":{"$ref":"#/components/schemas/Dashboard"}}},"required":["dashboards"],"additionalProperties":false},"ListDatasetExamplesResponse":{"type":"object","properties":{"examples":{"type":"array","items":{"$ref":"#/components/schemas/DatasetExample"}},"nextCursor":{"type":["string","null"]}},"required":["examples","nextCursor"],"additionalProperties":false},"ListDatasetsResponse":{"type":"object","properties":{"datasets":{"type":"array","items":{"$ref":"#/components/schemas/Dataset"}}},"required":["datasets"],"additionalProperties":false},"ListDesignPartnerApplicationsResponse":{"type":"object","properties":{"applications":{"type":"array","items":{"$ref":"#/components/schemas/DesignPartnerApplication"}}},"required":["applications"],"additionalProperties":false},"ListDomainsResponse":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/TenantDomain"}}},"required":["domains"],"additionalProperties":false},"ListEngagementsResponse":{"type":"object","properties":{"engagements":{"type":"array","items":{"$ref":"#/components/schemas/Engagement"}}},"required":["engagements"],"additionalProperties":false},"ListEvaluatorsResponse":{"type":"object","properties":{"evaluators":{"type":"array","items":{"$ref":"#/components/schemas/Evaluator"}}},"required":["evaluators"],"additionalProperties":false},"ListFailureClustersResponse":{"type":"object","properties":{"clusters":{"type":"array","items":{"$ref":"#/components/schemas/FailureCluster"}}},"required":["clusters"],"additionalProperties":false},"ListIntegrationsResponse":{"type":"object","properties":{"integrations":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationContract"}}},"required":["integrations"],"additionalProperties":false},"ListInvitationsResponse":{"type":"object","properties":{"invitations":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}}},"required":["invitations"],"additionalProperties":false},"ListMembersResponse":{"type":"object","properties":{"members":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}},"required":["members"],"additionalProperties":false},"ListMilestonesResponse":{"type":"object","properties":{"milestones":{"type":"array","items":{"$ref":"#/components/schemas/Milestone"}}},"required":["milestones"],"additionalProperties":false},"ListModelsResponse":{"type":"object","properties":{"models":{"type":"array","items":{"$ref":"#/components/schemas/ModelSummary"}}},"required":["models"],"additionalProperties":false},"ListNotificationsQuery":{"type":"object","properties":{"unreadOnly":{"type":"boolean"},"kind":{"$ref":"#/components/schemas/NotificationKind"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["limit"],"additionalProperties":false},"ListNotificationsResponse":{"type":"object","properties":{"notifications":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"unreadCount":{"type":"integer","minimum":0}},"required":["notifications","unreadCount"],"additionalProperties":false},"ListPendingApprovalsResponse":{"type":"object","properties":{"approvals":{"type":"array","items":{"$ref":"#/components/schemas/PendingApprovalWire"}}},"required":["approvals"],"additionalProperties":false,"description":"Body of `GET /v1/runs/:id/approvals` — every pending approval for the run, in request order."},"ListProjectsResponse":{"type":"object","properties":{"projects":{"type":"array","items":{"$ref":"#/components/schemas/Project"}}},"required":["projects"],"additionalProperties":false},"ListPromptVersionsResponse":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/PromptVersion"}}},"required":["versions"],"additionalProperties":false},"ListPromptsResponse":{"type":"object","properties":{"prompts":{"type":"array","items":{"$ref":"#/components/schemas/Prompt"}}},"required":["prompts"],"additionalProperties":false},"ListRunsQuery":{"type":"object","properties":{"cursor":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":200},"agentName":{"type":"string"},"status":{"$ref":"#/components/schemas/RunStatus"},"project":{"type":"string","minLength":1}},"required":["limit"],"additionalProperties":false},"ListRunsResponse":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/RunSummary"}},"meta":{"$ref":"#/components/schemas/PaginatedMeta"}},"required":["runs","meta"],"additionalProperties":false,"description":"Paginated list of runs."},"ListSavedViewsQuery":{"type":"object","properties":{"surface":{"$ref":"#/components/schemas/SavedViewSurface"}},"required":["surface"],"additionalProperties":false},"ListSavedViewsResponse":{"type":"object","properties":{"views":{"type":"array","items":{"$ref":"#/components/schemas/SavedView"}}},"required":["views"],"additionalProperties":false},"ListSecretsResponse":{"type":"object","properties":{"secrets":{"type":"array","items":{"$ref":"#/components/schemas/SetSecretResponse"}}},"required":["secrets"],"additionalProperties":false},"ListShareLinksQuery":{"type":"object","properties":{"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string"}},"additionalProperties":false},"ListShareLinksResponse":{"type":"object","properties":{"shares":{"type":"array","items":{"$ref":"#/components/schemas/ShareLink"}}},"required":["shares"],"additionalProperties":false},"ListSuitesResponse":{"type":"object","properties":{"suites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":"string"},"agent":{"type":"string"},"caseCount":{"type":"integer","minimum":0}},"required":["name","version","description","agent","caseCount"],"additionalProperties":false}}},"required":["suites"],"additionalProperties":false},"ListSweepsResponse":{"type":"object","properties":{"sweeps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"suiteName":{"type":"string"},"suiteVersion":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"status":{"$ref":"#/components/schemas/SweepStatus"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"modelCount":{"type":"integer","minimum":0},"caseCount":{"type":"integer","minimum":0}},"required":["id","suiteName","suiteVersion","agentName","agentVersion","status","startedAt","endedAt","modelCount","caseCount"],"additionalProperties":false}}},"required":["sweeps"],"additionalProperties":false},"ListThreadsQuery":{"type":"object","properties":{"project":{"type":"string","minLength":1},"limit":{"type":"integer","minimum":0,"maximum":200},"cursor":{"type":"string"}},"required":["limit"],"additionalProperties":false},"ListThreadsResponse":{"type":"object","properties":{"threads":{"type":"array","items":{"$ref":"#/components/schemas/Thread"}},"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["threads","nextCursor","hasMore"],"additionalProperties":false},"LocalityBreakdown":{"type":"object","properties":{"locality":{"type":"string"},"usd":{"type":"number","minimum":0},"runCount":{"type":"integer","minimum":0}},"required":["locality","usd","runCount"],"additionalProperties":false},"LoginRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1}},"required":["email","password"],"additionalProperties":false},"MarkAllNotificationsReadResponse":{"type":"object","properties":{"markedCount":{"type":"integer","minimum":0}},"required":["markedCount"],"additionalProperties":false},"MarkNotificationReadResponse":{"type":"object","properties":{"notification":{"$ref":"#/components/schemas/Notification"}},"required":["notification"],"additionalProperties":false},"Member":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"role":{"$ref":"#/components/schemas/Role"},"joinedAt":{"type":"string"}},"required":["userId","email","role","joinedAt"],"additionalProperties":false},"Milestone":{"type":"object","properties":{"id":{"type":"string"},"engagementId":{"type":"string"},"tenantId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"status":{"$ref":"#/components/schemas/MilestoneStatus"},"dueAt":{"type":["string","null"]},"signedOffBy":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"rejectedReason":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","engagementId","tenantId","title","description","status","dueAt","signedOffBy","signedOffAt","rejectedReason","createdAt","updatedAt"],"additionalProperties":false},"MilestoneResponse":{"type":"object","properties":{"milestone":{"$ref":"#/components/schemas/Milestone"}},"required":["milestone"],"additionalProperties":false},"MilestoneStatus":{"type":"string","enum":["pending","in_review","signed_off","rejected"]},"ModelBreakdown":{"type":"object","properties":{"model":{"type":"string"},"provider":{"type":"string"},"locality":{"type":"string"},"agentName":{"type":"string"},"runCount":{"type":"integer","minimum":0},"usd":{"type":"number","minimum":0}},"required":["model","provider","locality","agentName","runCount","usd"],"additionalProperties":false},"ModelSummary":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"locality":{"type":"string"},"capabilityClass":{"type":"string"},"provides":{"type":"array","items":{"type":"string"}},"privacyAllowed":{"type":"array","items":{"$ref":"#/components/schemas/PrivacyTier"}},"cost":{"type":"object","properties":{"usdPerMtokIn":{"type":"number","minimum":0},"usdPerMtokOut":{"type":"number","minimum":0}},"required":["usdPerMtokIn","usdPerMtokOut"],"additionalProperties":false},"latencyP95Ms":{"type":"integer","minimum":0},"effectiveContextTokens":{"type":"integer","minimum":0},"available":{"type":"boolean"},"lastProbedAt":{"type":"string"}},"required":["id","provider","locality","capabilityClass","provides","privacyAllowed","cost","effectiveContextTokens","available"],"additionalProperties":false},"NewsletterSubscribeRequest":{"type":"object","properties":{"email":{"type":"string","minLength":1,"maxLength":254,"pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"},"source":{"type":"string","enum":["marketing-home","marketing-changelog","docs-sidebar","pricing-footer"]}},"required":["email"],"additionalProperties":false},"NewsletterSubscribeResponse":{"type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false},"Notification":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/NotificationKind"},"title":{"type":"string"},"body":{"type":"string"},"link":{"type":["string","null"]},"metadata":{"type":"object","additionalProperties":{}},"createdAt":{"type":"string"},"readAt":{"type":["string","null"]}},"required":["id","userId","kind","title","body","link","metadata","createdAt","readAt"],"additionalProperties":false},"NotificationChannel":{"type":"string","minLength":1,"maxLength":2048},"NotificationKind":{"type":"string","enum":["run_completed","run_failed","sweep_completed","guards_blocked","invitation_received","budget_threshold","comment_mention","quota_exceeded"]},"ObservabilityPeriod":{"type":"string","enum":["24h","7d","30d"]},"ObservabilityQuery":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/ObservabilityPeriod"}},"required":["period"],"additionalProperties":false},"ObservabilitySummary":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/ObservabilityPeriod"},"generatedAt":{"type":"string"},"kpis":{"type":"object","properties":{"eventsPerSec":{"type":"number","minimum":0},"runsInFlight":{"type":"integer","minimum":0},"cloudSpendUsd":{"type":"number","minimum":0},"localSpendUsd":{"type":"number","minimum":0},"sandboxBlocks24h":{"type":"integer","minimum":0},"guardsBlocks24h":{"type":"integer","minimum":0},"privacyTierMismatches24h":{"type":"integer","minimum":0}},"required":["eventsPerSec","runsInFlight","cloudSpendUsd","localSpendUsd","sandboxBlocks24h","guardsBlocks24h","privacyTierMismatches24h"],"additionalProperties":false},"privacyRouterEvents":{"type":"array","items":{"$ref":"#/components/schemas/PrivacyRouterEvent"}},"safetyEvents":{"type":"array","items":{"$ref":"#/components/schemas/SafetyEvent"}},"localityBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/LocalityBreakdown"}},"modelBreakdown":{"type":"array","items":{"$ref":"#/components/schemas/ModelBreakdown"}}},"required":["period","generatedAt","kpis","privacyRouterEvents","safetyEvents","localityBreakdown","modelBreakdown"],"additionalProperties":false},"PaginatedMeta":{"type":"object","properties":{"nextCursor":{"type":["string","null"]},"hasMore":{"type":"boolean"}},"required":["nextCursor","hasMore"],"additionalProperties":false,"description":"Cursor-paginated list metadata."},"PaginationQuery":{"type":"object","properties":{"cursor":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":200}},"required":["limit"],"additionalProperties":false,"description":"Cursor + limit query parameters for paginated lists."},"PendingApprovalWire":{"type":"object","properties":{"runId":{"type":"string"},"callId":{"type":"string"},"tool":{"type":"string"},"args":{},"reason":{"type":["string","null"]}},"required":["runId","callId","tool","args","reason"],"additionalProperties":false,"description":"A pending approval surfaced when an iterative agent's tool call hits a `tools.approvals: always` rule. The engine pauses until the approver POSTs `/v1/runs/:id/approve` or `/reject`."},"PieData":{"type":"object","properties":{"shape":{"type":"string","const":"pie"},"slices":{"type":"array","items":{"$ref":"#/components/schemas/PieSlice"}}},"required":["shape","slices"],"additionalProperties":false},"PieSlice":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"}},"required":["label","value"],"additionalProperties":false},"Plan":{"type":"string","enum":["trial","solo","team","enterprise","cancelled"]},"PlaygroundAggregate":{"type":"object","properties":{"scored":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":0},"passed":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0},"passRate":{"type":"number","minimum":0,"maximum":1},"meanScore":{"type":"number","minimum":0,"maximum":1},"p50Score":{"type":"number","minimum":0,"maximum":1},"p95Score":{"type":"number","minimum":0,"maximum":1},"minScore":{"type":"number","minimum":0,"maximum":1},"maxScore":{"type":"number","minimum":0,"maximum":1},"meanDurationMs":{"type":"number","minimum":0},"totalCostUsd":{"type":"number","minimum":0}},"required":["scored","total","passed","failed","passRate","meanScore","p50Score","p95Score","minScore","maxScore","meanDurationMs","totalCostUsd"],"additionalProperties":false},"PlaygroundFrame":{"type":"object","properties":{"modelId":{"type":"string"},"type":{"$ref":"#/components/schemas/PlaygroundFrameType"},"payload":{}},"required":["modelId","type","payload"],"additionalProperties":false},"PlaygroundFrameType":{"type":"string","enum":["start","delta","usage","error","done"]},"PlaygroundMessage":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}},"required":["role","content"],"additionalProperties":false},"PlaygroundRun":{"type":"object","properties":{"id":{"type":"string"},"evaluatorId":{"type":"string"},"evaluatorName":{"type":"string"},"evaluatorKind":{"type":"string"},"datasetId":{"type":"string"},"datasetName":{"type":"string"},"sampleSize":{"type":"integer","minimum":0},"status":{"$ref":"#/components/schemas/PlaygroundRunStatus"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"errorMessage":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/PlaygroundScoredRow"}},"aggregate":{"$ref":"#/components/schemas/PlaygroundAggregate"}},"required":["id","evaluatorId","evaluatorName","evaluatorKind","datasetId","datasetName","sampleSize","status","startedAt","endedAt","rows","aggregate"],"additionalProperties":false},"PlaygroundRunRequest":{"type":"object","properties":{"system":{"type":"string"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/PlaygroundMessage"}},"capabilityClass":{"type":"string","minLength":1},"privacy":{"$ref":"#/components/schemas/PrivacyTier"},"models":{"type":"array","items":{"type":"string"}},"stream":{"type":"boolean","const":true},"maxTokensOut":{"type":"integer","minimum":1,"maximum":8192}},"required":["messages","capabilityClass","privacy"],"additionalProperties":false},"PlaygroundRunStatus":{"type":"string","enum":["running","completed","failed","cancelled"]},"PlaygroundScoredRow":{"type":"object","properties":{"exampleId":{"type":"string"},"inputPreview":{"type":"string"},"expectedPreview":{"type":"string"},"output":{"type":"string"},"passed":{"type":"boolean"},"score":{"type":"number","minimum":0,"maximum":1},"detail":{},"durationMs":{"type":"integer","minimum":0},"costUsd":{"type":"number","minimum":0}},"required":["exampleId","inputPreview","expectedPreview","output","passed","score","durationMs","costUsd"],"additionalProperties":false},"PopularTag":{"type":"object","properties":{"tag":{"type":"string"},"count":{"type":"integer","minimum":0}},"required":["tag","count"],"additionalProperties":false},"PopularTagsResponse":{"type":"object","properties":{"tags":{"type":"array","items":{"$ref":"#/components/schemas/PopularTag"}}},"required":["tags"],"additionalProperties":false},"PortalRequest":{"type":"object","properties":{"returnTo":{"type":"string","minLength":1}},"additionalProperties":false},"PortalResponse":{"type":"object","properties":{"url":{"type":"string","minLength":1}},"required":["url"],"additionalProperties":false},"PrivacyRouterEvent":{"type":"object","properties":{"at":{"type":"string"},"runId":{"type":"string"},"agentName":{"type":"string"},"model":{"type":"string"},"provider":{"type":"string"},"classUsed":{"type":"string"},"enforced":{"type":"boolean"}},"required":["at","runId","agentName","model","provider","classUsed","enforced"],"additionalProperties":false},"PrivacyTier":{"type":"string","enum":["public","internal","sensitive"],"description":"Privacy tier enforced platform-side. `sensitive` agents may only reach local-only models."},"Project":{"type":"object","properties":{"id":{"type":"string"},"tenantId":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","tenantId","slug","name","description","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"ProjectEnvelope":{"type":"object","properties":{"project":{"$ref":"#/components/schemas/Project"}},"required":["project"],"additionalProperties":false},"PromoteAgentRequest":{"type":"object","properties":{"agentName":{"type":"string"},"version":{"type":"string"},"models":{"type":"array","items":{"type":"string"}}},"required":["agentName","version","models"],"additionalProperties":false},"PromoteAgentResponse":{"type":"object","properties":{"promoted":{"type":"boolean"},"sweepIds":{"type":"array","items":{"type":"string"}},"failedSuites":{"type":"array","items":{"type":"string"}}},"required":["promoted","sweepIds","failedSuites"],"additionalProperties":false},"PromoteRegisteredAgentRequest":{"type":"object","properties":{"version":{"type":"string","minLength":1}},"required":["version"],"additionalProperties":false},"PromoteRegisteredAgentResponse":{"type":"object","properties":{"name":{"type":"string"},"current":{"type":"string"}},"required":["name","current"],"additionalProperties":false},"Prompt":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"projectId":{"type":["string","null"]},"latestVersion":{"type":"integer","minimum":0},"modelCapability":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","latestVersion","modelCapability","createdBy","createdAt","updatedAt"],"additionalProperties":false},"PromptDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"projectId":{"type":["string","null"]},"latestVersion":{"type":"integer","minimum":0},"modelCapability":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"latest":{"oneOf":[{"$ref":"#/components/schemas/PromptVersion"},{"type":"null"}]}},"required":["id","name","description","latestVersion","modelCapability","createdBy","createdAt","updatedAt","latest"],"additionalProperties":false},"PromptDiffLine":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/PromptDiffLineKind"},"text":{"type":"string"}},"required":["kind","text"],"additionalProperties":false},"PromptDiffLineKind":{"type":"string","enum":["added","removed","unchanged"]},"PromptDiffResponse":{"type":"object","properties":{"fromVersion":{"type":"integer","minimum":0},"toVersion":{"type":"integer","minimum":0},"lines":{"type":"array","items":{"$ref":"#/components/schemas/PromptDiffLine"}},"stats":{"type":"object","properties":{"added":{"type":"integer","minimum":0},"removed":{"type":"integer","minimum":0},"unchanged":{"type":"integer","minimum":0}},"required":["added","removed","unchanged"],"additionalProperties":false}},"required":["fromVersion","toVersion","lines","stats"],"additionalProperties":false},"PromptRefWire":{"type":"object","properties":{"id":{"type":"string","minLength":1},"version":{"type":"integer","minimum":0}},"required":["id","version"],"additionalProperties":false},"PromptTestRequest":{"type":"object","properties":{"variables":{"type":"object","additionalProperties":{}},"capabilityOverride":{"type":"string","minLength":1,"maxLength":120},"version":{"type":"integer","minimum":0}},"required":["variables"],"additionalProperties":false},"PromptTestResponse":{"type":"object","properties":{"version":{"type":"integer","minimum":0},"resolvedBody":{"type":"string"},"output":{"type":"string"},"model":{"type":"string"},"capabilityUsed":{"type":"string"},"tokensIn":{"type":"integer","minimum":0},"tokensOut":{"type":"integer","minimum":0},"costUsd":{"type":"number","minimum":0},"latencyMs":{"type":"integer","minimum":0}},"required":["version","resolvedBody","output","model","capabilityUsed","tokensIn","tokensOut","costUsd","latencyMs"],"additionalProperties":false},"PromptVariable":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z_][a-zA-Z0-9_]*$"},"type":{"$ref":"#/components/schemas/PromptVariableType"},"description":{"type":"string","maxLength":500},"required":{"type":"boolean"}},"required":["name","type","required"],"additionalProperties":false},"PromptVariableType":{"type":"string","enum":["string","number","boolean","object","array"]},"PromptVariablesSchema":{"type":"object","properties":{"variables":{"type":"array","items":{"$ref":"#/components/schemas/PromptVariable"}}},"required":["variables"],"additionalProperties":false},"PromptVersion":{"type":"object","properties":{"id":{"type":"string"},"promptId":{"type":"string"},"version":{"type":"integer","minimum":0},"body":{"type":"string"},"variablesSchema":{"$ref":"#/components/schemas/PromptVariablesSchema"},"modelCapability":{"type":"string"},"parentVersionId":{"type":["string","null"]},"notes":{"type":"string"},"createdBy":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","promptId","version","body","variablesSchema","modelCapability","parentVersionId","notes","createdBy","createdAt"],"additionalProperties":false},"PublicShareLockedResponse":{"type":"object","properties":{"locked":{"type":"boolean","const":true},"reason":{"type":"string","enum":["password_required","password_invalid","rate_limited"]}},"required":["locked","reason"],"additionalProperties":false},"PublicShareResponse":{"type":"object","properties":{"share":{"type":"object","properties":{"slug":{"type":"string"},"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["slug","targetKind","targetId","expiresAt","createdAt"],"additionalProperties":false},"resource":{"$ref":"#/components/schemas/PublicSharedResource"}},"required":["share","resource"],"additionalProperties":false},"PublicSharedAgent":{"type":"object","properties":{"kind":{"type":"string","const":"agent"},"agent":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"description":{"type":["string","null"]},"specYaml":{"type":"string"}},"required":["name","version","description","specYaml"],"additionalProperties":false}},"required":["kind","agent"],"additionalProperties":false},"PublicSharedResource":{"oneOf":[{"$ref":"#/components/schemas/PublicSharedRun"},{"$ref":"#/components/schemas/PublicSharedSweep"},{"$ref":"#/components/schemas/PublicSharedAgent"}],"discriminator":{"propertyName":"kind"}},"PublicSharedRun":{"type":"object","properties":{"kind":{"type":"string","const":"run"},"run":{"type":"object","properties":{"id":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"status":{"type":"string"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"totalUsd":{"type":"number"},"finalOutput":{"oneOf":[{"type":"null"}]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"at":{"type":"string"},"payload":{}},"required":["id","type","at","payload"],"additionalProperties":false}}},"required":["id","agentName","agentVersion","status","startedAt","endedAt","totalUsd","finalOutput","events"],"additionalProperties":false}},"required":["kind","run"],"additionalProperties":false},"PublicSharedSweep":{"type":"object","properties":{"kind":{"type":"string","const":"sweep"},"sweep":{"type":"object","properties":{"id":{"type":"string"},"agentName":{"type":["string","null"]},"status":{"type":"string"},"createdAt":{"type":"string"},"matrix":{},"summary":{}},"required":["id","agentName","status","createdAt","matrix","summary"],"additionalProperties":false}},"required":["kind","sweep"],"additionalProperties":false},"QuotaSnapshot":{"type":"object","properties":{"plan":{"type":"string"},"monthlyRunsMax":{"type":["integer","null"]},"monthlyRunsUsed":{"type":"integer","minimum":0},"monthlyCostUsdMax":{"type":["number","null"]},"monthlyCostUsdUsed":{"type":"number","minimum":0},"resetAt":{"type":"string"}},"required":["plan","monthlyRunsMax","monthlyRunsUsed","monthlyCostUsdMax","monthlyCostUsdUsed","resetAt"],"additionalProperties":false},"RegisterAgentJsonRequest":{"type":"object","properties":{"specYaml":{"type":"string","minLength":1},"project":{"type":"string","minLength":1}},"required":["specYaml"],"additionalProperties":false},"RegisterAgentResponse":{"type":"object","properties":{"agent":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"promoted":{"type":"boolean"}},"required":["name","version","promoted"],"additionalProperties":false}},"required":["agent"],"additionalProperties":false},"RejectMilestoneRequest":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["reason"],"additionalProperties":false},"RejectRunRequest":{"type":"object","properties":{"callId":{"type":"string","minLength":1},"reason":{"type":"string","minLength":1}},"required":["callId","reason"],"additionalProperties":false,"description":"Body for `POST /v1/runs/:id/reject` — resolves the pending approval as rejected. `reason` is REQUIRED so operators justify the denial."},"ReplaceRunTagsRequest":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}}},"required":["tags"],"additionalProperties":false},"Role":{"type":"string","enum":["owner","admin","member","viewer"]},"RoutingChosenWire":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"locality":{"type":"string","enum":["cloud","on-prem","local"]},"classUsed":{"type":"string"},"estimatedUsd":{"type":"number","minimum":0}},"required":["id","provider","locality","classUsed","estimatedUsd"],"additionalProperties":false},"RoutingClassTraceWire":{"type":"object","properties":{"capabilityClass":{"type":"string"},"preFilter":{"type":"integer","minimum":0},"passCapability":{"type":"integer","minimum":0},"passPrivacy":{"type":"integer","minimum":0},"passBudget":{"type":"integer","minimum":0},"chosen":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["capabilityClass","preFilter","passCapability","passPrivacy","passBudget","chosen","reason"],"additionalProperties":false},"RunAnnotationCounts":{"type":"object","properties":{"thumbsUp":{"type":"integer","minimum":0},"thumbsDown":{"type":"integer","minimum":0},"comments":{"type":"integer","minimum":0}},"required":["thumbsUp","thumbsDown","comments"],"additionalProperties":false},"RunCompareDiff":{"type":"object","properties":{"eventCountDiff":{"type":"integer","minimum":0},"modelChanged":{"type":"boolean"},"costDiff":{"type":"number"},"durationDiff":{"type":["integer","null"]},"sameAgent":{"type":"boolean"}},"required":["eventCountDiff","modelChanged","costDiff","durationDiff","sameAgent"],"additionalProperties":false},"RunCompareQuery":{"type":"object","properties":{"a":{"type":"string","minLength":1},"b":{"type":"string","minLength":1}},"required":["a","b"],"additionalProperties":false},"RunCompareResponse":{"type":"object","properties":{"a":{"$ref":"#/components/schemas/RunDetail"},"b":{"$ref":"#/components/schemas/RunDetail"},"diff":{"$ref":"#/components/schemas/RunCompareDiff"}},"required":["a","b","diff"],"additionalProperties":false},"RunCompareSide":{"type":"object","properties":{"id":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"parentRunId":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/RunStatus"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"durationMs":{"type":["integer","null"]},"totalUsd":{"type":"number","minimum":0},"lastProvider":{"type":["string","null"]},"lastModel":{"type":["string","null"]},"hasChildren":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"archivedAt":{"type":["string","null"]},"projectId":{"type":["string","null"]},"threadId":{"type":["string","null"]},"annotationCounts":{"type":"object","properties":{"thumbsUp":{"type":"integer","minimum":0},"thumbsDown":{"type":"integer","minimum":0},"comments":{"type":"integer","minimum":0}},"required":["thumbsUp","thumbsDown","comments"],"additionalProperties":false},"events":{"type":"array","items":{"$ref":"#/components/schemas/RunEvent"}},"usage":{"type":"array","items":{"$ref":"#/components/schemas/UsageRow"}}},"required":["id","agentName","agentVersion","parentRunId","status","startedAt","endedAt","durationMs","totalUsd","lastProvider","lastModel","events","usage"],"additionalProperties":false},"RunDetail":{"type":"object","properties":{"id":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"parentRunId":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/RunStatus"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"durationMs":{"type":["integer","null"]},"totalUsd":{"type":"number","minimum":0},"lastProvider":{"type":["string","null"]},"lastModel":{"type":["string","null"]},"hasChildren":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"archivedAt":{"type":["string","null"]},"projectId":{"type":["string","null"]},"threadId":{"type":["string","null"]},"annotationCounts":{"type":"object","properties":{"thumbsUp":{"type":"integer","minimum":0},"thumbsDown":{"type":"integer","minimum":0},"comments":{"type":"integer","minimum":0}},"required":["thumbsUp","thumbsDown","comments"],"additionalProperties":false},"events":{"type":"array","items":{"$ref":"#/components/schemas/RunEvent"}},"usage":{"type":"array","items":{"$ref":"#/components/schemas/UsageRow"}}},"required":["id","agentName","agentVersion","parentRunId","status","startedAt","endedAt","durationMs","totalUsd","lastProvider","lastModel","events","usage"],"additionalProperties":false,"description":"Full run record (events + usage timeline)."},"RunEvent":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["run.started","message","tool_call","tool_result","checkpoint","policy_decision","error","run.completed","run.cancelled","routing.privacy_sensitive_resolved","composite.child_started","composite.child_completed","composite.child_failed","composite.usage_rollup","composite.iteration","usage","run.terminated_by","tool.schema_fallback","tool.schema_introspection_failed","cycle.start","model.response","tool.results","history.compressed","tool.pending_approval","tool.approval_resolved"]},"at":{"type":"string"},"payload":{}},"required":["id","type","at","payload"],"additionalProperties":false,"description":"A single timeline event in a run (message, tool call, etc.)."},"RunSearchRequest":{"type":"object","properties":{"q":{"type":"string"},"status":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"agent":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"model":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cost_gte":{"type":"number","minimum":0},"cost_lte":{"type":"number","minimum":0},"duration_gte":{"type":"integer","minimum":0},"duration_lte":{"type":"integer","minimum":0},"started_after":{"type":"string"},"started_before":{"type":"string"},"has_children":{"type":"boolean"},"has_failed_event":{"type":"boolean"},"include_archived":{"type":"boolean"},"tag":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"project":{"type":"string","minLength":1},"cursor":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["limit"],"additionalProperties":false},"RunSearchResponse":{"type":"object","properties":{"runs":{"type":"array","items":{"$ref":"#/components/schemas/RunSummary"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer","minimum":0}},"required":["runs","nextCursor","total"],"additionalProperties":false},"RunStatus":{"type":"string","enum":["queued","running","completed","failed","cancelled"],"description":"Lifecycle state of a run."},"RunSummary":{"type":"object","properties":{"id":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"parentRunId":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/RunStatus"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"durationMs":{"type":["integer","null"]},"totalUsd":{"type":"number","minimum":0},"lastProvider":{"type":["string","null"]},"lastModel":{"type":["string","null"]},"hasChildren":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"archivedAt":{"type":["string","null"]},"projectId":{"type":["string","null"]},"threadId":{"type":["string","null"]},"annotationCounts":{"type":"object","properties":{"thumbsUp":{"type":"integer","minimum":0},"thumbsDown":{"type":"integer","minimum":0},"comments":{"type":"integer","minimum":0}},"required":["thumbsUp","thumbsDown","comments"],"additionalProperties":false}},"required":["id","agentName","agentVersion","parentRunId","status","startedAt","endedAt","durationMs","totalUsd","lastProvider","lastModel"],"additionalProperties":false,"description":"Compact run record for list views."},"RunTagsResponse":{"type":"object","properties":{"runId":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["runId","tags"],"additionalProperties":false},"RunTreeNode":{"type":"object","properties":{"runId":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"status":{"$ref":"#/components/schemas/RunStatus"},"parentRunId":{"type":["string","null"]},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"durationMs":{"type":["integer","null"]},"totalUsd":{"type":"number","minimum":0},"lastProvider":{"type":["string","null"]},"lastModel":{"type":["string","null"]},"classUsed":{"type":"string"},"children":{"type":"array","items":{"$ref":"#/components/schemas/RunTreeNode"}}},"required":["runId","agentName","agentVersion","status","parentRunId","startedAt","endedAt","durationMs","totalUsd","lastProvider","lastModel","children"],"additionalProperties":false},"SafetyEvent":{"type":"object","properties":{"at":{"type":"string"},"runId":{"type":"string"},"agentName":{"type":["string","null"]},"kind":{"type":"string"},"reason":{"type":"string"},"severity":{"type":"string","enum":["info","warn","error"]}},"required":["at","runId","agentName","kind","reason","severity"],"additionalProperties":false},"SandboxConfigWire":{"type":"object","properties":{"timeoutMs":{"type":"integer","minimum":0},"envScrub":{"type":"boolean"},"network":{"type":"object","properties":{"mode":{"$ref":"#/components/schemas/SandboxNetworkMode"},"allowedHosts":{"type":"array","items":{"type":"string"}}},"required":["mode"],"additionalProperties":false},"filesystem":{"type":"object","properties":{"permission":{"$ref":"#/components/schemas/SandboxFsPermission"},"readPaths":{"type":"array","items":{"type":"string"}},"writePaths":{"type":"array","items":{"type":"string"}}},"required":["permission"],"additionalProperties":false}},"additionalProperties":false},"SandboxFsPermission":{"type":"string","enum":["none","repo-readonly","repo-readwrite","full"]},"SandboxNetworkMode":{"type":"string","enum":["none","allowlist","host"]},"SavedView":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"surface":{"$ref":"#/components/schemas/SavedViewSurface"},"query":{"type":"object","additionalProperties":{}},"isShared":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"ownedByMe":{"type":"boolean"}},"required":["id","name","surface","query","isShared","createdAt","updatedAt"],"additionalProperties":false},"SavedViewSurface":{"type":"string","enum":["runs","agents","eval","observability"]},"SavingsPeriod":{"type":"string","enum":["7d","30d","90d"]},"SavingsQuery":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/SavingsPeriod"}},"required":["period"],"additionalProperties":false},"SavingsResponse":{"type":"object","properties":{"period":{"$ref":"#/components/schemas/SavingsPeriod"},"totalSavedUsd":{"type":"number","minimum":0},"localRunCount":{"type":"integer","minimum":0},"unmatchedLocalRunCount":{"type":"integer","minimum":0},"dailySavings":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"savedUsd":{"type":"number","minimum":0}},"required":["date","savedUsd"],"additionalProperties":false}}},"required":["period","totalSavedUsd","localRunCount","unmatchedLocalRunCount","dailySavings"],"additionalProperties":false},"SecretSummary":{"type":"object","properties":{"name":{"type":"string"},"fingerprint":{"type":"string"},"preview":{"type":"string"},"referencedBy":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","fingerprint","preview","referencedBy","createdAt","updatedAt"],"additionalProperties":false},"SeedDefaultResponse":{"type":"object","properties":{"copied":{"type":"integer","minimum":0},"skipped":{"type":"integer","minimum":0}},"required":["copied","skipped"],"additionalProperties":false},"SetSecretRequest":{"type":"object","properties":{"name":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"value":{"type":"string","minLength":1}},"required":["name","value"],"additionalProperties":false},"SetSecretResponse":{"type":"object","properties":{"name":{"type":"string"},"fingerprint":{"type":"string"},"preview":{"type":"string"},"referencedBy":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","fingerprint","preview","referencedBy","createdAt","updatedAt"],"additionalProperties":false},"ShareLink":{"type":"object","properties":{"id":{"type":"string"},"targetKind":{"$ref":"#/components/schemas/AnnotationTargetKind"},"targetId":{"type":"string"},"slug":{"type":"string"},"url":{"type":"string"},"hasPassword":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"viewCount":{"type":"integer","minimum":0},"createdAt":{"type":"string"},"createdByUserId":{"type":"string"},"createdByEmail":{"type":"string"}},"required":["id","targetKind","targetId","slug","url","hasPassword","expiresAt","revokedAt","viewCount","createdAt","createdByUserId","createdByEmail"],"additionalProperties":false},"SignupRequest":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":12},"tenantName":{"type":"string","minLength":1,"maxLength":120}},"required":["email","password","tenantName"],"additionalProperties":false},"SilenceAlertResponse":{"type":"object","properties":{"silencedUntil":{"type":"string"}},"required":["silencedUntil"],"additionalProperties":false},"SpendBreakdownRow":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"costUsd":{"type":"number","minimum":0},"tokensInput":{"type":"integer","minimum":0},"tokensOutput":{"type":"integer","minimum":0},"runs":{"type":"integer","minimum":0},"percentOfTotal":{"type":"number","minimum":0}},"required":["key","label","costUsd","tokensInput","tokensOutput","runs","percentOfTotal"],"additionalProperties":false},"SpendCards":{"type":"object","properties":{"today":{"type":"object","properties":{"costUsd":{"type":"number","minimum":0},"delta":{"$ref":"#/components/schemas/SpendDelta"}},"required":["costUsd","delta"],"additionalProperties":false},"weekToDate":{"type":"object","properties":{"costUsd":{"type":"number","minimum":0},"delta":{"$ref":"#/components/schemas/SpendDelta"}},"required":["costUsd","delta"],"additionalProperties":false},"monthToDate":{"type":"object","properties":{"costUsd":{"type":"number","minimum":0},"delta":{"$ref":"#/components/schemas/SpendDelta"},"projectedMonthEndUsd":{"type":"number","minimum":0}},"required":["costUsd","delta","projectedMonthEndUsd"],"additionalProperties":false},"activeRuns":{"type":"integer","minimum":0}},"required":["today","weekToDate","monthToDate","activeRuns"],"additionalProperties":false},"SpendDelta":{"type":"object","properties":{"prevCostUsd":{"type":"number","minimum":0},"deltaUsd":{"type":"number"},"deltaPct":{"type":["number","null"]}},"required":["prevCostUsd","deltaUsd","deltaPct"],"additionalProperties":false},"SpendGroupBy":{"type":"string","enum":["model","capability","agent","project","day"]},"SpendQuery":{"type":"object","properties":{"project":{"type":"string","minLength":1,"maxLength":120},"window":{"$ref":"#/components/schemas/SpendWindow"},"since":{"type":"string"},"until":{"type":"string"},"groupBy":{"$ref":"#/components/schemas/SpendGroupBy"}},"required":["window","groupBy"],"additionalProperties":false},"SpendResponse":{"type":"object","properties":{"query":{"type":"object","properties":{"project":{"type":["string","null"]},"window":{"$ref":"#/components/schemas/SpendWindow"},"since":{"type":"string"},"until":{"type":"string"},"groupBy":{"$ref":"#/components/schemas/SpendGroupBy"}},"required":["project","window","since","until","groupBy"],"additionalProperties":false},"generatedAt":{"type":"string"},"totals":{"$ref":"#/components/schemas/SpendTotals"},"cards":{"$ref":"#/components/schemas/SpendCards"},"timeseries":{"type":"array","items":{"$ref":"#/components/schemas/SpendTimeseriesPoint"}},"breakdown":{"type":"array","items":{"$ref":"#/components/schemas/SpendBreakdownRow"}}},"required":["query","generatedAt","totals","cards","timeseries","breakdown"],"additionalProperties":false},"SpendTimeseriesPoint":{"type":"object","properties":{"dateBucket":{"type":"string"},"costUsd":{"type":"number","minimum":0},"tokens":{"type":"integer","minimum":0},"runs":{"type":"integer","minimum":0}},"required":["dateBucket","costUsd","tokens","runs"],"additionalProperties":false},"SpendTotals":{"type":"object","properties":{"costUsd":{"type":"number","minimum":0},"tokensInput":{"type":"integer","minimum":0},"tokensOutput":{"type":"integer","minimum":0},"runs":{"type":"integer","minimum":0}},"required":["costUsd","tokensInput","tokensOutput","runs"],"additionalProperties":false},"SpendWindow":{"type":"string","enum":["24h","7d","30d","90d","custom"]},"SslStatus":{"type":"string","enum":["pending","issued","failed"]},"StartPlaygroundRunRequest":{"type":"object","properties":{"evaluatorId":{"type":"string","minLength":1},"datasetId":{"type":"string","minLength":1},"sampleSize":{"type":"integer","minimum":0,"maximum":500}},"required":["evaluatorId","datasetId"],"additionalProperties":false},"StartPlaygroundRunResponse":{"type":"object","properties":{"runId":{"type":"string"}},"required":["runId"],"additionalProperties":false},"StartSweepRequest":{"type":"object","properties":{"suiteName":{"type":"string"},"suiteVersion":{"type":"string"},"agentVersion":{"type":"string"},"models":{"type":"array","items":{"type":"string"}}},"required":["suiteName","models"],"additionalProperties":false},"StartSweepResponse":{"type":"object","properties":{"sweepId":{"type":"string"}},"required":["sweepId"],"additionalProperties":false},"Subscription":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/Plan"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"trialEnd":{"type":["string","null"]},"currentPeriodEnd":{"type":["string","null"]},"cancelledAt":{"type":["string","null"]},"trialDaysRemaining":{"type":["integer","null"],"minimum":0},"retentionDays":{"type":["integer","null"],"minimum":0},"effectiveRetentionDays":{"type":["integer","null"],"minimum":0},"lastPrunedAt":{"type":["string","null"]}},"required":["plan","status","trialEnd","currentPeriodEnd","cancelledAt","trialDaysRemaining","retentionDays","effectiveRetentionDays","lastPrunedAt"],"additionalProperties":false},"SubscriptionStatus":{"type":"string","enum":["trialing","active","past_due","cancelled","unpaid","incomplete"]},"SwapModelCommand":{"type":"object","properties":{"checkpointId":{"type":"string"},"capabilityClass":{"type":"string"},"provider":{"type":"string"},"model":{"type":"string"}},"required":["checkpointId"],"additionalProperties":false},"Sweep":{"type":"object","properties":{"id":{"type":"string"},"suiteName":{"type":"string"},"suiteVersion":{"type":"string"},"agentName":{"type":"string"},"agentVersion":{"type":"string"},"models":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/SweepStatus"},"startedAt":{"type":"string"},"endedAt":{"type":["string","null"]},"byModel":{"type":"object","additionalProperties":{"type":"object","properties":{"passed":{"type":"number"},"total":{"type":"number"},"usd":{"type":"number"}},"required":["passed","total","usd"],"additionalProperties":false}},"cells":{"type":"array","items":{"$ref":"#/components/schemas/SweepCellResult"}}},"required":["id","suiteName","suiteVersion","agentName","agentVersion","models","status","startedAt","endedAt","byModel","cells"],"additionalProperties":false},"SweepCellResult":{"type":"object","properties":{"caseId":{"type":"string"},"model":{"type":"string"},"passed":{"type":"boolean"},"score":{"type":"number","minimum":0,"maximum":1},"output":{"type":"string"},"detail":{},"costUsd":{"type":"number","minimum":0},"durationMs":{"type":"integer","minimum":0}},"required":["caseId","model","passed","score","output","costUsd","durationMs"],"additionalProperties":false},"SweepStatus":{"type":"string","enum":["queued","running","completed","failed","cancelled"]},"SwitchTenantRequest":{"type":"object","properties":{"tenantSlug":{"type":"string","minLength":1}},"required":["tenantSlug"],"additionalProperties":false},"SwitchTenantResponse":{"type":"object","properties":{"token":{"type":"string","minLength":1},"tenant":{"$ref":"#/components/schemas/AuthTenant"}},"required":["token","tenant"],"additionalProperties":false},"TenantDomain":{"type":"object","properties":{"hostname":{"type":"string"},"verifiedAt":{"type":["string","null"]},"verificationToken":{"type":"string"},"txtRecordName":{"type":"string"},"txtRecordValue":{"type":"string"},"sslStatus":{"$ref":"#/components/schemas/SslStatus"},"createdAt":{"type":"string"}},"required":["hostname","verifiedAt","verificationToken","txtRecordName","txtRecordValue","sslStatus","createdAt"],"additionalProperties":false},"TerminationWire":{"type":"object","properties":{"maxTurns":{"type":"integer","minimum":0},"maxUsd":{"type":"number","minimum":0},"textMention":{"type":"string","minLength":1},"successRoles":{"type":"array","items":{"type":"string","minLength":1}}},"additionalProperties":false},"TestAlertResponse":{"type":"object","properties":{"wouldTrigger":{"type":"boolean"},"value":{"type":"number"},"threshold":{"$ref":"#/components/schemas/AlertThreshold"},"note":{"type":"string"}},"required":["wouldTrigger","value","threshold"],"additionalProperties":false},"TestEvaluatorRequest":{"type":"object","properties":{"evaluatorId":{"type":"string"},"kind":{"$ref":"#/components/schemas/EvaluatorKind"},"config":{"$ref":"#/components/schemas/EvaluatorConfig"},"output":{"type":"string"},"expected":{"type":"string"},"input":{"type":"string"}},"required":["output"],"additionalProperties":false},"TestEvaluatorResponse":{"type":"object","properties":{"passed":{"type":"boolean"},"score":{"type":"number"},"detail":{}},"required":["passed","score"],"additionalProperties":false},"TestFireResponse":{"type":"object","properties":{"ok":{"type":"boolean"},"statusCode":{"type":"integer"},"error":{"type":"string"},"timedOut":{"type":"boolean"}},"required":["ok"],"additionalProperties":false},"Thread":{"type":"object","properties":{"id":{"type":"string"},"runCount":{"type":"integer","minimum":0},"firstActivityAt":{"type":"string"},"lastActivityAt":{"type":"string"},"lastStatus":{"type":"string"},"agentNames":{"type":"array","items":{"type":"string"}},"totalUsd":{"type":"number","minimum":0}},"required":["id","runCount","firstActivityAt","lastActivityAt","lastStatus","agentNames","totalUsd"],"additionalProperties":false},"ThreadTimelineEvent":{"type":"object","properties":{"runId":{"type":"string"},"agentName":{"type":"string"},"eventId":{"type":"string"},"type":{"type":"string"},"at":{"type":"string"},"payload":{}},"required":["runId","agentName","eventId","type","at","payload"],"additionalProperties":false},"TimeseriesData":{"type":"object","properties":{"shape":{"type":"string","const":"timeseries"},"points":{"type":"array","items":{"$ref":"#/components/schemas/TimeseriesPoint"}}},"required":["shape","points"],"additionalProperties":false},"TimeseriesPoint":{"type":"object","properties":{"at":{"type":"string"},"value":{"type":"number"}},"required":["at","value"],"additionalProperties":false},"ToggleReactionRequest":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/AnnotationReactionKind"}},"required":["kind"],"additionalProperties":false},"ToggleReactionResponse":{"type":"object","properties":{"annotation":{"$ref":"#/components/schemas/Annotation"}},"required":["annotation"],"additionalProperties":false},"ToolsGuardsWire":{"type":"object","properties":{"spotlighting":{"type":"boolean"},"outputScanner":{"type":"object","properties":{"enabled":{"type":"boolean"},"severityBlock":{"$ref":"#/components/schemas/GuardSeverityWire"},"urlAllowlist":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"quarantine":{"type":"object","properties":{"enabled":{"type":"boolean"},"capabilityClass":{"type":"string"},"thresholdChars":{"type":"integer","minimum":0}},"additionalProperties":false}},"additionalProperties":false},"UpdateAgentRequest":{"type":"object","properties":{"project":{"type":"string","minLength":1}},"additionalProperties":false},"UpdateAlertRuleRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"threshold":{"$ref":"#/components/schemas/AlertThreshold"},"targets":{"$ref":"#/components/schemas/AlertTargets"},"notificationChannels":{"type":"array","items":{"$ref":"#/components/schemas/NotificationChannel"}},"enabled":{"type":"boolean"}},"additionalProperties":false},"UpdateAnnotationRequest":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":8192}},"required":["body"],"additionalProperties":false},"UpdateCachePolicyRequest":{"type":"object","properties":{"enabled":{"type":"boolean"},"ttlSeconds":{"type":"integer","minimum":0},"cacheSensitive":{"type":"boolean"}},"additionalProperties":false},"UpdateDashboardRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":2000},"isShared":{"type":"boolean"},"layout":{"type":"array","items":{"$ref":"#/components/schemas/DashboardWidget"}}},"additionalProperties":false},"UpdateDatasetExampleRequest":{"type":"object","properties":{"input":{},"expected":{},"metadata":{"type":"object","additionalProperties":{}},"label":{"type":["string","null"]},"split":{"type":"string"}},"additionalProperties":false},"UpdateDatasetRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":2000},"schema":{"$ref":"#/components/schemas/DatasetSchema"},"tags":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"UpdateDesignPartnerApplicationRequest":{"type":"object","properties":{"status":{"type":"string","enum":["new","contacted","accepted","declined"]},"adminNotes":{"type":"string","maxLength":4000}},"additionalProperties":false},"UpdateEngagementRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":4000},"status":{"$ref":"#/components/schemas/EngagementStatus"}},"additionalProperties":false},"UpdateEvaluatorRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"config":{"$ref":"#/components/schemas/EvaluatorConfig"},"isShared":{"type":"boolean"}},"additionalProperties":false},"UpdateIntegrationRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"config":{"type":"object","additionalProperties":{}},"events":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEventContract"}},"enabled":{"type":"boolean"}},"additionalProperties":false},"UpdateMemberRequest":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/Role"}},"required":["role"],"additionalProperties":false},"UpdateProjectRequest":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},"name":{"type":"string","minLength":1,"maxLength":160},"description":{"type":"string","maxLength":2000},"archived":{"type":"boolean"}},"additionalProperties":false},"UpdatePromptRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[a-z][a-z0-9-]*$"},"description":{"type":"string","maxLength":2000},"project":{"type":"string","minLength":1}},"additionalProperties":false},"UpdateSavedViewRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"query":{"type":"object","additionalProperties":{}},"isShared":{"type":"boolean"}},"additionalProperties":false},"UpdateSubscriptionRequest":{"type":"object","properties":{"retentionDays":{"type":["integer","null"],"minimum":0}},"additionalProperties":false},"UpdateSubscriptionResponse":{"type":"object","properties":{"subscription":{"$ref":"#/components/schemas/Subscription"}},"required":["subscription"],"additionalProperties":false},"UsageRow":{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"tokensIn":{"type":"integer","minimum":0},"tokensOut":{"type":"integer","minimum":0},"usd":{"type":"number","minimum":0},"at":{"type":"string"}},"required":["provider","model","tokensIn","tokensOut","usd","at"],"additionalProperties":false},"VerifyDomainResponse":{"type":"object","properties":{"verified":{"type":"boolean"},"verifiedAt":{"type":["string","null"]},"reason":{"type":"string"}},"required":["verified","verifiedAt"],"additionalProperties":false},"WidgetData":{"oneOf":[{"$ref":"#/components/schemas/TimeseriesData"},{"$ref":"#/components/schemas/PieData"},{"$ref":"#/components/schemas/BarData"},{"$ref":"#/components/schemas/HeatmapData"},{"$ref":"#/components/schemas/KpiData"}],"discriminator":{"propertyName":"shape"}},"WidgetLayout":{"type":"object","properties":{"col":{"type":"integer","minimum":0,"maximum":11},"row":{"type":"integer","minimum":0,"maximum":99},"w":{"type":"integer","minimum":1,"maximum":12},"h":{"type":"integer","minimum":1,"maximum":12}},"required":["col","row","w","h"],"additionalProperties":false}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"HS256-signed session JWT. Issued by `POST /v1/auth/login` or `/v1/auth/signup`."},"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"Programmatic API key prefixed `aldo_live_`. Carries scopes (e.g. `runs:write`, `agents:read`, `admin:*`)."}}},"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"x-aldo-llm-agnostic":true}