{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Rebyte API","version":"1.0.0","description":"The complete public /v1 contract for OpenAI-compatible Responses and Conversation items, Rebyte Agents, durable Runs and execution traces, Sessions, Messages, Agent Computers, legacy Tasks, Webhooks, files, workspace artifacts, Agent Context, billing, and restricted partner operations.\n\nNew integrations should create reusable Agents, then run them through Responses or create durable Sessions and submit Messages asynchronously. The existing Web application and legacy /v1/tasks API remain available and backward-compatible.\n\nSession SSE is a live/recent observation transport, not a durable event ledger. Durable cursor replay is intentionally outside this version.\n\nExisting organization Webhooks remain best-effort: one delivery attempt, no retry, and delivery failure may be dropped."},"servers":[{"url":"https://api.rebyte.ai"}],"externalDocs":{"description":"Rebyte API v1 guide","url":"https://rebyte.ai/docs/agent-api/overview"},"tags":[{"name":"Responses","description":"Focused OpenAI Responses wire-compatible execution façade over durable Rebyte Sessions and Messages."},{"name":"Conversations","description":"OpenAI-compatible durable Conversation state operations that do not invoke the Agent."},{"name":"Observability","description":"Organization-wide persisted Agent runs and traces assembled from Agent steps, model calls, and tool calls, independent of whether execution started from API, Web, Slack, or another product surface."},{"name":"Agents","description":"Reusable managed Agent configurations."},{"name":"Sessions","description":"Durable Conversations created from an Agent configuration."},{"name":"Tasks","description":"Backward-compatible task-centric API. Prefer Agents and Sessions for new integrations."},{"name":"Files","description":"Organization-scoped uploads referenced by Responses or legacy Tasks."},{"name":"Webhooks","description":"Best-effort lifecycle delivery for API-created work."},{"name":"Agent Computers","description":"Provisioned Agent Computer workspaces and DB9 access."},{"name":"Workspace Artifacts","description":"Read and delete files produced in a workspace."},{"name":"Context Lake","description":"Agent Context configuration, catalogs, SQL, and lifecycle operations."},{"name":"Billing","description":"Organization credit information."},{"name":"Partner API","description":"Restricted account and top-up operations requiring accounts:write."},{"name":"Sandbox","description":"Sandbox credentials for Agent Computer integrations."},{"name":"Specification","description":"Machine-readable and Markdown API contracts."}],"paths":{"/v1/openapi.json":{"get":{"tags":["Specification"],"operationId":"getOpenApiJson","summary":"Download the OpenAPI document","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/openapi.md":{"get":{"tags":["Specification"],"operationId":"getOpenApiMarkdown","summary":"Download the LLM-friendly Markdown contract","security":[],"responses":{"200":{"description":"Markdown generated from this OpenAPI document.","content":{"text/markdown":{"schema":{"type":"string"}}}}}}},"/v1/responses":{"post":{"tags":["Responses"],"operationId":"createResponse","summary":"Create a Response using the supported OpenAI wire subset","description":"Use a Rebyte Agent UUID as model. The first call creates a durable Conversation backed by a Rebyte Session; pass the returned conversation.id on later calls. Agent-defined client tools produce standard function_call output. To continue the Agent immediately, submit all function_call_output items together in a new Response on that Conversation. To persist results without invoking the Agent, create Conversation items instead. With stream=true, function calls and text use the standard Responses event lifecycle. Agent-configured MCP calls remain server-executed; Rebyte runtime progress and action-required details are additive response.rebyte_tool_call.* events.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write","tasks:read"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 visible ASCII characters. Reusing the key with the same body returns the same resource.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","format":"uuid"},"input":{"anyOf":[{"type":"string","minLength":1,"maxLength":100000},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"message"},"role":{"type":"string","const":"user"},"content":{"anyOf":[{"type":"string","minLength":1,"maxLength":100000},{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"input_text"},"text":{"type":"string","minLength":1,"maxLength":100000}},"required":["type","text"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"input_file"},"file_id":{"type":"string","format":"uuid"}},"required":["type","file_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"input_image"},"file_id":{"type":"string","format":"uuid"},"detail":{"type":"string","enum":["auto","low","high","original"]}},"required":["type","file_id"],"additionalProperties":false}]},"minItems":1,"maxItems":32}]}},"required":["role","content"],"additionalProperties":false},"minItems":1,"maxItems":32},{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"function_call_output"},"call_id":{"type":"string","minLength":1,"maxLength":512},"output":{"type":"string","maxLength":1000000}},"required":["type","call_id","output"],"additionalProperties":false},"minItems":1,"maxItems":64}]},"stream":{"type":"boolean"},"conversation":{"description":"Stable Rebyte Conversation ID, as a string or OpenAI-style object.","anyOf":[{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"},{"type":"object","required":["id"],"properties":{"id":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"}},"additionalProperties":false}]},"store":{"type":"boolean","const":true},"background":{"type":"boolean","const":false}},"required":["model","input"],"additionalProperties":false,"allOf":[{"if":{"required":["input"],"properties":{"input":{"type":"array","minItems":1,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"function_call_output"}}}}}},"then":{"required":["conversation"]}}]}}}},"responses":{"200":{"description":"Completed Response JSON, or an OpenAI-compatible SSE event stream when stream=true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}},"text/event-stream":{"schema":{"type":"string","description":"Live Responses API SSE events for function calls, text, and MCP calls, plus additive response.rebyte_tool_call.* runtime events. Ends with data: [DONE]."}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A pending client result is required (client_tool_output_required), a submitted result conflicts with durable state (function_call_output_conflict), or the request conflicts with idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The synchronous request exceeded the five-minute Responses API wait limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/conversations/{conversation_id}/items":{"post":{"tags":["Conversations"],"operationId":"createConversationItems","summary":"Add client tool outputs to a Conversation","description":"Persists completed function_call_output items in an existing Conversation without creating a Response, starting an Agent run, or invoking a model. Each call_id must identify a client function_call produced by this Conversation. Identical retries are idempotent and return the same durable item; retrying a call_id with different output returns 409. Submit every pending client tool output before sending new user input to the Conversation.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"conversation_id","in":"path","required":true,"description":"Conversation ID returned by POST /v1/responses.","schema":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationItemsRequest"}}}},"responses":{"200":{"description":"Created Conversation items in request order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationItemList"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A submitted function_call_output conflicts with the durable result already recorded for its call_id, or the Conversation state changed while results were submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses/{response_id}":{"get":{"tags":["Responses"],"operationId":"getResponse","summary":"Retrieve an OpenAI-compatible Response","description":"Projects the authoritative durable Session Message into the Responses API shape.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"response_id","in":"path","required":true,"description":"Response ID returned by POST /v1/responses.","schema":{"type":"string","pattern":"^resp_[0-9a-fA-F-]{36}$"}}],"responses":{"200":{"description":"Response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runs":{"get":{"tags":["Observability"],"operationId":"listRuns","summary":"List Agent runs across the organization","description":"Returns cursor-paginated runs for every Agent execution visible to the organization API key, regardless of whether the run started through the API, Web UI, Slack, or another surface. Filter by canonical Agent or Conversation ID when needed.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"agent_id","in":"query","required":false,"description":"Canonical Agent Profile ID. API-created runs use their reusable source Agent; other runs use the independent workspace Agent.","schema":{"type":"string","format":"uuid"}},{"name":"conversation_id","in":"query","required":false,"description":"OpenAI-style Conversation ID returned on each Run.","schema":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of runs to return.","schema":{"type":"integer","minimum":1,"maximum":50,"default":50}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page.","schema":{"type":"string","minLength":1,"maxLength":2000}}],"responses":{"200":{"description":"Organization Agent runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunList"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runs/{run_id}":{"get":{"tags":["Observability"],"operationId":"getRun","summary":"Get one Agent run","description":"Returns durable run identity, status, bounded input/output previews, usage, and cost. Organization ownership is enforced by the API key; an unknown or cross-organization ID returns 404.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"run_id","in":"path","required":true,"description":"Durable Agent run ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runs/{run_id}/trace":{"get":{"tags":["Observability"],"operationId":"getRunTrace","summary":"Get the execution trace for any Agent run","description":"Returns the same persisted trace used by the Rebyte UI for any organization-owned run. Spans include Agent steps, correlated model calls, and MCP tool calls. Results are parent-first and cursor-paginated.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"run_id","in":"path","required":true,"description":"Durable Agent run ID.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of spans to return.","schema":{"type":"integer","minimum":1,"maximum":50,"default":30}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page.","schema":{"type":"string","minLength":1,"maxLength":2000}}],"responses":{"200":{"description":"Agent run execution trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunTrace"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses/{response_id}/trace":{"get":{"tags":["Observability"],"operationId":"getResponseTrace","summary":"Get the execution trace for a Response","description":"Returns the same persisted trace used by the Rebyte admin UI. Spans include Agent steps, correlated LiteLLM model calls, and MCP tool calls. Results are ordered parent-first and cursor-paginated. Span payloads are bounded previews; use the recorded file and tool resources for larger artifacts.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"response_id","in":"path","required":true,"description":"Response ID returned by POST /v1/responses.","schema":{"type":"string","pattern":"^resp_[0-9a-fA-F-]{36}$"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of spans to return.","schema":{"type":"integer","minimum":1,"maximum":50,"default":30}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor returned by the previous page.","schema":{"type":"string","minLength":1,"maxLength":2000}}],"responses":{"200":{"description":"Response execution trace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseTrace"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents":{"get":{"tags":["Agents"],"operationId":"listAgents","summary":"List Agents","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"responses":{"200":{"description":"Organization Agents.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}},"additionalProperties":false}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agents"],"operationId":"createAgent","summary":"Create an Agent","description":"Creates one durable Agent runtime. Every Session for this Agent runs in the same Agent Workspace and Sandbox.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 visible ASCII characters. Reusing the key with the same body returns the same resource.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"\\S"},"description":{"type":"string","maxLength":500,"pattern":"\\S"},"instructions":{"type":"string","maxLength":100000},"model":{"type":"string"},"maxSteps":{"type":"integer","exclusiveMinimum":0,"maximum":128},"mcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"internal"},"name":{"type":"string","enum":["web_search_&_browse","sandbox","skills","coding_agent","ask_user_question","report_builder","company","app_builder_contract","github","sound_studio","speech_generator","http_client"]}},"required":["kind","name"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"composio"},"toolkit":{"type":"string","minLength":1,"maxLength":300,"pattern":"^\\S(?:[\\s\\S]*\\S)?$"}},"required":["kind","toolkit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"},"serverId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","serverId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"url"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Agent-local name for this remote MCP server."},"url":{"type":"string","format":"uri","maxLength":2000,"description":"Public HTTPS Streamable HTTP or SSE MCP endpoint. A no-auth connector is discovered and registered atomically with the Agent; an existing organization connector at the same URL is reused."}},"required":["type","name","url"],"additionalProperties":false}]},"maxItems":64,"uniqueItems":true},"clientTools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"function"},"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"description":{"type":"string","minLength":1,"pattern":"\\S"},"parameters":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/properties/clientTools/items/properties/parameters/additionalProperties"}},{"type":"object","additionalProperties":{"$ref":"#/properties/clientTools/items/properties/parameters/additionalProperties"}}]},"description":"JSON Schema for this persistent Agent client tool. The supported bounded subset requires a root object and additionalProperties false. With strict true, every property must be required; with strict false, required may be omitted or contain any unique subset of declared properties."},"strict":{"type":"boolean","description":"Whether to enable provider strict Structured Outputs. False preserves optional-property semantics within the supported JSON Schema subset."}},"required":["type","name","description","parameters","strict"],"additionalProperties":false},"maxItems":64,"uniqueItems":true,"x-unique-by":"name","description":"Persistent client-executed functions available on every run of this Agent. Names must be unique."},"skills":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","minLength":1,"maxLength":300,"pattern":"^(?!.*\\.[gG][iI][tT]$)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\/[A-Za-z0-9._-]+$"},"path":{"type":"string","minLength":1,"maxLength":1000,"pattern":"^(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))(?!.*\\\\)(?!.*[?#\\s])(?!.*(?:^|\\/)[sS][kK][iI][lL][lL]\\.[mM][dD]$)[^/]+(?:\\/[^/]+)*$"}},"required":["repo","path"],"additionalProperties":false},"maxItems":128,"uniqueItems":true},"networkPolicy":{"type":"object","properties":{"allow_network_egress":{"type":"boolean"},"domain_allowlist":{"type":"string","enum":["none","package_managers_only","all_domains"]},"additional_allowed_domains":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":128,"default":[]},"allow_public_traffic":{"type":"boolean","default":false}},"required":["allow_network_egress","domain_allowlist"],"additionalProperties":false}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Agent created or idempotently replayed.","content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{id}":{"get":{"tags":["Agents"],"operationId":"getAgent","summary":"Get an Agent","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent.","content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agents"],"operationId":"updateAgent","summary":"Update an Agent","description":"Updates the Agent configuration used by future turns in both existing and new Sessions. Skills and network policy cannot change after the Agent Sandbox has been provisioned.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"pattern":"\\S"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"pattern":"\\S"},"instructions":{"type":"string","maxLength":100000},"model":{"type":"string"},"maxSteps":{"type":"integer","exclusiveMinimum":0,"maximum":128},"mcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"internal"},"name":{"type":"string","enum":["web_search_&_browse","sandbox","skills","coding_agent","ask_user_question","report_builder","company","app_builder_contract","github","sound_studio","speech_generator","http_client"]}},"required":["kind","name"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"composio"},"toolkit":{"type":"string","minLength":1,"maxLength":300,"pattern":"^\\S(?:[\\s\\S]*\\S)?$"}},"required":["kind","toolkit"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"custom"},"serverId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","serverId"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"url"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Agent-local name for this remote MCP server."},"url":{"type":"string","format":"uri","maxLength":2000,"description":"Public HTTPS Streamable HTTP or SSE MCP endpoint. A no-auth connector is discovered and registered atomically with the Agent; an existing organization connector at the same URL is reused."}},"required":["type","name","url"],"additionalProperties":false}]},"maxItems":64,"uniqueItems":true},"clientTools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"function"},"name":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"description":{"type":"string","minLength":1,"pattern":"\\S"},"parameters":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/properties/clientTools/items/properties/parameters/additionalProperties"}},{"type":"object","additionalProperties":{"$ref":"#/properties/clientTools/items/properties/parameters/additionalProperties"}}]},"description":"JSON Schema for this persistent Agent client tool. The supported bounded subset requires a root object and additionalProperties false. With strict true, every property must be required; with strict false, required may be omitted or contain any unique subset of declared properties."},"strict":{"type":"boolean","description":"Whether to enable provider strict Structured Outputs. False preserves optional-property semantics within the supported JSON Schema subset."}},"required":["type","name","description","parameters","strict"],"additionalProperties":false},"maxItems":64,"uniqueItems":true,"x-unique-by":"name","description":"Persistent client-executed functions available on every run of this Agent. Names must be unique."},"skills":{"type":"array","items":{"type":"object","properties":{"repo":{"type":"string","minLength":1,"maxLength":300,"pattern":"^(?!.*\\.[gG][iI][tT]$)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\/[A-Za-z0-9._-]+$"},"path":{"type":"string","minLength":1,"maxLength":1000,"pattern":"^(?!\\/)(?!.*(?:^|\\/)\\.\\.?(?:\\/|$))(?!.*\\\\)(?!.*[?#\\s])(?!.*(?:^|\\/)[sS][kK][iI][lL][lL]\\.[mM][dD]$)[^/]+(?:\\/[^/]+)*$"}},"required":["repo","path"],"additionalProperties":false},"maxItems":128,"uniqueItems":true},"networkPolicy":{"anyOf":[{"type":"object","properties":{"allow_network_egress":{"type":"boolean"},"domain_allowlist":{"type":"string","enum":["none","package_managers_only","all_domains"]},"additional_allowed_domains":{"type":"array","items":{"type":"string","minLength":1,"maxLength":253},"maxItems":128,"default":[]},"allow_public_traffic":{"type":"boolean","default":false}},"required":["allow_network_egress","domain_allowlist"],"additionalProperties":false},{"type":"null"}]}},"additionalProperties":false,"minProperties":1}}}},"responses":{"200":{"description":"Updated Agent.","content":{"application/json":{"schema":{"type":"object","required":["agent"],"properties":{"agent":{"$ref":"#/components/schemas/Agent"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Agents"],"operationId":"deleteAgent","summary":"Delete an Agent","description":"Rejected while Sessions still reference the Agent and rejected for the organization default Agent.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Agent ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Agent deleted."},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions":{"get":{"tags":["Sessions"],"operationId":"listSessions","summary":"List Sessions","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"agentId","in":"query","required":false,"description":"Return only Sessions created from this Agent.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of records to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Sessions.","content":{"application/json":{"schema":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Session"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sessions"],"operationId":"createSession","summary":"Create an idle Session","description":"Creates a durable Conversation in the Agent runtime. Execution starts only when the first Message is submitted.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Up to 255 visible ASCII characters. Reusing the key with the same body returns the same resource.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agentId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"}},"required":["agentId"],"additionalProperties":false}}}},"responses":{"201":{"description":"Session created or idempotently replayed.","content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/Session"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The source Agent was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The request conflicts with the current resource or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}":{"get":{"tags":["Sessions"],"operationId":"getSession","summary":"Get Session state","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Session.","content":{"application/json":{"schema":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/Session"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Sessions"],"operationId":"deleteSession","summary":"Delete a Session","description":"Cancels the active turn, then deletes the Session. The Agent Workspace and Sandbox remain available to the Agent's other Sessions. Webhook delivery remains best-effort.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Session deleted."},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/messages":{"get":{"tags":["Sessions"],"operationId":"listSessionMessages","summary":"List the durable Session transcript","description":"Returns public Messages in transcript order. Use these records, rather than SSE replay, to reconcile authoritative Message status, unresolved HITL actions, response, and error state.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"Maximum number of records to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Paginated public Messages.","content":{"application/json":{"schema":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sessions"],"operationId":"createSessionMessage","summary":"Submit a message asynchronously","description":"Returns a 202 acceptance projection after the turn is accepted or queued. An idempotent replay may already be terminal; GET the Message for its current authoritative state. The returned message.id is the stable public prompt ID used by SSE and transcript GETs. Multiple input text parts are joined with newline characters into one effective prompt, and transcript reads return that normalized text as one part. Warnings describe only this acceptance attempt and are non-fatal.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"Required. Scoped to the organization and Session. Reusing the key with different message content returns 409.","schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[\\x21-\\x7E]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parts":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"text"},"text":{"type":"string","minLength":1,"maxLength":100000}},"required":["type","text"],"additionalProperties":false},"minItems":1,"maxItems":32}},"required":["parts"],"additionalProperties":false}}}},"responses":{"202":{"description":"Message accepted or queued; execution continues asynchronously.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedMessage"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The selected model or turn requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"A pending client result is required (client_tool_output_required), or the request conflicts with current Session or idempotency state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/messages/{messageId}":{"get":{"tags":["Sessions"],"operationId":"getSessionMessage","summary":"Get one durable Message","description":"The authoritative reconciliation endpoint for a submitted Message, including unresolved HITL actions and terminal response or error state.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"description":"Public Message ID returned by POST /messages.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Public Message.","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"$ref":"#/components/schemas/Message"}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/messages/{messageId}/answer":{"post":{"tags":["Sessions"],"operationId":"answerSessionMessageQuestion","summary":"Answer a blocked Message question","description":"Answers one human-in-the-loop question emitted as a message.event with data.sourceType tool_ask_user_question. Send data.actionId and the answer value verbatim.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}},{"name":"messageId","in":"path","required":true,"description":"Public Message ID returned by POST /messages.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"actionId":{"type":"integer","minimum":0},"answer":{"anyOf":[{"type":"object","additionalProperties":{}},{"type":"array","items":{}},{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}},"required":["actionId","answer"],"additionalProperties":false}}}},"responses":{"200":{"description":"Answer recorded; the Message either resumed or is waiting for another blocked action.","content":{"application/json":{"schema":{"type":"object","required":["messageId","actionId","status"],"properties":{"messageId":{"type":"string","format":"uuid"},"actionId":{"type":"integer","minimum":0},"status":{"type":"string","enum":["accepted","resuming"]}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The action does not exist, does not belong to this Message, or is no longer waiting for an answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/stream":{"get":{"tags":["Sessions"],"operationId":"streamSession","summary":"Open the standing Session SSE stream","description":"Multiplexes conversation and per-run events. Frames carry channel-scoped wire ids; global ordering and durable Last-Event-ID recovery are not promised in v1. History, initialization buffers, and socket backpressure are bounded; reconnect and reconcile with Message GETs if the connection closes. Each data line decodes to SessionEvent.","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Standing SSE stream with heartbeat comments every 15 seconds.","content":{"text/event-stream":{"schema":{"type":"string","description":"SSE wire frames. Parse each data field as a SessionEvent JSON object."},"x-sse-event-schema":{"$ref":"#/components/schemas/SessionEvent"}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{id}/interrupt":{"post":{"tags":["Sessions"],"operationId":"interruptSession","summary":"Interrupt the active turn","security":[{"ApiKey":[]},{"BearerAuth":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Session ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Interruption status.","content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["interrupting","no_turn"]}},"additionalProperties":false}}}},"400":{"description":"A path, query, header, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope, or policy rejected the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks":{"get":{"tags":["Tasks"],"operationId":"listLegacyTasks","summary":"List API-created Tasks","description":"Lists non-deleted Tasks created through the task-based API, newest first. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum records to return. Values above 100 are clamped to 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Paginated API-created Tasks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Tasks"],"operationId":"createLegacyTask","summary":"Create a Task","description":"Creates a task-based Agent run. Omit `workspaceId` to create a new Workspace, or supply an existing non-Session Workspace. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateTaskRequest"}}}},"responses":{"201":{"description":"Task and initial prompt accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskCreated"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The request requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The selected Workspace is reserved for an Agent API Session.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}":{"get":{"tags":["Tasks"],"operationId":"getLegacyTask","summary":"Get a Task","description":"Returns Task metadata, derived status, and prompt statuses. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Task details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTask"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Tasks"],"operationId":"deleteLegacyTask","summary":"Delete a Task","description":"Soft-deletes an API-created Task. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Task deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/content":{"get":{"tags":["Tasks"],"operationId":"getLegacyTaskContent","summary":"Get a Task transcript","description":"Returns top-level user prompts and final responses. Add `include=events` to include synthesized manager events. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}},{"name":"include","in":"query","required":false,"description":"Include the normalized event array for each prompt.","schema":{"type":"string","const":"events"}}],"responses":{"200":{"description":"Authoritative Task transcript.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskContent"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/prompts":{"post":{"tags":["Tasks"],"operationId":"createLegacyTaskPrompt","summary":"Submit a follow-up prompt","description":"Submits or queues a follow-up on an existing API-created Task. The optional execution identifiers depend on whether the prompt starts immediately or is queued. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyFollowUpRequest"}}}},"responses":{"201":{"description":"Follow-up accepted or queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyFollowUpAccepted"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"The request requires credits or an active subscription.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/visibility":{"patch":{"tags":["Tasks"],"operationId":"updateLegacyTaskVisibility","summary":"Change Task visibility","description":"Changes the Task Workspace visibility. Public visibility returns a share URL. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVisibilityRequest"}}}},"responses":{"200":{"description":"Updated visibility.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyVisibility"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/events":{"get":{"tags":["Tasks"],"operationId":"streamLegacyTaskEvents","summary":"Stream the latest Task prompt","description":"Streams the latest visible top-level prompt as SSE. Frames use event name `event` with `LegacyTaskEvent` data and finish with event name `done`; the connection can also end after 15 minutes with status still `running`. Sequence numbers are connection-local, so deduplicate synthesized events by `eventKey`. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Task execution SSE stream.","content":{"text/event-stream":{"schema":{"type":"string"},"x-sse-event-schema":{"oneOf":[{"$ref":"#/components/schemas/LegacyTaskEvent"},{"$ref":"#/components/schemas/LegacyTaskStreamDone"}]}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/prompts/{promptId}/events":{"get":{"tags":["Tasks"],"operationId":"getLegacySubPromptEvents","summary":"Get sub-prompt events","description":"Returns normalized object-storage events for a sub-prompt belonging to this Task. Parent tool events expose the sub-prompt ID. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}},{"name":"promptId","in":"path","required":true,"description":"Sub-prompt ID exposed by a parent tool event.","schema":{"type":"string","format":"uuid"}},{"name":"afterSeq","in":"query","required":false,"description":"Return only events with seq greater than this finite number.","schema":{"type":"number","default":-1}}],"responses":{"200":{"description":"Sub-prompt events.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacySubPromptEvents"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/cancel":{"post":{"tags":["Tasks"],"operationId":"cancelLegacyTask","summary":"Cancel a Task","description":"Cancels active manager messages, pending prompts, and active sandbox sub-prompts. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Cancellation result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCancelTaskResult"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}/answer":{"post":{"tags":["Tasks"],"operationId":"answerLegacyTaskQuestion","summary":"Answer a blocked Task question","description":"Answers the `ask_user_question` identified by the Task event `messageId` and `actionId`, then resumes the same turn. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"API-created Task ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskAnswerRequest"}}}},"responses":{"200":{"description":"Answer accepted and Workflow resumed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyTaskAnswerResult"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Task no longer has the identified blocked action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files":{"post":{"tags":["Files"],"operationId":"createLegacyFileUpload","summary":"Create an organization file upload","description":"Returns an opaque file ID and a signed object-storage PUT URL valid for one hour. Upload the bytes separately, then reference the ID as `input_file.file_id` or `input_image.file_id` in a Response. Legacy Task requests continue to accept `id` plus `filename`. Required scope: `files:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["files:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateFileRequest"}}}},"responses":{"201":{"description":"Temporary upload reservation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyFileUpload"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"operationId":"listLegacyWebhooks","summary":"List Webhooks","description":"Lists this organization's Webhook registrations. Required scope: `webhooks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:read"],"responses":{"200":{"description":"Webhook registrations.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWebhookList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"operationId":"createLegacyWebhook","summary":"Create a Webhook","description":"Registers up to three Webhook endpoints per organization. An existing URL is returned idempotently. Lifecycle delivery is best-effort: one attempt, no retry, and failures may be dropped. Required scope: `webhooks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateWebhookRequest"}}}},"responses":{"201":{"description":"Webhook registration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWebhookCreated"}}}},"400":{"description":"The body is invalid or the organization already has three Webhooks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{id}":{"get":{"tags":["Webhooks"],"operationId":"getLegacyWebhook","summary":"Get a Webhook","description":"Returns one organization-owned Webhook registration. Required scope: `webhooks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook registration ID.","schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook registration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWebhook"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"operationId":"deleteLegacyWebhook","summary":"Delete a Webhook","description":"Deletes a Webhook registration. Required scope: `webhooks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["webhooks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook registration ID.","schema":{"type":"string"}}],"responses":{"204":{"description":"Webhook deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspaces/{id}/artifacts":{"get":{"tags":["Workspace Artifacts"],"operationId":"listLegacyWorkspaceArtifacts","summary":"List Workspace artifacts","description":"Lists files produced in the Workspace artifact store and returns one-hour user-content download URLs. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Workspace artifacts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyWorkspaceArtifactList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workspace Artifacts"],"operationId":"deleteAllLegacyWorkspaceArtifacts","summary":"Delete all Workspace artifacts","description":"Deletes every file in the Workspace artifact store. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"All artifacts deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/workspaces/{id}/artifacts/{filename}":{"get":{"tags":["Workspace Artifacts"],"operationId":"downloadLegacyWorkspaceArtifact","summary":"Download a Workspace artifact","description":"Streams one artifact with a Content-Disposition attachment header. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}},{"name":"filename","in":"path","required":true,"description":"Artifact filename, URL encoded as one path segment.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Artifact bytes. Content-Type is derived from the filename.","headers":{"Content-Disposition":{"description":"Attachment filename.","schema":{"type":"string"}}},"content":{"*/*":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Workspace Artifacts"],"operationId":"deleteLegacyWorkspaceArtifact","summary":"Delete a Workspace artifact","description":"Deletes one artifact after verifying that it exists. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}},{"name":"filename","in":"path","required":true,"description":"Artifact filename, URL encoded as one path segment.","schema":{"type":"string","minLength":1}}],"responses":{"204":{"description":"Artifact deleted. No response body."},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers":{"get":{"tags":["Agent Computers"],"operationId":"listLegacyAgentComputers","summary":"List Agent Computers","description":"Lists non-deleted organization Workspaces through the Agent Computer projection. The current route does not filter by Workspace kind. List items intentionally omit Microsandbox credentials. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum records to return. The server clamps the value to 1 through 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"offset","in":"query","required":false,"description":"Number of records to skip.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Paginated Agent Computers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerList"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Agent Computers"],"operationId":"createLegacyAgentComputer","summary":"Create an Agent Computer","description":"Creates a persistent Workspace. Provisioning is asynchronous unless `db9_enabled` is true; the caller can poll GET until `sandboxId` is non-null. The DB9 path waits for provisioning and returns its API key once. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyCreateAgentComputerRequest"}}}},"responses":{"201":{"description":"Agent Computer created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerCreated"}}}},"400":{"description":"A path, query, or JSON body value is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers/{id}":{"get":{"tags":["Agent Computers"],"operationId":"getLegacyAgentComputer","summary":"Get an Agent Computer","description":"Returns details, Microsandbox connection settings, Agent configuration, and up to ten recent Tasks. Required scope: `tasks:read`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Agent Computer details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerDetail"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Agent Computers"],"operationId":"updateLegacyAgentComputer","summary":"Configure an Agent Computer","description":"Updates its Workspace Agent instructions and/or toggles MCPServerViews by ID. An empty body reads back the current configuration. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyUpdateAgentComputerRequest"}}}},"responses":{"200":{"description":"Resulting Agent configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyAgentComputerConfiguration"}}}},"400":{"description":"The body is invalid or a requested MCPServerView does not belong to this Workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The requested resource was not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers/{id}/db9/api-key":{"post":{"tags":["Agent Computers"],"operationId":"mintLegacyAgentComputerDb9ApiKey","summary":"Mint a DB9 API key","description":"Mints a new full-account DB9 key inside a ready, DB9-enabled Agent Computer. The token is returned once and is not stored by the Relay. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"New DB9 API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyDb9ApiKey"}}}},"400":{"description":"DB9 is not enabled for this Agent Computer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The Agent Computer does not exist or its VM is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agent-computers/{id}/db9/share-token":{"post":{"tags":["Agent Computers"],"operationId":"mintLegacyAgentComputerDb9ShareToken","summary":"Mint a DB9 share token","description":"Mints a new read-write share token for the ready Agent Computer Workspace database. Required scope: `tasks:write`.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"Workspace or Agent Computer ID.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"New DB9 share token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyDb9ShareToken"}}}},"400":{"description":"DB9 is not enabled for this Agent Computer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, invalid, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The Agent Computer does not exist or its VM is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"An unexpected server error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/context-lake/config":{"get":{"tags":["Context Lake"],"operationId":"getContextLakeConfig","summary":"Get the Context Lake configuration","description":"Returns both the serialized YAML and the structured configuration assembled from the organization's datasets and views.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Current Context Lake configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeConfigResponse"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"Configuration loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"patch":{"tags":["Context Lake"],"operationId":"patchContextLakeConfig","summary":"Apply an atomic partial configuration update","description":"Applies removals, additions, then updates; validates the resulting config; persists it; and redeploys SpiceD. Dataset params and view acceleration objects are shallow replacements, not deep merges.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakePatchConfigRequest"}}}},"responses":{"200":{"description":"Configuration applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeMutationResult"}}}},"400":{"description":"The requested operations failed or the resulting configuration was invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/datasets":{"get":{"tags":["Context Lake"],"operationId":"listContextLakeDatasets","summary":"List datasets","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Configured datasets.","content":{"application/json":{"schema":{"type":"object","required":["datasets"],"properties":{"datasets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeDataset"}}},"additionalProperties":false}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"Dataset loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"post":{"tags":["Context Lake"],"operationId":"createContextLakeDataset","summary":"Create a dataset","description":"Adds a dataset, validates the full configuration, persists it, and redeploys SpiceD. Enabling notifications may also return SQS setup information.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateDatasetRequest"}}}},"responses":{"201":{"description":"Dataset created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateDatasetResult"}}}},"400":{"description":"The dataset already exists, has invalid connector parameters, or could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/datasets/{name}":{"put":{"tags":["Context Lake"],"operationId":"updateContextLakeDataset","summary":"Update a dataset","description":"Shallow-merges the supplied fields into the named dataset, then validates, persists, and redeploys the full configuration. A supplied params object replaces the previous params object.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeUpdateDatasetRequest"}}}},"responses":{"200":{"description":"Dataset updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeMutationResult"}}}},"400":{"description":"The dataset was not found, the update was invalid, or the configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"delete":{"tags":["Context Lake"],"operationId":"deleteContextLakeDataset","summary":"Delete a dataset","description":"Removes the named dataset, persists the configuration, and redeploys SpiceD.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"responses":{"204":{"description":"Dataset deleted."},"400":{"description":"The dataset was not found or the updated configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/views":{"get":{"tags":["Context Lake"],"operationId":"listContextLakeViews","summary":"List views","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Configured views.","content":{"application/json":{"schema":{"type":"object","required":["views"],"properties":{"views":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeView"}}},"additionalProperties":false}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"View loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"post":{"tags":["Context Lake"],"operationId":"createContextLakeView","summary":"Create a view","description":"Adds a view, validates the full configuration, persists it, and redeploys SpiceD.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateViewRequest"}}}},"responses":{"201":{"description":"View created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeCreateViewResult"}}}},"400":{"description":"The view already exists, is invalid, or could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/views/{name}":{"put":{"tags":["Context Lake"],"operationId":"updateContextLakeView","summary":"Update a view","description":"Shallow-merges supplied fields into the named view, then validates, persists, and redeploys the full configuration. A supplied acceleration object replaces the previous object.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeUpdateViewRequest"}}}},"responses":{"200":{"description":"View updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeBasicMutationResult"}}}},"400":{"description":"The view was not found, the update was invalid, or the configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}},"delete":{"tags":["Context Lake"],"operationId":"deleteContextLakeView","summary":"Delete a view","description":"Removes the named view, persists the configuration, and redeploys SpiceD.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"parameters":[{"name":"name","in":"path","required":true,"description":"Dataset or view name. The route performs no additional path-format validation.","schema":{"type":"string"}}],"responses":{"204":{"description":"View deleted."},"400":{"description":"The view was not found or the updated configuration could not be applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/sql":{"post":{"tags":["Context Lake"],"operationId":"queryContextLakeSql","summary":"Run a SQL query","description":"Ensures the Context Lake VM is running, waits for SpiceD to become queryable, then proxies the SQL query. The route waits for at most 180 seconds.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeSqlRequest"}}}},"responses":{"200":{"description":"SpiceD query result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeSqlResult"}}}},"400":{"description":"The query field is missing or SpiceD rejected the query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The query failed unexpectedly, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}},"504":{"description":"The VM did not become queryable within 180 seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeTimeoutError"}}}}}}},"/v1/context-lake/status":{"get":{"tags":["Context Lake"],"operationId":"getContextLakeStatus","summary":"Get VM and dataset status","description":"Returns the derived VM state and per-dataset health. An unreachable or non-running SpiceD instance is represented as dataset status error rather than failing this request.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Context Lake status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeStatus"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"Status loading failed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/start":{"post":{"tags":["Context Lake"],"operationId":"startContextLake","summary":"Start or provision the Context Lake VM","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"VM is running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeStartResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The VM could not be started, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/stop":{"post":{"tags":["Context Lake"],"operationId":"stopContextLake","summary":"Pause the Context Lake VM","description":"Succeeds even when no provisioned VM exists.","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"VM is paused or no VM existed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeBasicMutationResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The VM could not be paused, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/context-lake/redeploy":{"post":{"tags":["Context Lake"],"operationId":"redeployContextLake","summary":"Redeploy the Context Lake configuration","security":[{"ApiKey":[]}],"x-required-scopes":[],"x-rebyte-policy":{"subscription":"pro"},"responses":{"200":{"description":"Configuration redeployed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeBasicMutationResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Context Lake requires an active Pro subscription. This route does not require a named API-key scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextLakeError"}}}},"500":{"description":"The configuration could not be redeployed, or API-key validation failed before the route ran.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Error"},{"$ref":"#/components/schemas/ContextLakeError"}]}}}}}}},"/v1/accounts":{"get":{"tags":["Partner API"],"operationId":"listHeadlessAccounts","summary":"List partner-created headless accounts","description":"Restricted Partner API. Returns headless accounts linked to the caller as their owning partner.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","responses":{"200":{"description":"Partner-created headless accounts.","content":{"application/json":{"schema":{"type":"object","required":["accounts"],"properties":{"accounts":{"type":"array","items":{"$ref":"#/components/schemas/HeadlessAccount"}}},"additionalProperties":false}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Partner API"],"operationId":"createHeadlessAccount","summary":"Create a headless account","description":"Restricted Partner API. Creates an API-only child account and returns its plaintext rbk_ API key exactly once. A headless caller cannot create another sub-account.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHeadlessAccountRequest"}}}},"responses":{"201":{"description":"Headless account and one-time API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHeadlessAccountResult"}}}},"400":{"description":"The JSON request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks accounts:write, or a headless account attempted to create a sub-account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/{id}/billing":{"patch":{"tags":["Partner API"],"operationId":"updateHeadlessAccountBilling","summary":"Change an account billing mode","description":"Restricted Partner API. The caller may update itself or an account linked to it as the owning partner.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","parameters":[{"name":"id","in":"path","required":true,"description":"Account ID. The caller may manage only itself or an account linked to it as the owning partner.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountBillingRequest"}}}},"responses":{"200":{"description":"Billing mode updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccountBillingResult"}}}},"400":{"description":"The JSON request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks accounts:write, or the account is not owned by this partner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The account does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/credits":{"get":{"tags":["Billing"],"operationId":"getBillingCredits","summary":"Get available credits","description":"Returns the caller account, the account actually billed after parent-billing resolution, and purchased plus expiring credit balances.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"responses":{"200":{"description":"Current credit balances.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingCredits"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/topups":{"post":{"tags":["Partner API"],"operationId":"createPartnerBillingTopup","summary":"Top up an account","description":"Restricted Partner API. externalPaymentId is the idempotency identity within the calling partner: a replay returns 200 and does not add credits twice; a newly processed top-up returns 201.","security":[{"ApiKey":[]}],"x-required-scopes":["accounts:write"],"x-rebyte-audience":"partner","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBillingTopupRequest"}}}},"responses":{"200":{"description":"The external payment was already processed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReplayedBillingTopupResult"}}}},"201":{"description":"Credits added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedBillingTopupResult"}}}},"400":{"description":"The JSON request body failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks accounts:write, or the target account is not owned by this partner.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sandbox/api-key":{"get":{"tags":["Sandbox"],"operationId":"getSandboxApiKey","summary":"Get direct Sandbox gateway credentials","description":"Returns the organization's plaintext Microsandbox credential and gateway URL for direct SDK access. The reported expiry is the service's fixed non-expiring compatibility timestamp.","security":[{"ApiKey":[]}],"x-required-scopes":["tasks:read"],"responses":{"200":{"description":"Sandbox gateway credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxApiKeyResult"}}}},"401":{"description":"The API key is missing, invalid, expired, or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The API key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API-key validation or the route failed unexpectedly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"API_KEY","description":"Organization API key. See each operation's x-required-scopes extension; header aliases api-key and x-api-key are also accepted."},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"rbk_...","description":"Organization API key as a Bearer token. This is the form used by the official OpenAI SDK."}},"schemas":{"LegacyTaskFileReference":{"type":"object","required":["id","filename"],"properties":{"id":{"type":"string","description":"Temporary file ID returned by POST /v1/files."},"filename":{"type":"string","description":"Normalized filename returned by POST /v1/files."}},"additionalProperties":false},"LegacyCreateTaskRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":100000},"workspaceId":{"type":"string","format":"uuid","description":"Existing organization Workspace to reuse. Agent API Session Workspaces are rejected."},"agentProfileId":{"type":"string","format":"uuid","description":"Organization Agent Profile copied when a new Workspace is created."},"githubUrl":{"type":"string"},"branchName":{"type":"string"},"files":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskFileReference"}},"skills":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300}}},"additionalProperties":false},"LegacyFollowUpRequest":{"type":"object","required":["prompt"],"properties":{"prompt":{"type":"string","minLength":1,"maxLength":100000},"skills":{"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"files":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskFileReference"}}},"additionalProperties":false},"LegacyTaskCreated":{"type":"object","required":["id","workspaceId","url","status","createdAt","promptId","warnings"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"status":{"type":"string","const":"running"},"createdAt":{"type":"string","format":"date-time"},"promptId":{"type":"string","format":"uuid"},"agentMessageId":{"type":"string"},"warnings":{"type":"array","description":"Non-fatal setup warnings; the Task was still accepted.","items":{"type":"string"}}},"additionalProperties":false},"LegacyTaskSummary":{"type":"object","required":["id","url","title","createdAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyTaskList":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskSummary"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer"},"offset":{"type":"integer"}},"additionalProperties":false},"LegacyTaskPromptSummary":{"type":"object","required":["id","status","submittedAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","running","succeeded","failed","canceled"]},"submittedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyTask":{"type":"object","required":["id","url","status","title","createdAt","completedAt","prompts"],"properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"title":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"prompts":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskPromptSummary"}}},"additionalProperties":false},"LegacyTaskEvent":{"type":"object","required":["seq","timestamp","promptId","eventType","payload"],"properties":{"seq":{"type":"integer","minimum":0},"timestamp":{"type":"number","description":"Event timestamp in Unix milliseconds."},"promptId":{"type":"string"},"eventType":{"type":"string","enum":["init","thinking","tool_use","tool_result","ask_user_question","text","result"]},"eventKey":{"type":"string","description":"Stable identity for deduplication; sequence numbers may change when an event is synthesized later."},"payload":{"type":"object","additionalProperties":true}},"additionalProperties":false},"LegacyTaskTranscriptPrompt":{"type":"object","required":["id","status","userPrompt","response","submittedAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","succeeded","failed","canceled","paused"]},"userPrompt":{"type":"string"},"response":{"type":["string","null"]},"submittedAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskEvent"}}},"additionalProperties":false},"LegacyTaskContent":{"type":"object","required":["id","status","prompts"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"prompts":{"type":"array","items":{"$ref":"#/components/schemas/LegacyTaskTranscriptPrompt"}}},"additionalProperties":false},"LegacyFollowUpAccepted":{"type":"object","required":["promptId","visibility","warnings"],"properties":{"promptId":{"type":"string","format":"uuid"},"visibility":{"type":"string","enum":["visible","pending"]},"agentMessageId":{"type":"string"},"workflowId":{"type":"string"},"steeringSignaledMessageId":{"type":"string"},"warnings":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"LegacyVisibilityRequest":{"type":"object","required":["visibility"],"properties":{"visibility":{"type":"string","enum":["private","shared","public"]}},"additionalProperties":false},"LegacyVisibility":{"type":"object","required":["visibility"],"properties":{"visibility":{"type":"string","enum":["private","shared","public"]},"shareUrl":{"type":"string","format":"uri","description":"Present when visibility is public."}},"additionalProperties":false},"LegacyTaskStreamDone":{"type":"object","required":["status","lastSeq","finalResult"],"properties":{"status":{"type":"string","enum":["running","succeeded","failed","canceled"]},"lastSeq":{"type":"integer","minimum":0},"errorMessage":{"type":"string"},"finalResult":{"type":"string"}},"additionalProperties":false},"LegacySubPromptEvents":{"type":"object","required":["promptId","events"],"properties":{"promptId":{"type":"string"},"events":{"type":"array","items":{"type":"object","required":["seq","eventType","payload","timestamp"],"properties":{"seq":{"type":"number"},"eventType":{"type":"string"},"payload":{},"timestamp":{"type":"number"},"promptId":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":false},"LegacyCancelTaskResult":{"type":"object","required":["id","status","canceledPrompts","canceledSandboxPrompts"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","const":"canceled"},"canceledPrompts":{"type":"integer","minimum":0},"canceledSandboxPrompts":{"type":"integer","minimum":0}},"additionalProperties":false},"LegacyTaskAnswerRequest":{"type":"object","required":["messageId","actionId","answer"],"properties":{"messageId":{"type":"string","minLength":1},"actionId":{"type":"number"},"answer":{"description":"Any JSON value, including null."}},"additionalProperties":false},"LegacyTaskAnswerResult":{"type":"object","required":["ok","workflowId"],"properties":{"ok":{"type":"boolean","const":true},"workflowId":{"type":"string"}},"additionalProperties":false},"LegacyCreateFileRequest":{"type":"object","required":["filename"],"properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"contentType":{"type":"string","default":"application/octet-stream"}},"additionalProperties":false},"LegacyFileUpload":{"type":"object","required":["id","filename","uploadUrl","maxFileSize"],"properties":{"id":{"type":"string","format":"uuid"},"filename":{"type":"string"},"uploadUrl":{"type":"string","format":"uri","description":"Signed PUT URL valid for one hour. Upload using the requested Content-Type."},"maxFileSize":{"type":"integer","const":209715200,"description":"Maximum upload size in bytes."}},"additionalProperties":false},"LegacyWebhookEvent":{"type":"string","enum":["task.created","task.running","task.completed","task.failed","task.canceled"]},"LegacyCreateWebhookRequest":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/LegacyWebhookEvent"}},"description":{"type":"string","maxLength":500},"secret":{"type":"string","maxLength":500,"writeOnly":true,"description":"Optional value echoed in X-Webhook-Secret on deliveries; never returned."}},"additionalProperties":false},"LegacyWebhook":{"type":"object","required":["id","url","events","description","hasSecret","isActive","createdAt","failureCount"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWebhookEvent"}},"description":{"type":["string","null"]},"hasSecret":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"lastTriggeredAt":{"type":"string","format":"date-time"},"failureCount":{"type":"integer","minimum":0}},"additionalProperties":false},"LegacyWebhookCreated":{"type":"object","required":["id","url","events","description","hasSecret","isActive","createdAt"],"properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWebhookEvent"}},"description":{"type":["string","null"]},"hasSecret":{"type":"boolean"},"isActive":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"LegacyWebhookList":{"type":"object","required":["webhooks"],"properties":{"webhooks":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWebhook"}}},"additionalProperties":false},"LegacyWorkspaceArtifact":{"type":"object","required":["name","size","contentType","downloadUrl"],"properties":{"name":{"type":"string"},"size":{"type":"integer","minimum":0},"contentType":{"type":"string"},"downloadUrl":{"type":"string","format":"uri","description":"User-content isolation URL valid for one hour. Re-list for a fresh URL."}},"additionalProperties":false},"LegacyWorkspaceArtifactList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyWorkspaceArtifact"}}},"additionalProperties":false},"LegacyAgentComputerViewServer":{"type":"object","required":["type","internalName","remoteId"],"properties":{"type":{"type":"string","enum":["internal","remote"]},"internalName":{"type":["string","null"]},"remoteId":{"type":["string","null"]}},"additionalProperties":false},"LegacyAgentComputerView":{"type":"object","required":["id","name","enabled","server"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"enabled":{"type":"boolean"},"server":{"$ref":"#/components/schemas/LegacyAgentComputerViewServer"}},"additionalProperties":false},"LegacyAgentComputerBase":{"type":"object","required":["id","name","sandboxId","icon","url","db9Enabled","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"sandboxId":{"type":["string","null"]},"icon":{"type":["string","null"]},"url":{"type":"string","format":"uri"},"db9Enabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"LegacyAgentComputerSummary":{"allOf":[{"$ref":"#/components/schemas/LegacyAgentComputerBase"}],"unevaluatedProperties":false},"LegacyDb9ApiKey":{"type":"object","required":["id","name","token","createdAt","expiresAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"token":{"type":"string","readOnly":true,"description":"Sensitive credential returned once by the mint operation."},"createdAt":{"type":["string","null"],"format":"date-time"},"expiresAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyCreateAgentComputerRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"default":"Agent Computer"},"icon":{"type":"string","maxLength":50},"agent_instructions":{"type":["string","null"],"maxLength":100000},"agent_profile_id":{"type":"string","format":"uuid"},"db9_enabled":{"type":"boolean","default":false,"description":"When true, creation waits for provisioning and returns a one-shot DB9 API key."}},"additionalProperties":false},"LegacyAgentComputerCreated":{"allOf":[{"$ref":"#/components/schemas/LegacyAgentComputerBase"},{"type":"object","required":["sandboxBaseUrl","sandboxApiKey","agentInstructions","views"],"properties":{"sandboxBaseUrl":{"type":"string","format":"uri"},"sandboxApiKey":{"type":"string","readOnly":true,"description":"Sensitive organization-level Microsandbox credential returned to the caller."},"agentInstructions":{"type":["string","null"]},"views":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerView"}},"db9ApiKey":{"anyOf":[{"$ref":"#/components/schemas/LegacyDb9ApiKey"},{"type":"null"}],"description":"Returned once when db9_enabled is true."}}}],"unevaluatedProperties":false},"LegacyAgentComputerList":{"type":"object","required":["data","total","limit","offset"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerSummary"}},"total":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":100},"offset":{"type":"integer","minimum":0}},"additionalProperties":false},"LegacyAgentComputerRecentTask":{"type":"object","required":["id","title","status","createdAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed","canceled"]},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"LegacyAgentComputerDetail":{"allOf":[{"$ref":"#/components/schemas/LegacyAgentComputerBase"},{"type":"object","required":["sandboxBaseUrl","sandboxApiKey","agentInstructions","views","taskCount","recentTasks"],"properties":{"sandboxBaseUrl":{"type":"string","format":"uri"},"sandboxApiKey":{"type":"string","readOnly":true,"description":"Sensitive organization-level Microsandbox credential returned to the caller."},"agentInstructions":{"type":["string","null"]},"views":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerView"}},"taskCount":{"type":"integer","minimum":0},"recentTasks":{"type":"array","maxItems":10,"items":{"$ref":"#/components/schemas/LegacyAgentComputerRecentTask"}}}}],"unevaluatedProperties":false},"LegacyUpdateAgentComputerRequest":{"type":"object","properties":{"agent_instructions":{"type":["string","null"],"maxLength":100000},"views":{"type":"object","description":"Map of MCPServerView ID to enabled state.","additionalProperties":{"type":"boolean"}}},"additionalProperties":false},"LegacyAgentComputerConfiguration":{"type":"object","required":["id","agentInstructions","views"],"properties":{"id":{"type":"string","format":"uuid"},"agentInstructions":{"type":["string","null"]},"views":{"type":"array","items":{"$ref":"#/components/schemas/LegacyAgentComputerView"}}},"additionalProperties":false},"LegacyDb9ShareToken":{"type":"object","required":["token","expiresAt"],"properties":{"token":{"type":"string","readOnly":true,"description":"Sensitive share credential returned by the mint operation."},"expiresAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"ContextLakeValidationIssue":{"type":"object","required":["path","message"],"properties":{"path":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false},"ContextLakeError":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeValidationIssue"}}},"additionalProperties":false},"ContextLakeTimeoutError":{"type":"object","required":["error","timeout"],"properties":{"error":{"type":"string"},"timeout":{"type":"integer","const":180000}},"additionalProperties":false},"ContextLakeDataset":{"type":"object","required":["from","name"],"properties":{"from":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}},"notifications":{"type":"boolean"}},"additionalProperties":true},"ContextLakeViewAcceleration":{"type":"object","required":["enabled"],"properties":{"enabled":{"type":"boolean"},"engine":{"type":"string"},"mode":{"type":"string"},"refresh_mode":{"type":"string"},"refresh_check_interval":{"type":"string"},"refresh_retry_enabled":{"type":"boolean"},"refresh_retry_max_attempts":{"type":"integer"},"refresh_jitter_enabled":{"type":"boolean"}},"additionalProperties":true},"ContextLakeView":{"type":"object","required":["name","sql"],"properties":{"name":{"type":"string"},"sql":{"type":"string"},"acceleration":{"$ref":"#/components/schemas/ContextLakeViewAcceleration"}},"additionalProperties":true},"ContextLakeSecret":{"type":"object","required":["from","name"],"properties":{"from":{"type":"string"},"name":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}}},"additionalProperties":true},"ContextLakeConfig":{"type":"object","required":["version","kind","name"],"properties":{"version":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"secrets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeSecret"}},"runtime":{"type":"object","additionalProperties":true},"datasets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeDataset"}},"views":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeView"}},"x-rebyte":{"type":"object","properties":{"notifications":{"type":"object","properties":{"s3_datasets":{"type":"array","items":{"type":"object","required":["name","from"],"properties":{"name":{"type":"string"},"from":{"type":"string"}},"additionalProperties":false}}},"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":true},"ContextLakeConfigResponse":{"type":"object","required":["yaml","config"],"properties":{"yaml":{"type":"string"},"config":{"$ref":"#/components/schemas/ContextLakeConfig"}},"additionalProperties":false},"ContextLakeDatasetUpdate":{"type":"object","properties":{"from":{"type":"string"},"mode":{"type":"string"},"params":{"type":"object","additionalProperties":{"type":"string"}},"notifications":{"type":"boolean"}},"additionalProperties":true},"ContextLakeViewUpdate":{"type":"object","properties":{"sql":{"type":"string"},"acceleration":{"$ref":"#/components/schemas/ContextLakeViewAcceleration"}},"additionalProperties":true},"ContextLakePatchConfigRequest":{"type":"object","properties":{"addDatasets":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeDataset"}},"removeDatasets":{"type":"array","items":{"type":"string"}},"updateDatasets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ContextLakeDatasetUpdate"}},"addViews":{"type":"array","items":{"$ref":"#/components/schemas/ContextLakeView"}},"removeViews":{"type":"array","items":{"type":"string"}},"updateViews":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ContextLakeViewUpdate"}}},"additionalProperties":true},"ContextLakeNotificationInfo":{"type":"object","required":["queueArn","region","instructions"],"properties":{"queueArn":{"type":"string"},"region":{"type":"string"},"instructions":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"ContextLakeBasicMutationResult":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true}},"additionalProperties":false},"ContextLakeMutationResult":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","const":true},"notifications":{"$ref":"#/components/schemas/ContextLakeNotificationInfo"}},"additionalProperties":false},"ContextLakeCreateDatasetRequest":{"allOf":[{"$ref":"#/components/schemas/ContextLakeDataset"},{"type":"object","required":["from","name"]}]},"ContextLakeUpdateDatasetRequest":{"$ref":"#/components/schemas/ContextLakeDatasetUpdate"},"ContextLakeCreateDatasetResult":{"type":"object","required":["ok","dataset"],"properties":{"ok":{"type":"boolean","const":true},"dataset":{"$ref":"#/components/schemas/ContextLakeDataset"},"notifications":{"$ref":"#/components/schemas/ContextLakeNotificationInfo"}},"additionalProperties":false},"ContextLakeCreateViewRequest":{"allOf":[{"$ref":"#/components/schemas/ContextLakeView"},{"type":"object","required":["name","sql"]}]},"ContextLakeUpdateViewRequest":{"$ref":"#/components/schemas/ContextLakeViewUpdate"},"ContextLakeCreateViewResult":{"type":"object","required":["ok","view"],"properties":{"ok":{"type":"boolean","const":true},"view":{"type":"object","required":["name","sql"],"properties":{"name":{"type":"string"},"sql":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false},"ContextLakeSqlRequest":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1}},"additionalProperties":true},"ContextLakeSqlResult":{"type":"object","required":["rows"],"properties":{"rows":{"description":"The JSON value returned by SpiceD. It is normally an array of row objects."}},"additionalProperties":false},"ContextLakeDatasetStatus":{"type":"object","required":["ok","status","connectorId","notifications"],"properties":{"ok":{"type":"boolean"},"status":{"type":"string","enum":["ready","error"]},"connectorId":{"type":"string"},"notifications":{"type":"boolean"},"s3LastEventAt":{"type":["string","null"],"format":"date-time"},"s3LastRefreshAt":{"type":["string","null"],"format":"date-time"},"s3EventCount":{"type":["integer","null"]}},"additionalProperties":false},"ContextLakeStatus":{"type":"object","required":["vmStatus","datasets"],"properties":{"vmStatus":{"type":"string","enum":["not_provisioned","paused","running","provisioning"]},"datasets":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ContextLakeDatasetStatus"}}},"additionalProperties":false},"ContextLakeStartResult":{"type":"object","required":["sandboxId","status"],"properties":{"sandboxId":{"type":"string"},"status":{"type":"string","const":"running"}},"additionalProperties":false},"CreateHeadlessAccountRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"billToParent":{"type":"boolean"}},"additionalProperties":true},"CreateHeadlessAccountResult":{"type":"object","required":["id","name","api_key"],"properties":{"id":{"type":"string","pattern":"^acct_[A-Za-z0-9_-]{27}$"},"name":{"type":"string"},"api_key":{"type":"string","pattern":"^rbk_[0-9a-f]{40}$","description":"Plaintext organization API key. Returned only in this response."}},"additionalProperties":false},"HeadlessAccount":{"type":"object","required":["id","name","type","status","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"UpdateAccountBillingRequest":{"type":"object","required":["billToParent"],"properties":{"billToParent":{"type":"boolean"}},"additionalProperties":true},"UpdateAccountBillingResult":{"type":"object","required":["id","billToParent"],"properties":{"id":{"type":"string"},"billToParent":{"type":"boolean"}},"additionalProperties":false},"BillingCredits":{"type":"object","required":["accountId","billingOrgId","balance","expiringBalance","expiringAllowance","totalAvailable","lifetimePurchased","lifetimeUsed","updatedAt"],"properties":{"accountId":{"type":"string"},"billingOrgId":{"type":"string"},"balance":{"type":"integer"},"expiringBalance":{"type":"integer"},"expiringAllowance":{"type":"integer"},"totalAvailable":{"type":"integer"},"lifetimePurchased":{"type":"integer"},"lifetimeUsed":{"type":"integer"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"CreateBillingTopupRequest":{"type":"object","required":["accountId","amount","externalPaymentId"],"properties":{"accountId":{"type":"string","minLength":1},"amount":{"type":"integer","minimum":1},"externalPaymentId":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":500},"metadata":{"type":"object","additionalProperties":true}},"additionalProperties":true},"CreatedBillingTopupResult":{"type":"object","required":["success","accountId","billingOrgId","amount","newBalance","transactionId"],"properties":{"success":{"type":"boolean","const":true},"accountId":{"type":"string"},"billingOrgId":{"type":"string"},"amount":{"type":"integer","minimum":1},"newBalance":{"type":"integer"},"transactionId":{"type":["string","null"],"format":"uuid"}},"additionalProperties":false},"ReplayedBillingTopupResult":{"type":"object","required":["success","alreadyProcessed","accountId","billingOrgId","amount","newBalance","updatedAt"],"properties":{"success":{"type":"boolean","const":true},"alreadyProcessed":{"type":"boolean","const":true},"accountId":{"type":"string"},"billingOrgId":{"type":"string"},"amount":{"type":"integer","minimum":1},"newBalance":{"type":"integer"},"updatedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"SandboxApiKeyResult":{"type":"object","required":["apiKey","baseUrl","expiresAt"],"properties":{"apiKey":{"type":"string","minLength":1,"description":"Plaintext organization Microsandbox API key."},"baseUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"ResponseOutputText":{"type":"object","required":["type","text","annotations"],"properties":{"type":{"type":"string","const":"output_text"},"text":{"type":"string"},"annotations":{"type":"array","items":{}}},"additionalProperties":false},"ResponseOutputMessage":{"type":"object","required":["id","type","status","role","phase","content"],"properties":{"id":{"type":"string","description":"Opaque message output ID, stable across SSE and retrieval."},"type":{"type":"string","const":"message"},"status":{"type":"string","const":"completed"},"role":{"type":"string","const":"assistant"},"phase":{"type":"string","enum":["commentary","final_answer"]},"content":{"type":"array","items":{"$ref":"#/components/schemas/ResponseOutputText"}}},"additionalProperties":false},"ResponseMcpCall":{"type":"object","required":["id","type","server_label","name","arguments","output","error","status"],"properties":{"id":{"type":"string","pattern":"^mcp_[0-9a-fA-F-]{36}_[0-9]+$"},"type":{"type":"string","const":"mcp_call"},"server_label":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"arguments":{"type":"string","description":"JSON-encoded tool arguments."},"output":{"type":["string","null"],"description":"JSON-encoded tool output."},"error":{"type":["string","null"]},"status":{"type":"string","enum":["in_progress","completed","incomplete","failed"]}},"additionalProperties":false},"ResponseFunctionCall":{"type":"object","required":["id","type","call_id","name","arguments","status"],"properties":{"id":{"type":"string","pattern":"^fc_[0-9a-fA-F-]{36}_[0-9]+$"},"type":{"type":"string","const":"function_call"},"call_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"arguments":{"type":"string","description":"JSON-encoded function arguments."},"status":{"type":"string","const":"completed"}},"additionalProperties":false},"CreateConversationItemsRequest":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","const":"function_call_output"},"call_id":{"type":"string","minLength":1,"maxLength":512,"description":"The call_id of a client function_call produced by this Conversation."},"output":{"type":"string","maxLength":1000000,"description":"The client-executed function result. Free text and JSON-encoded text are both accepted."}},"required":["type","call_id","output"],"additionalProperties":false},"minItems":1,"maxItems":20,"description":"Completed outputs for distinct pending client function calls in this Conversation.","x-unique-by":"call_id"}},"required":["items"],"additionalProperties":false},"ConversationFunctionCallOutput":{"type":"object","required":["id","type","call_id","output","status"],"properties":{"id":{"type":"string","pattern":"^fco_[0-9]+$","description":"Stable ID of the persisted function call output item."},"type":{"type":"string","const":"function_call_output"},"call_id":{"type":"string","minLength":1,"maxLength":512},"output":{"type":"string","maxLength":1000000},"status":{"type":"string","const":"completed"}},"additionalProperties":false},"ConversationItemList":{"type":"object","required":["object","data","first_id","last_id","has_more"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"#/components/schemas/ConversationFunctionCallOutput"}},"first_id":{"type":"string","pattern":"^fco_[0-9]+$"},"last_id":{"type":"string","pattern":"^fco_[0-9]+$"},"has_more":{"type":"boolean","const":false}},"additionalProperties":false},"ResponseFunctionTool":{"type":"object","required":["type","name","description","parameters","strict"],"properties":{"type":{"type":"string","const":"function"},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"description":{"type":"string","minLength":1,"pattern":"\\S"},"parameters":{"type":"object","additionalProperties":true,"description":"JSON Schema for this persistent Agent client tool. The supported bounded subset requires a root object and additionalProperties false. With strict true, every property must be required; with strict false, required may be omitted or contain any unique subset of declared properties."},"strict":{"type":"boolean","description":"Whether to enable provider strict Structured Outputs. False preserves optional-property semantics within the supported JSON Schema subset."}},"additionalProperties":false},"ResponseUsage":{"type":"object","required":["input_tokens","input_tokens_details","output_tokens","output_tokens_details","total_tokens"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"total_tokens":{"type":"integer","minimum":0},"input_tokens_details":{"type":"object","required":["cached_tokens","cache_write_tokens"],"properties":{"cached_tokens":{"type":"integer","minimum":0},"cache_write_tokens":{"type":"integer","minimum":0}},"additionalProperties":false},"output_tokens_details":{"type":"object","required":["reasoning_tokens"],"properties":{"reasoning_tokens":{"type":"integer","minimum":0}},"additionalProperties":false}},"additionalProperties":false},"Response":{"type":"object","required":["id","object","created_at","status","background","completed_at","error","incomplete_details","instructions","max_output_tokens","metadata","model","output","output_text","parallel_tool_calls","previous_response_id","reasoning","store","temperature","text","tool_choice","tools","top_p","truncation","usage","conversation"],"properties":{"id":{"type":"string","pattern":"^resp_[0-9a-fA-F-]{36}$"},"object":{"type":"string","const":"response"},"created_at":{"type":"integer","minimum":0},"status":{"type":"string","enum":["queued","in_progress","completed","failed"]},"background":{"type":"boolean","const":false},"completed_at":{"type":["integer","null"],"minimum":0},"error":{"oneOf":[{"type":"null"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"additionalProperties":false}]},"incomplete_details":{"type":"null"},"instructions":{"type":"null"},"max_output_tokens":{"type":"null"},"metadata":{"type":"object","additionalProperties":false},"model":{"type":"string","format":"uuid","description":"Rebyte Agent ID."},"output":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/ResponseMcpCall"},{"$ref":"#/components/schemas/ResponseFunctionCall"},{"$ref":"#/components/schemas/ResponseOutputMessage"}]}},"output_text":{"type":"string","description":"Concatenated text from every assistant output message, in output order."},"parallel_tool_calls":{"type":"boolean","const":true},"previous_response_id":{"type":["string","null"],"pattern":"^resp_[0-9a-fA-F-]{36}$"},"reasoning":{"type":"null"},"store":{"type":"boolean","const":true},"temperature":{"type":"null"},"text":{"type":"object","required":["format"],"properties":{"format":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"text"}},"additionalProperties":false}},"additionalProperties":false},"tool_choice":{"type":"string","const":"auto"},"tools":{"type":"array","maxItems":64,"description":"Persistent client-executed function definitions configured on the Agent.","items":{"$ref":"#/components/schemas/ResponseFunctionTool"}},"top_p":{"type":"null"},"truncation":{"type":"string","const":"disabled"},"usage":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/ResponseUsage"}]},"conversation":{"type":"object","required":["id"],"properties":{"id":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"}},"additionalProperties":false}},"additionalProperties":false},"RunUsage":{"type":"object","required":["input_tokens","output_tokens","model_calls","tool_calls","cost_usd","credits_used"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"model_calls":{"type":"integer","minimum":0},"tool_calls":{"type":"integer","minimum":0},"cost_usd":{"type":"number","minimum":0},"credits_used":{"type":"number","minimum":0}},"additionalProperties":false},"Run":{"type":"object","required":["id","object","agent_id","conversation_id","response_id","source","status","error","started_at","ended_at","duration_ms","input","output_preview","usage","file_count"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"run"},"agent_id":{"type":"string","format":"uuid"},"conversation_id":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"},"response_id":{"type":["string","null"],"pattern":"^resp_[0-9a-fA-F-]{36}$","description":"Present when this run was created through the public Agent API; null for other product surfaces."},"source":{"type":["string","null"],"description":"Product surface that created the Conversation, such as agent_api, web, slack, or scheduled execution. Null only for legacy Runs whose source was not recorded."},"status":{"type":"string"},"error":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"duration_ms":{"type":"integer","minimum":0},"input":{"type":"string"},"output_preview":{"type":["string","null"],"maxLength":4000},"usage":{"$ref":"#/components/schemas/RunUsage"},"file_count":{"type":"integer","minimum":0}},"additionalProperties":false},"RunList":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Run"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"additionalProperties":false},"ResponseTraceFile":{"type":"object","required":["id","name","content_type","size_bytes","status","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"content_type":{"type":["string","null"]},"size_bytes":{"type":["integer","null"],"minimum":0},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"additionalProperties":false},"ResponseTraceSpan":{"type":"object","required":["id","parent_id","kind","name","status","step","started_at","ended_at","duration_ms","input_preview","output_preview","error","attributes"],"properties":{"id":{"type":"string"},"parent_id":{"type":"string"},"kind":{"type":"string","enum":["step","model","tool"]},"name":{"type":"string"},"status":{"type":"string"},"step":{"type":["integer","null"],"minimum":0},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":["string","null"],"format":"date-time"},"duration_ms":{"type":["integer","null"],"minimum":0},"input_preview":{"type":["string","null"],"maxLength":4000},"output_preview":{"type":["string","null"],"maxLength":4000},"error":{"type":["string","null"]},"attributes":{"type":"object","additionalProperties":true}},"additionalProperties":false},"ResponseTrace":{"type":"object","required":["id","object","response_id","agent_id","conversation_id","status","error","started_at","ended_at","duration_ms","input","output_preview","usage","files","data","has_more","next_cursor"],"properties":{"id":{"type":"string","pattern":"^trace_[0-9a-fA-F-]{36}$"},"object":{"type":"string","const":"trace"},"response_id":{"type":"string","pattern":"^resp_[0-9a-fA-F-]{36}$"},"agent_id":{"type":"string","format":"uuid"},"conversation_id":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"},"status":{"type":"string"},"error":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"duration_ms":{"type":"integer","minimum":0},"input":{"type":"string"},"output_preview":{"type":["string","null"],"maxLength":4000},"usage":{"type":"object","required":["input_tokens","output_tokens","model_calls","tool_calls","cost_usd","credits_used"],"properties":{"input_tokens":{"type":"integer","minimum":0},"output_tokens":{"type":"integer","minimum":0},"model_calls":{"type":"integer","minimum":0},"tool_calls":{"type":"integer","minimum":0},"cost_usd":{"type":"number","minimum":0},"credits_used":{"type":"number","minimum":0}},"additionalProperties":false},"files":{"type":"array","items":{"$ref":"#/components/schemas/ResponseTraceFile"}},"data":{"type":"array","items":{"$ref":"#/components/schemas/ResponseTraceSpan"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"additionalProperties":false},"RunTrace":{"type":"object","required":["id","object","run_id","agent_id","conversation_id","response_id","source","status","error","started_at","ended_at","duration_ms","input","output_preview","usage","files","data","has_more","next_cursor"],"properties":{"id":{"type":"string","pattern":"^trace_[0-9a-fA-F-]{36}$"},"object":{"type":"string","const":"trace"},"run_id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"conversation_id":{"type":"string","pattern":"^conv_[0-9a-fA-F-]{36}$"},"response_id":{"type":["string","null"],"pattern":"^resp_[0-9a-fA-F-]{36}$"},"source":{"type":["string","null"]},"status":{"type":"string"},"error":{"type":["string","null"]},"started_at":{"type":"string","format":"date-time"},"ended_at":{"type":"string","format":"date-time"},"duration_ms":{"type":"integer","minimum":0},"input":{"type":"string"},"output_preview":{"type":["string","null"],"maxLength":4000},"usage":{"$ref":"#/components/schemas/RunUsage"},"files":{"type":"array","items":{"$ref":"#/components/schemas/ResponseTraceFile"}},"data":{"type":"array","items":{"$ref":"#/components/schemas/ResponseTraceSpan"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"additionalProperties":false},"Agent":{"type":"object","required":["id","object","name","instructions","model","maxSteps","mcpServers","clientTools","skills","networkPolicy"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"agent"},"name":{"type":"string"},"instructions":{"type":"string"},"model":{"type":"string","enum":["deepseek-v4-pro","glm-5.3","qwen3.8-max","gemini-3.8-flash","kimi-k3","claude-sonnet-5","claude-opus-5","gpt-5.6","gpt-5.4-mini","claude-sonnet-4.5","claude-sonnet-4.6","claude-opus-4.5","claude-opus-4.6","claude-opus-4.7","claude-opus-4.8","gpt-5.5","deepseek-v4-flash","gemini-3.5-flash","qwen3-max","qwen3-max-thinking","qwen3-max-codex","glm-5","glm-5-codex","glm-5.1","glm-5.1-codex","glm-5.2","glm-5.2-codex","glm-5-turbo"],"description":"Stable canonical model id. Deprecated ids remain accepted but are not offered for new UI selections.","x-active-values":["deepseek-v4-pro","glm-5.3","qwen3.8-max","gemini-3.8-flash","kimi-k3","claude-sonnet-5","claude-opus-5","gpt-5.6","gpt-5.4-mini"],"x-deprecated-values":["claude-sonnet-4.5","claude-sonnet-4.6","claude-opus-4.5","claude-opus-4.6","claude-opus-4.7","claude-opus-4.8","gpt-5.5","deepseek-v4-flash","gemini-3.5-flash","qwen3-max","qwen3-max-thinking","qwen3-max-codex","glm-5","glm-5-codex","glm-5.1","glm-5.1-codex","glm-5.2","glm-5.2-codex","glm-5-turbo"]},"maxSteps":{"type":"integer","minimum":1,"maximum":128},"mcpServers":{"type":"array","items":{"oneOf":[{"type":"object","required":["kind","name"],"properties":{"kind":{"type":"string","const":"internal"},"name":{"type":"string","enum":["conversation_files","web_search_&_browse","sandbox","skills","coding_agent","ask_user_question","report_builder","company","scheduled_tasks","app_builder_contract","github","mock","statuspage","clari_copilot","databricks","fathom","front","gong","luma","openai_usage","productboard","salesloft","slab","ukg_ready","vanta","ashby","freshservice","sound_studio","speech_generator","snowflake","http_client","microsoft_excel","outlook","outlook_calendar"]}},"additionalProperties":false},{"type":"object","required":["kind","toolkit"],"properties":{"kind":{"type":"string","const":"composio"},"toolkit":{"type":"string"}},"additionalProperties":false},{"type":"object","required":["kind","serverId"],"properties":{"kind":{"type":"string","const":"custom"},"serverId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"Optional Agent-local alias for this remote MCP server."}},"additionalProperties":false}],"discriminator":{"propertyName":"kind"}}},"clientTools":{"type":"array","maxItems":64,"x-unique-by":"name","description":"Persistent functions declared on this Agent and executed by the calling application. Names are unique.","items":{"type":"object","required":["type","name","description","parameters","strict"],"properties":{"type":{"type":"string","const":"function"},"name":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"},"description":{"type":"string","minLength":1},"parameters":{"type":"object","additionalProperties":true,"description":"JSON Schema for this persistent Agent client tool. The supported bounded subset requires a root object and additionalProperties false. With strict true, every property must be required; with strict false, required may be omitted or contain any unique subset of declared properties."},"strict":{"type":"boolean","description":"Whether to enable provider strict Structured Outputs. False preserves optional-property semantics within the supported JSON Schema subset."}},"additionalProperties":false}},"skills":{"type":"array","items":{"type":"object","required":["repo","path"],"properties":{"repo":{"type":"string"},"path":{"type":"string"}},"additionalProperties":false}},"networkPolicy":{"description":"The current VM policy read from RVM; null in a response means the VM is not provisioned yet. Creation copies this input or the Organization default once. Updating applies directly to the existing VM; null in an update explicitly copies the current Organization default without establishing inheritance.","anyOf":[{"type":"null"},{"type":"object","required":["allow_network_egress","domain_allowlist","additional_allowed_domains","allow_public_traffic"],"properties":{"allow_network_egress":{"type":"boolean"},"domain_allowlist":{"type":"string","enum":["none","package_managers_only","all_domains"]},"additional_allowed_domains":{"type":"array","maxItems":128,"items":{"type":"string","minLength":1,"maxLength":253}},"allow_public_traffic":{"type":"boolean"}},"additionalProperties":false}]}},"additionalProperties":false},"Session":{"type":"object","required":["id","object","agentId","title","status","latestMessageId","latestMessageStatus","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"session"},"agentId":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["idle","running","paused"]},"latestMessageId":{"type":["string","null"],"format":"uuid"},"latestMessageStatus":{"type":["string","null"],"enum":["queued","running","paused","completed","failed","canceled",null]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"additionalProperties":false},"UserQuestionOption":{"type":"object","required":["label","description"],"properties":{"label":{"type":"string"},"description":{"type":["string","null"]}},"additionalProperties":false},"UserQuestionItem":{"type":"object","required":["question","options","multiSelect"],"properties":{"question":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/UserQuestionOption"}},"multiSelect":{"type":"boolean"},"input":{}},"additionalProperties":false},"UserQuestion":{"type":"object","required":["question","options","multiSelect","questions"],"properties":{"question":{"type":"string"},"options":{"type":"array","items":{"$ref":"#/components/schemas/UserQuestionOption"}},"multiSelect":{"type":"boolean"},"input":{},"questions":{"type":"array","minItems":1,"maxItems":4,"items":{"$ref":"#/components/schemas/UserQuestionItem"}}},"additionalProperties":false},"PendingAction":{"type":"object","required":["type","actionId","messageId","question"],"properties":{"type":{"type":"string","const":"ask_user_question"},"actionId":{"type":"integer","minimum":0},"messageId":{"type":"string","format":"uuid","description":"Canonical public Message ID to use in the answer endpoint."},"question":{"$ref":"#/components/schemas/UserQuestion"}},"additionalProperties":false},"Message":{"type":"object","required":["id","object","sessionId","status","parts","response","error","pendingActions","createdAt","completedAt"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"message"},"sessionId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","accepted","running","paused","completed","failed","canceled"]},"parts":{"type":"array","items":{"type":"object","required":["type","text"],"properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}},"additionalProperties":false}},"response":{"type":["string","null"]},"error":{"type":["string","null"]},"pendingActions":{"type":"array","description":"Durable unresolved HITL actions. Use these after an SSE disconnect to resume a paused Message.","items":{"$ref":"#/components/schemas/PendingAction"}},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":["string","null"],"format":"date-time"}},"additionalProperties":false},"AcceptedMessage":{"type":"object","required":["message"],"properties":{"message":{"type":"object","required":["id","object","sessionId","status","warnings"],"properties":{"id":{"type":"string","format":"uuid"},"object":{"type":"string","const":"message"},"sessionId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["running","queued"]},"warnings":{"type":"array","description":"Non-fatal setup warnings; the Message was still accepted.","items":{"type":"string"}}},"additionalProperties":false}},"additionalProperties":false},"SessionEventEnvelope":{"type":"object","required":["object","type","sessionId","channel","messageId","runId","createdAt","data"],"properties":{"object":{"type":"string","const":"session.event"},"type":{"type":"string","enum":["session.connected","session.event","message.started","message.event","message.completed","message.failed","message.canceled","message.stream_end"]},"sessionId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["conversation","message"]},"messageId":{"type":["string","null"],"format":"uuid","description":"Stable public prompt ID used by Message transcript endpoints."},"runId":{"type":["string","null"],"format":"uuid","description":"Internal execution-run correlation ID; distinct from messageId."},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object"}},"additionalProperties":false},"SessionSourceEventData":{"type":"object","required":["sourceType","step","payload"],"properties":{"sourceType":{"type":"string"},"step":{"type":["integer","null"]},"payload":{"type":"object","additionalProperties":true},"actionId":{"type":"integer","minimum":0,"description":"Present when sourceType is tool_ask_user_question; pass this value to the answer endpoint."},"question":{"$ref":"#/components/schemas/UserQuestion","description":"Present when sourceType is tool_ask_user_question."}},"allOf":[{"if":{"required":["sourceType"],"properties":{"sourceType":{"type":"string","const":"tool_ask_user_question"}}},"then":{"required":["actionId","question"]}}],"additionalProperties":false},"SessionSourceEvent":{"allOf":[{"$ref":"#/components/schemas/SessionEventEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SessionSourceEventData"}}}]},"SessionConnectedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionEventEnvelope"},{"type":"object","properties":{"type":{"type":"string","const":"session.connected"},"channel":{"type":"string","const":"conversation"},"messageId":{"type":"null"},"runId":{"type":"null"},"data":{"type":"object","required":["session"],"properties":{"session":{"$ref":"#/components/schemas/Session"}},"additionalProperties":false}}}]},"SessionRuntimeEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"session.event"},"channel":{"type":"string","const":"conversation"}}}]},"MessageStartedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.started"},"channel":{"type":"string","const":"conversation"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageRuntimeEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.event"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageCompletedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.completed"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageFailedEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.failed"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageCanceledEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.canceled"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"MessageStreamEndEvent":{"allOf":[{"$ref":"#/components/schemas/SessionSourceEvent"},{"type":"object","properties":{"type":{"type":"string","const":"message.stream_end"},"channel":{"type":"string","const":"message"},"messageId":{"type":"string","format":"uuid"},"runId":{"type":"string","format":"uuid"}}}]},"SessionEvent":{"type":"object","required":["object","type","sessionId","channel","messageId","runId","createdAt","data"],"properties":{"object":{"type":"string","const":"session.event"},"type":{"type":"string","enum":["session.connected","session.event","message.started","message.event","message.completed","message.failed","message.canceled","message.stream_end"]},"sessionId":{"type":"string","format":"uuid"},"channel":{"type":"string","enum":["conversation","message"]},"messageId":{"type":["string","null"],"format":"uuid"},"runId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object"}},"oneOf":[{"$ref":"#/components/schemas/SessionConnectedEvent"},{"$ref":"#/components/schemas/SessionRuntimeEvent"},{"$ref":"#/components/schemas/MessageStartedEvent"},{"$ref":"#/components/schemas/MessageRuntimeEvent"},{"$ref":"#/components/schemas/MessageCompletedEvent"},{"$ref":"#/components/schemas/MessageFailedEvent"},{"$ref":"#/components/schemas/MessageCanceledEvent"},{"$ref":"#/components/schemas/MessageStreamEndEvent"}],"discriminator":{"propertyName":"type","mapping":{"session.connected":"#/components/schemas/SessionConnectedEvent","session.event":"#/components/schemas/SessionRuntimeEvent","message.started":"#/components/schemas/MessageStartedEvent","message.event":"#/components/schemas/MessageRuntimeEvent","message.completed":"#/components/schemas/MessageCompletedEvent","message.failed":"#/components/schemas/MessageFailedEvent","message.canceled":"#/components/schemas/MessageCanceledEvent","message.stream_end":"#/components/schemas/MessageStreamEndEvent"}},"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{},"modelId":{"type":"string"},"balance":{"type":"number"},"required":{"type":"number"}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}