{"openapi":"3.1.0","info":{"title":"Adapt Platform API","version":"0.0.0"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A user session token, an identity session token, or an organization API key created with configId platform."},"sessionCookie":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"A Better Auth browser session. HTTPS deployments use the __Secure- cookie prefix."}},"schemas":{"HostingPermissions":{"type":"object","properties":{"volumes":{"type":"array","items":{"type":"string","enum":["read","write","use"]}},"sandboxes":{"type":"array","items":{"type":"string","enum":["read","write","use"]}},"execs":{"type":"array","items":{"type":"string","enum":["read","write","use"]}},"ingresses":{"type":"array","items":{"type":"string","enum":["read","write","use"]}},"environmentVariables":{"type":"array","items":{"type":"string","enum":["read","write","use"]},"default":[]},"images":{"type":"array","items":{"type":"string","enum":["read","write","use"]},"default":[]},"gateway":{"type":"array","items":{"type":"string","enum":["read","write","use"]},"default":[]},"modelGateway":{"type":"array","items":{"type":"string","enum":["read","write","use"]},"default":[]},"registryCredentials":{"type":"array","items":{"type":"string","enum":["read","write","use"]},"default":[]}},"required":["volumes","sandboxes","execs","ingresses"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_REQUEST","INVALID_PROVIDER_KEY","ORGANIZATION_REQUIRED","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","CONFLICT","PAYLOAD_TOO_LARGE","RATE_LIMITED","USAGE_EXCEEDED","CAPACITY_EXCEEDED","INTERNAL_ERROR","UNSUPPORTED_OPERATION","BACKEND_ERROR","SERVICE_UNAVAILABLE"]},"message":{"type":"string"},"resourceId":{"type":"string","format":"uuid"}},"required":["code","message"]}},"required":["error"]},"Caller":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["identity"]},"organizationId":{"type":"string","format":"uuid"},"identityId":{"type":"string","format":"uuid"},"identitySessionId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"memberId":{"type":"string","format":"uuid"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]}},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"}},"expiresAt":{"type":"string"}},"required":["type","organizationId","identityId","identitySessionId","userId","memberId","permissions","connections","environmentVariableSetIds","expiresAt"]},{"type":"object","properties":{"type":{"type":"string","enum":["session"]},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"role":{"type":"string"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"}},"required":["type","organizationId","userId","role","permissions"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp"]},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"connectionId":{"type":"string","format":"uuid"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"}},"required":["type","organizationId","userId","connectionId","permissions"]},{"type":"object","properties":{"type":{"type":"string","enum":["apiKey"]},"organizationId":{"type":"string","format":"uuid"},"apiKeyId":{"type":"string","format":"uuid"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"}},"required":["type","organizationId","apiKeyId","permissions"]}]},"Volume":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["provisioning","ready","unresolved","unavailable"]},"quotaBytes":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"Storage quota in bytes; null means unlimited."},"usedBytes":{"type":"integer","nullable":true,"minimum":0},"createdAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","status","quotaBytes","usedBytes","createdAt"]},"Sandbox":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"startup":{"$ref":"#/components/schemas/SandboxStartupResult"},"terminationReason":{"type":"string","nullable":true,"enum":["completed","failed","cancelled","expired",null]},"lifecycleError":{"type":"string","nullable":true},"status":{"type":"string","enum":["queued","migrating","completed","provisioning","running","stopping","stopped","restoring","hibernated","unavailable","unresolved","deleting","deleted","failed"]},"configuration":{"type":"object","properties":{"startup":{"$ref":"#/components/schemas/SandboxStartup"},"imageId":{"type":"string","format":"uuid"},"image":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[!-~]+$","default":"ubuntu:24.04"},"cpu":{"type":"integer","minimum":1,"maximum":32,"default":1},"memoryMiB":{"type":"integer","minimum":128,"maximum":65536,"default":1024},"diskMiB":{"type":"integer","minimum":0,"exclusiveMinimum":true},"ttlSeconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"mounts":{"type":"array","items":{"type":"object","properties":{"volumeId":{"type":"string","format":"uuid"},"path":{"type":"string","minLength":2,"maxLength":1024},"readOnly":{"type":"boolean","default":false}},"required":["volumeId","path"],"additionalProperties":false},"maxItems":8,"default":[]},"labels":{"type":"object","additionalProperties":{"type":"string","maxLength":256,"description":"Well-formed text without control characters"},"default":{}},"network":{"type":"object","properties":{"egress":{"type":"string","enum":["open","none","allowlist"],"default":"open","description":"open allows public internet destinations; allowlist permits listed IP/protocol/port destinations, TLS hostnames, and configured DNS while keeping endpoints available; none disables guest networking, including endpoints."},"allow":{"type":"array","items":{"type":"object","properties":{"protocol":{"type":"string","enum":["tcp","udp"]},"address":{"type":"string","maxLength":45},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["protocol","address","port"],"additionalProperties":false},"maxItems":64,"default":[]},"hostnames":{"type":"array","items":{"type":"object","properties":{"hostname":{"type":"string","maxLength":254},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["hostname","port"],"additionalProperties":false},"maxItems":64,"description":"Exact TLS hostnames and TCP ports. Enables DNS for these names only; defaults to resolver 1.1.1.1. Requires a node supporting hostname policies. No wildcards, plaintext HTTP, QUIC, ECH, or TLS upgrades."},"dns":{"type":"string","nullable":true,"maxLength":45,"description":"Public resolver for guest DNS. Defaults to 1.1.1.1 in open mode or with hostname rules; otherwise disabled. Hostname rules restrict DNS to their exact names. Without hostname rules, enabling a resolver permits any DNS name independently of IP grants. Use null to disable DNS when there are no hostname rules."}},"default":{"egress":"open","allow":[]},"additionalProperties":false}},"required":["diskMiB","ttlSeconds"]},"environmentNames":{"type":"array","items":{"type":"string"}},"environmentSources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"environmentNames":{"type":"array","items":{"type":"string"}}},"required":["id","name","version","environmentNames"]}},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","organizationId","startup","terminationReason","lifecycleError","status","configuration","environmentNames","environmentSources","createdAt","expiresAt"]},"SandboxStartupResult":{"type":"object","nullable":true,"properties":{"state":{"type":"string","enum":["starting","running","stopping","exited","failed"]},"exitCode":{"type":"integer","nullable":true},"signal":{"type":"integer","nullable":true},"error":{"type":"string","nullable":true},"stdout":{"type":"string"},"stderr":{"type":"string"},"truncated":{"type":"boolean"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["state","exitCode","signal","error","stdout","stderr","truncated","startedAt","finishedAt"]},"SandboxStartup":{"oneOf":[{"type":"object","properties":{"mode":{"type":"string","enum":["image"]},"entrypoint":{"type":"array","items":{"type":"string"},"maxItems":128},"args":{"type":"array","items":{"type":"string"},"maxItems":128},"cwd":{"type":"string","maxLength":4096},"user":{"type":"string","maxLength":256}},"required":["mode"],"additionalProperties":false},{"type":"object","properties":{"mode":{"type":"string","enum":["command"]},"argv":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":128},"cwd":{"type":"string","maxLength":4096},"user":{"type":"string","maxLength":256}},"required":["mode","argv"],"additionalProperties":false}],"description":"Omit for an interactive sandbox. Image mode runs ENTRYPOINT + CMD; command mode runs argv. The startup process owns sandbox lifetime; exit stops the VM and retains bounded output."},"CreateSandboxWithEnvironment":{"allOf":[{"$ref":"#/components/schemas/CreateSandbox"},{"type":"object","properties":{"image":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[!-~]+$"},"env":{"type":"object","additionalProperties":{"type":"string","maxLength":8192},"default":{}},"variableSetIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":16,"default":[]}},"additionalProperties":false}]},"CreateSandbox":{"type":"object","properties":{"startup":{"$ref":"#/components/schemas/SandboxStartup"},"imageId":{"type":"string","format":"uuid"},"image":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[!-~]+$","default":"ubuntu:24.04"},"cpu":{"type":"integer","minimum":1,"maximum":32,"default":1},"memoryMiB":{"type":"integer","minimum":128,"maximum":65536,"default":1024},"diskMiB":{"type":"integer","minimum":64,"maximum":131072,"default":2048},"ttlSeconds":{"type":"integer","nullable":true,"minimum":1,"maximum":86400,"default":3600,"description":"Lifetime in seconds. Defaults to 3600 when omitted; null disables automatic expiry."},"mounts":{"type":"array","items":{"type":"object","properties":{"volumeId":{"type":"string","format":"uuid"},"path":{"type":"string","minLength":2,"maxLength":1024},"readOnly":{"type":"boolean","default":false}},"required":["volumeId","path"],"additionalProperties":false},"maxItems":8,"default":[]},"labels":{"type":"object","additionalProperties":{"type":"string","maxLength":256,"description":"Well-formed text without control characters"},"default":{}},"network":{"type":"object","properties":{"egress":{"type":"string","enum":["open","none","allowlist"],"default":"open","description":"open allows public internet destinations; allowlist permits listed IP/protocol/port destinations, TLS hostnames, and configured DNS while keeping endpoints available; none disables guest networking, including endpoints."},"allow":{"type":"array","items":{"type":"object","properties":{"protocol":{"type":"string","enum":["tcp","udp"]},"address":{"type":"string","maxLength":45},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["protocol","address","port"],"additionalProperties":false},"maxItems":64,"default":[]},"hostnames":{"type":"array","items":{"type":"object","properties":{"hostname":{"type":"string","maxLength":254},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["hostname","port"],"additionalProperties":false},"maxItems":64,"description":"Exact TLS hostnames and TCP ports. Enables DNS for these names only; defaults to resolver 1.1.1.1. Requires a node supporting hostname policies. No wildcards, plaintext HTTP, QUIC, ECH, or TLS upgrades."},"dns":{"type":"string","nullable":true,"maxLength":45,"description":"Public resolver for guest DNS. Defaults to 1.1.1.1 in open mode or with hostname rules; otherwise disabled. Hostname rules restrict DNS to their exact names. Without hostname rules, enabling a resolver permits any DNS name independently of IP grants. Use null to disable DNS when there are no hostname rules."}},"default":{"egress":"open","allow":[]},"additionalProperties":false}},"additionalProperties":false},"SandboxUsageEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","nullable":true,"format":"uuid"},"apiKeyId":{"type":"string","nullable":true,"format":"uuid"},"kind":{"type":"string","enum":["sandbox"]},"sandboxId":{"type":"string","format":"uuid"},"sandboxName":{"type":"string","nullable":true},"computeNodeId":{"type":"string"},"backendVmId":{"type":"string"},"cpu":{"type":"number"},"memoryMiB":{"type":"number"},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"lastObservedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["pending","running","finished"]},"provisional":{"type":"boolean"},"observationStale":{"type":"boolean"},"usage":{"type":"object","properties":{"durationMs":{"type":"number"},"cpuMilliseconds":{"type":"number"},"memoryMiBMilliseconds":{"type":"number"}},"required":["durationMs","cpuMilliseconds","memoryMiBMilliseconds"]}},"required":["id","organizationId","userId","apiKeyId","kind","sandboxId","sandboxName","computeNodeId","backendVmId","cpu","memoryMiB","createdAt","startedAt","lastObservedAt","finishedAt","status","provisional","observationStale","usage"]},"ModelUsageEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"userId":{"type":"string","nullable":true,"format":"uuid"},"apiKeyId":{"type":"string","nullable":true,"format":"uuid"},"kind":{"type":"string","enum":["model"]},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"lastObservedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","format":"date-time"},"details":{"type":"object","properties":{"providerId":{"type":"string","format":"uuid"},"providerVersion":{"type":"integer","minimum":0,"exclusiveMinimum":true},"model":{"type":"string"},"api":{"type":"string","enum":["chat","responses","decisions","messages","generateContent","streamGenerateContent","interactions"]},"streamed":{"type":"boolean"},"principalType":{"type":"string","enum":["session","apiKey","mcp","identity"]},"principalId":{"type":"string","format":"uuid"},"identityId":{"type":"string","nullable":true,"format":"uuid"},"status":{"type":"string","enum":["succeeded","failed","cancelled"]},"errorCode":{"type":"string","nullable":true}},"required":["providerId","providerVersion","model","api","streamed","principalType","principalId","identityId","status","errorCode"]},"usage":{"type":"object","properties":{"durationMs":{"type":"number"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"cachedTokens":{"type":"number","nullable":true},"cacheWriteTokens":{"type":"number","nullable":true},"reasoningTokens":{"type":"number","nullable":true}},"required":["durationMs","inputTokens","outputTokens","cachedTokens","cacheWriteTokens","reasoningTokens"]}},"required":["id","organizationId","userId","apiKeyId","kind","createdAt","startedAt","lastObservedAt","finishedAt","details","usage"]},"Exec":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"sandboxId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["starting","running","cancelling","exited","timed_out","cancelled","interrupted","failed"]},"stdout":{"type":"string"},"stderr":{"type":"string"},"truncated":{"type":"boolean"},"sequence":{"type":"integer"},"exitCode":{"type":"integer","nullable":true},"durationMs":{"type":"integer","nullable":true},"errorCode":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"},"deadlineAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","sandboxId","status","stdout","stderr","truncated","sequence","exitCode","durationMs","errorCode","createdAt","startedAt","finishedAt","deadlineAt"]},"CreateExec":{"type":"object","properties":{"argv":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":128},"cwd":{"type":"string","maxLength":4096},"user":{"type":"string","maxLength":256,"description":"Guest username or UID, optionally followed by :group or :GID. Omit to inherit the image user (root if unset). Use \"0\" for root. Names are resolved inside the guest.","example":"1000:1000"},"stdin":{"type":"boolean","default":false},"terminal":{"type":"object","properties":{"rows":{"type":"integer","minimum":1,"maximum":65535},"cols":{"type":"integer","minimum":1,"maximum":65535},"term":{"type":"string","pattern":"^[A-Za-z0-9_.+-]{1,64}$","default":"xterm-256color"}},"required":["rows","cols"],"additionalProperties":false},"env":{"type":"object","additionalProperties":{"type":"string","maxLength":32768},"default":{}},"timeoutMs":{"type":"integer","minimum":1,"maximum":86400000,"default":600000}},"required":["argv"],"additionalProperties":false},"Ingress":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"accessMode":{"type":"string","enum":["public","authenticated"]},"url":{"type":"string","format":"uri","description":"Public HTTPS endpoint on the configured application domain. Use wss: in place of https: for WebSockets."},"binding":{"$ref":"#/components/schemas/IngressBinding"},"available":{"type":"boolean","description":"Whether the bound sandbox is running and unexpired."},"sandboxStatus":{"type":"string","nullable":true,"enum":["queued","migrating","completed","provisioning","running","stopping","stopped","restoring","hibernated","unavailable","unresolved","deleting","deleted","failed",null],"description":"The bound sandbox's status, or null when unbound."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","organizationId","name","accessMode","url","binding","available","sandboxStatus","createdAt"]},"IngressBinding":{"type":"object","nullable":true,"properties":{"sandboxId":{"type":"string","format":"uuid"},"port":{"type":"integer","minimum":1,"maximum":65535}},"required":["sandboxId","port"],"additionalProperties":false},"IngressAccessToken":{"type":"object","properties":{"token":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}},"required":["token","expiresAt"]},"HealthResponse":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}},"parameters":{}},"paths":{"/v1/identities":{"get":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Identities available to your account.","content":{"application/json":{"schema":{"type":"object","properties":{"identities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]}},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"}},"maxSessionSeconds":{"type":"number"},"version":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["id","organizationId","name","description","enabled","permissions","connections","environmentVariableSetIds","maxSessionSeconds","version","createdAt","updatedAt","canAssume","canManage"]}},"canCreate":{"type":"boolean"},"nextCursor":{"type":"string","nullable":true}},"required":["identities","canCreate","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":1000,"default":""},"enabled":{"type":"boolean","default":true},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]},"maxItems":32,"default":[]},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":16,"default":[]},"maxSessionSeconds":{"type":"integer","minimum":300,"maximum":86400,"default":3600},"grants":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string","format":"uuid"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["memberId","canAssume","canManage"]},"maxItems":500,"description":"Every member's access, saved with the identity in one change. Members left out have none. Your own access can't change here: leave yourself out, or repeat your current access. On update, omit it to keep member access as it is."}},"required":["name","permissions"]}}}},"responses":{"201":{"description":"Identity configuration and access.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]}},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"}},"maxSessionSeconds":{"type":"number"},"version":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string","format":"uuid"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"},"name":{"type":"string"},"email":{"type":"string"}},"required":["memberId","canAssume","canManage","name","email"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"}},"required":["connectionId","accountId"]}},"connectionNames":{"type":"object","additionalProperties":{"type":"string"}},"environmentVariableSets":{"type":"object","additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"environmentNames":{"type":"array","items":{"type":"string"},"description":"Variable names, never values; only with environment variable read permission."}},"required":["name"]},"description":"Attached secrets by ID."}},"required":["id","organizationId","name","description","enabled","permissions","connections","environmentVariableSetIds","maxSessionSeconds","version","createdAt","updatedAt","canAssume","canManage","grants","accounts","connectionNames","environmentVariableSets"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/identities/{id}":{"get":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Identity configuration and access.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]}},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"}},"maxSessionSeconds":{"type":"number"},"version":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string","format":"uuid"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"},"name":{"type":"string"},"email":{"type":"string"}},"required":["memberId","canAssume","canManage","name","email"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"}},"required":["connectionId","accountId"]}},"connectionNames":{"type":"object","additionalProperties":{"type":"string"}},"environmentVariableSets":{"type":"object","additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"environmentNames":{"type":"array","items":{"type":"string"},"description":"Variable names, never values; only with environment variable read permission."}},"required":["name"]},"description":"Attached secrets by ID."}},"required":["id","organizationId","name","description","enabled","permissions","connections","environmentVariableSetIds","maxSessionSeconds","version","createdAt","updatedAt","canAssume","canManage","grants","accounts","connectionNames","environmentVariableSets"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":1000,"default":""},"enabled":{"type":"boolean","default":true},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]},"maxItems":32,"default":[]},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":16,"default":[]},"maxSessionSeconds":{"type":"integer","minimum":300,"maximum":86400,"default":3600},"grants":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string","format":"uuid"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["memberId","canAssume","canManage"]},"maxItems":500,"description":"Every member's access, saved with the identity in one change. Members left out have none. Your own access can't change here: leave yourself out, or repeat your current access. On update, omit it to keep member access as it is."},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["name","permissions","version"]}}}},"responses":{"200":{"description":"Identity configuration and access.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"permissions":{"$ref":"#/components/schemas/HostingPermissions"},"connections":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"account":{"type":"string","enum":["shared","personal"]},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["connectionId","account","tools"]}},"environmentVariableSetIds":{"type":"array","items":{"type":"string","format":"uuid"}},"maxSessionSeconds":{"type":"number"},"version":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"string","format":"uuid"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"},"name":{"type":"string"},"email":{"type":"string"}},"required":["memberId","canAssume","canManage","name","email"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"accountId":{"type":"string","format":"uuid"}},"required":["connectionId","accountId"]}},"connectionNames":{"type":"object","additionalProperties":{"type":"string"}},"environmentVariableSets":{"type":"object","additionalProperties":{"type":"object","properties":{"name":{"type":"string"},"environmentNames":{"type":"array","items":{"type":"string"},"description":"Variable names, never values; only with environment variable read permission."}},"required":["name"]},"description":"Attached secrets by ID."}},"required":["id","organizationId","name","description","enabled","permissions","connections","environmentVariableSetIds","maxSessionSeconds","version","createdAt","updatedAt","canAssume","canManage","grants","accounts","connectionNames","environmentVariableSets"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Change saved."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/identities/{id}/grants":{"put":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"memberId":{"type":"string","format":"uuid"},"canAssume":{"type":"boolean"},"canManage":{"type":"boolean"}},"required":["memberId","canAssume","canManage"]}}}},"responses":{"204":{"description":"Change saved."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/identities/{id}/accounts/{connectionId}":{"put":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"connectionId","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","nullable":true,"format":"uuid"}},"required":["accountId"]}}}},"responses":{"204":{"description":"Change saved."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/identities/{id}/sessions":{"get":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Identity sessions. Credentials are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"sessions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"identityId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"userName":{"type":"string","nullable":true},"label":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"revokedAt":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["id","identityId","userId","userName","label","createdAt","expiresAt","revokedAt","active"]}},"nextCursor":{"type":"string","nullable":true}},"required":["sessions","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"durationSeconds":{"type":"integer","minimum":300,"maximum":86400}},"required":["label"]}}}},"responses":{"201":{"description":"A scoped bearer token, shown once, for Platform APIs and MCP.","content":{"application/json":{"schema":{"type":"object","properties":{"session":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"identityId":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"userName":{"type":"string","nullable":true},"label":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"revokedAt":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["id","identityId","userId","userName","label","createdAt","expiresAt","revokedAt","active"]},"token":{"type":"string"}},"required":["session","token"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/identities/{id}/sessions/{sessionId}":{"delete":{"tags":["identities"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Change saved."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Identity not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/events":{"get":{"operationId":"resourceEvents","tags":["system"],"summary":"Watch authorized resource changes","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"SSE invalidations. Refresh snapshots on reset and reconnect; events contain no resource data.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Organization access denied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Too many subscriptions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Events are unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections":{"get":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage"]}},"nextCursor":{"type":"string","nullable":true}},"required":["connections","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string","maxLength":2048,"format":"uri"},"visibility":{"type":"string","enum":["personal","organization"],"default":"personal"},"authType":{"type":"string","enum":["none","bearer","oauth"]},"token":{"type":"string","minLength":1,"maxLength":16384,"pattern":"^[\\x21-\\x7e]+$"}},"required":["name","url","authType"]}}}},"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections/{id}":{"get":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","properties":{"principalType":{"type":"string","enum":["mcp","apiKey"]},"principalId":{"type":"string","format":"uuid"},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["principalType","principalId","tools"]}}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage","grants"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"name":{"type":"string","minLength":1,"maxLength":100},"enabled":{"type":"boolean"},"allowedTools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500},"token":{"type":"string","minLength":1,"maxLength":16384,"pattern":"^[\\x21-\\x7e]+$"}},"required":["version","name","enabled","allowedTools"]}}}},"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Connection and grants removed; call history retained."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections/{id}/refresh":{"post":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections/{id}/grants":{"put":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"principalType":{"type":"string","enum":["mcp","apiKey"]},"principalId":{"type":"string","format":"uuid"},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["principalType","principalId","tools"]}}}},"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","properties":{"principalType":{"type":"string","enum":["mcp","apiKey"]},"principalId":{"type":"string","format":"uuid"},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["principalType","principalId","tools"]}}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage","grants"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections/{id}/oauth":{"post":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections/{id}/oauth/complete":{"post":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":8192},"state":{"type":"string","minLength":1,"maxLength":256},"iss":{"type":"string","maxLength":2048}},"required":["code","state"]}}}},"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"ownerId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"url":{"type":"string"},"visibility":{"type":"string","enum":["personal","organization"]},"authType":{"type":"string","enum":["none","bearer","oauth"]},"authenticated":{"type":"boolean"},"enabled":{"type":"boolean"},"version":{"type":"integer"},"tools":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"allowedTools":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canManage":{"type":"boolean"},"grants":{"type":"array","items":{"type":"object","properties":{"principalType":{"type":"string","enum":["mcp","apiKey"]},"principalId":{"type":"string","format":"uuid"},"tools":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"maxItems":500}},"required":["principalType","principalId","tools"]}}},"required":["id","organizationId","ownerId","name","url","visibility","authType","authenticated","enabled","version","tools","allowedTools","createdAt","updatedAt","canManage","grants"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/connections/{id}/calls":{"get":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"calls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"executionId":{"type":"string","nullable":true,"format":"uuid"},"connectionId":{"type":"string","format":"uuid"},"connectionName":{"type":"string"},"principalType":{"type":"string"},"principalId":{"type":"string","format":"uuid"},"actorId":{"type":"string","nullable":true,"format":"uuid"},"tool":{"type":"string"},"status":{"type":"string","enum":["unknown","succeeded","failed","denied"]},"durationMs":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","executionId","connectionId","connectionName","principalType","principalId","actorId","tool","status","durationMs","createdAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["calls","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/principals":{"get":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"principals":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["mcp","apiKey"]}},"required":["id","name","type"]}}},"required":["principals"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/search":{"get":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","maxLength":200,"default":""},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":50000,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"tools":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"connectionName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"}},"required":["connectionId","connectionName","name","description"]}},"nextOffset":{"type":"number","nullable":true}},"required":["tools","nextOffset"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/describe":{"post":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"tool":{"type":"string","maxLength":256}},"required":["connectionId","tool"]}}}},"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"tool":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":8000},"inputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","inputSchema"]}},"required":["connectionId"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/gateway/call":{"post":{"tags":["gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"tool":{"type":"string","minLength":1,"maxLength":256},"arguments":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["connectionId","tool"]}}}},"responses":{"200":{"description":"Gateway response.","content":{"application/json":{"schema":{"type":"object","properties":{"callId":{"type":"string","format":"uuid"},"isError":{"type":"boolean"},"historyUpdated":{"type":"boolean"},"result":{"type":"object","additionalProperties":{"nullable":true}}},"required":["callId","isError","historyUpdated","result"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The connection or tool is not permitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Connection not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"The request was already attempted, the connection changed, or sign-in is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"The request or result is too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The upstream service failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Connection encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/model-gateway/providers/{id}/models":{"get":{"tags":["model-gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"description":"Discover models using the saved provider key, including disabled models.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Model gateway metadata. Credentials are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["version","models"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Model gateway permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Provider not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Provider already exists or changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API or provider rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The provider returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Provider unavailable or credential encryption not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/models":{"get":{"tags":["model-gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"description":"List the organization's enabled models from current provider catalogs. Model IDs include the provider prefix.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Model gateway metadata. Credentials are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["model"]},"created":{"type":"integer"},"owned_by":{"type":"string","enum":["openai","anthropic","google"]}},"required":["id","object","created","owned_by"]}}},"required":["object","data"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Model gateway permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Provider not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Provider already exists or changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API or provider rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The provider returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Provider unavailable or credential encryption not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/model-gateway/providers":{"get":{"tags":["model-gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Model gateway metadata. Credentials are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["openai","anthropic","google"]},"name":{"type":"string"},"disabledModels":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","provider","name","disabledModels","enabled","version","createdAt","updatedAt"]}}},"required":["providers"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Model gateway permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Provider not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Provider already exists or changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API or provider rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The provider returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Provider unavailable or credential encryption not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["model-gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["openai","anthropic","google"]},"name":{"type":"string","minLength":1,"maxLength":100},"apiKey":{"type":"string","minLength":1,"maxLength":8192,"pattern":"^[\\x21-\\x7e]+$","writeOnly":true},"disabledModels":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"maxItems":10000,"default":[]}},"required":["provider","name","apiKey"],"additionalProperties":false}}}},"responses":{"200":{"description":"Model gateway metadata. Credentials are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["openai","anthropic","google"]},"name":{"type":"string"},"disabledModels":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","provider","name","disabledModels","enabled","version","createdAt","updatedAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Model gateway permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Provider not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Provider already exists or changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API or provider rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The provider returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Provider unavailable or credential encryption not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/model-gateway/providers/{id}":{"put":{"tags":["model-gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"name":{"type":"string","minLength":1,"maxLength":100},"apiKey":{"type":"string","minLength":1,"maxLength":8192,"pattern":"^[\\x21-\\x7e]+$","writeOnly":true},"disabledModels":{"type":"array","items":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"maxItems":10000},"enabled":{"type":"boolean"}},"required":["version","name","enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Model gateway metadata. Credentials are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["openai","anthropic","google"]},"name":{"type":"string"},"disabledModels":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","provider","name","disabledModels","enabled","version","createdAt","updatedAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Model gateway permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Provider not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Provider already exists or changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API or provider rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The provider returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Provider unavailable or credential encryption not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["model-gateway"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Provider and encrypted key deleted; usage history retained."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Model gateway permission required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Provider not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Provider already exists or changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API or provider rate limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The provider returned an invalid response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Provider unavailable or credential encryption not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/chat/completions":{"post":{"tags":["model-gateway"],"description":"Forward a native openai inference request; unknown body fields are preserved.","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Unmodified provider response or stream.","content":{"application/json":{"schema":{"nullable":true}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"401":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"403":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"404":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"409":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"413":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"429":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"502":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"503":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"504":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}}}}},"/v1/responses":{"post":{"tags":["model-gateway"],"description":"Forward a native openai inference request; unknown body fields are preserved.","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Unmodified provider response or stream.","content":{"application/json":{"schema":{"nullable":true}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"401":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"403":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"404":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"409":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"413":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"429":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"502":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"503":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"504":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}}}}},"/v1/decisions":{"post":{"tags":["model-gateway"],"description":"Forward a native openai inference request; unknown body fields are preserved.","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Unmodified provider response or stream.","content":{"application/json":{"schema":{"nullable":true}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"401":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"403":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"404":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"409":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"413":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"429":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"502":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"503":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"504":{"description":"Provider-native error. Gateway errors use the selected provider's error envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}}}}},"/v1/images":{"post":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"source":{"type":"string","minLength":1,"maxLength":512},"architecture":{"type":"string","enum":["amd64","arm64"],"default":"amd64"},"registryCredentialId":{"type":"string","format":"uuid"}},"required":["name","source"],"additionalProperties":false}}}},"responses":{"202":{"description":"Durable image import accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"source":{"type":"string","minLength":1,"maxLength":512},"architecture":{"type":"string","enum":["amd64","arm64"],"default":"amd64"},"registryCredentialId":{"type":"string","nullable":true,"format":"uuid"},"baseSizeMiB":{"type":"integer","nullable":true,"minimum":64,"maximum":32768,"description":"Resolved base filesystem size, or null until preparation completes."},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["preparing","ready","failed","deleting","deleted"]},"artifact":{"type":"object","nullable":true,"properties":{"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"size":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":44023414784},"compatibility":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"manifestDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"resolvedDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}},"required":["digest","size","compatibility","manifestDigest","resolvedDigest"]},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["name","source","registryCredentialId","baseSizeMiB","id","organizationId","status","artifact","error","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["preparing","ready","failed","deleting"],"description":"Only images in this state."},"required":false,"description":"Only images in this state.","name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"description":"Only images with exactly this name: every version of one image."},"required":false,"description":"Only images with exactly this name: every version of one image.","name":"name","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Organization images, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"images":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"source":{"type":"string","minLength":1,"maxLength":512},"architecture":{"type":"string","enum":["amd64","arm64"],"default":"amd64"},"registryCredentialId":{"type":"string","nullable":true,"format":"uuid"},"baseSizeMiB":{"type":"integer","nullable":true,"minimum":64,"maximum":32768,"description":"Resolved base filesystem size, or null until preparation completes."},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["preparing","ready","failed","deleting","deleted"]},"artifact":{"type":"object","nullable":true,"properties":{"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"size":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":44023414784},"compatibility":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"manifestDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"resolvedDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}},"required":["digest","size","compatibility","manifestDigest","resolvedDigest"]},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["name","source","registryCredentialId","baseSizeMiB","id","organizationId","status","artifact","error","createdAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["images","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/images/{id}":{"get":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Image import status and immutable artifact metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"source":{"type":"string","minLength":1,"maxLength":512},"architecture":{"type":"string","enum":["amd64","arm64"],"default":"amd64"},"registryCredentialId":{"type":"string","nullable":true,"format":"uuid"},"baseSizeMiB":{"type":"integer","nullable":true,"minimum":64,"maximum":32768,"description":"Resolved base filesystem size, or null until preparation completes."},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["preparing","ready","failed","deleting","deleted"]},"artifact":{"type":"object","nullable":true,"properties":{"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"size":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":44023414784},"compatibility":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"manifestDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"resolvedDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}},"required":["digest","size","compatibility","manifestDigest","resolvedDigest"]},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["name","source","registryCredentialId","baseSizeMiB","id","organizationId","status","artifact","error","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"202":{"description":"New launches disabled; artifact collection waits for active sandboxes."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/images/{id}/pull":{"post":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"registryCredentialId":{"type":"string","nullable":true,"format":"uuid","description":"Omit to reuse the image's saved credential, provide a replacement credential ID, or use null for a public image."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Pull accepted as a new immutable image. The source image and existing sandboxes are unchanged.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"source":{"type":"string","minLength":1,"maxLength":512},"architecture":{"type":"string","enum":["amd64","arm64"],"default":"amd64"},"registryCredentialId":{"type":"string","nullable":true,"format":"uuid"},"baseSizeMiB":{"type":"integer","nullable":true,"minimum":64,"maximum":32768,"description":"Resolved base filesystem size, or null until preparation completes."},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["preparing","ready","failed","deleting","deleted"]},"artifact":{"type":"object","nullable":true,"properties":{"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"size":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":44023414784},"compatibility":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"manifestDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"resolvedDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}},"required":["digest","size","compatibility","manifestDigest","resolvedDigest"]},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["name","source","registryCredentialId","baseSizeMiB","id","organizationId","status","artifact","error","createdAt"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/registry-credentials":{"post":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"registry":{"type":"string","format":"uri"},"username":{"type":"string","maxLength":1024},"password":{"type":"string","minLength":1,"maxLength":8192},"tokenOrigin":{"type":"string","format":"uri"}},"required":["name","registry","username","password"],"additionalProperties":false}}}},"responses":{"201":{"description":"Credential metadata. Secrets are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"registry":{"type":"string","format":"uri"},"username":{"type":"string","maxLength":1024},"tokenOrigin":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","registry","username","tokenOrigin","id","organizationId","version","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Organization registry credential metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"credentials":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"registry":{"type":"string","format":"uri"},"username":{"type":"string","maxLength":1024},"tokenOrigin":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","registry","username","tokenOrigin","id","organizationId","version","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true}},"required":["credentials","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/registry-credentials/{id}":{"put":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"registry":{"type":"string","format":"uri"},"username":{"type":"string","maxLength":1024},"password":{"type":"string","minLength":1,"maxLength":8192},"tokenOrigin":{"type":"string","format":"uri"},"version":{"type":"integer","minimum":1,"maximum":2147483646}},"required":["name","registry","username","password","version"],"additionalProperties":false}}}},"responses":{"200":{"description":"Rotated credential metadata. Accepted imports retain their original snapshot.","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"registry":{"type":"string","format":"uri"},"username":{"type":"string","maxLength":1024},"tokenOrigin":{"type":"string","nullable":true},"id":{"type":"string","format":"uuid"},"organizationId":{"type":"string","format":"uuid"},"version":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","registry","username","tokenOrigin","id","organizationId","version","createdAt","updatedAt"],"additionalProperties":false}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["images"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Credential removed. Existing imports and images remain usable."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Image storage or preparation is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/environment-variable-sets":{"get":{"tags":["environment-variables"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Organization variable sets.","content":{"application/json":{"schema":{"type":"object","properties":{"sets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"environmentNames":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"usage":{"type":"object","properties":{"sandboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"}},"required":["id","name","version"]}}},"required":["sandboxes"]}},"required":["id","name","version","environmentNames","organizationId","createdAt","updatedAt","usage"]}},"nextCursor":{"type":"string","nullable":true}},"required":["sets","nextCursor"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Variable set not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name, version, or active attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["environment-variables"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"env":{"type":"object","additionalProperties":{"type":"string","maxLength":8192}}},"required":["name","env"],"additionalProperties":false}}}},"responses":{"201":{"description":"Variable set metadata. Values are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"environmentNames":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","version","environmentNames","organizationId","createdAt","updatedAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Variable set not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name, version, or active attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/environment-variable-sets/{id}":{"get":{"tags":["environment-variables"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Metadata and attachments.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"environmentNames":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"usage":{"type":"object","properties":{"sandboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"}},"required":["id","name","version"]}}},"required":["sandboxes"]}},"required":["id","name","version","environmentNames","organizationId","createdAt","updatedAt","usage"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Variable set not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name, version, or active attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"tags":["environment-variables"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"env":{"type":"object","additionalProperties":{"type":"string","nullable":true,"maxLength":8192}}},"required":["name","version","env"],"additionalProperties":false}}}},"responses":{"200":{"description":"Variable set metadata. Values are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"integer"},"environmentNames":{"type":"array","items":{"type":"string"}},"organizationId":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","version","environmentNames","organizationId","createdAt","updatedAt"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Variable set not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name, version, or active attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["environment-variables"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Variable set deleted."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Variable set not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting name, version, or active attachment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Encryption is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/whoami":{"get":{"operationId":"whoami","tags":["identity"],"summary":"Identify the caller and their organization","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"The authenticated caller and effective hosting permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Caller"}}}},"400":{"description":"Missing or invalid organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing, invalid, expired, or revoked credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The caller cannot access the selected organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"The API key rate or usage limit was exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/volumes":{"post":{"tags":["volumes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"createVolume","summary":"Create persistent storage for an organization","description":"Reuse the same Idempotency-Key and quota when retrying. Unresolved creation requires operator reconciliation; a fresh key could allocate another volume.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"},{"schema":{"type":"string","format":"uuid","description":"A unique UUID for this creation request, scoped to the organization."},"required":true,"description":"A unique UUID for this creation request, scoped to the organization.","name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quotaBytes":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"default":null,"description":"Storage quota in bytes; null means unlimited."}},"additionalProperties":false}}}},"responses":{"200":{"description":"The volume and its current storage usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Volume"}}}},"201":{"description":"The volume and its current storage usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Volume"}}}},"202":{"description":"The same creation request is already in progress. Inspect the returned volume.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Volume"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Volume not found in this organization or in storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or volume is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["volumes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"listVolumes","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Organization volumes, newest first, including unresolved creations. A volume whose storage cannot be read is listed as unavailable with unknown usage.","content":{"application/json":{"schema":{"type":"object","properties":{"volumes":{"type":"array","items":{"$ref":"#/components/schemas/Volume"}},"nextCursor":{"type":"string","nullable":true,"format":"uuid"}},"required":["volumes","nextCursor"]}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Volume not found in this organization or in storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or volume is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/volumes/{id}":{"get":{"tags":["volumes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"getVolume","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"The volume and its current storage usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Volume"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Volume not found in this organization or in storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or volume is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["volumes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"deleteVolume","description":"Volume deletion is not yet supported. Returns 501 for an existing ready volume and preserves ownership and data.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"The volume and its storage were deleted."},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Volume not found in this organization or in storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or volume is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Storage does not support volume deletion yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/volumes/{id}/quota":{"put":{"tags":["volumes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"setVolumeQuota","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quotaBytes":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991,"description":"Storage quota in bytes; null means unlimited."}},"required":["quotaBytes"],"additionalProperties":false}}}},"responses":{"200":{"description":"The volume and its current storage usage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Volume"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Volume not found in this organization or in storage.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or volume is not ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes/{id}/stop":{"post":{"tags":["sandboxes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"stopSandbox","summary":"Stop compute and save the disk to object storage","description":"Preserves disk contents, environment and endpoint bindings. Running processes and memory are discarded. The existing expiration deadline still applies. Poll until stopped; failures retain local disk state and retry.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"202":{"description":"The organization-owned sandbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox or volume not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or creation requires reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded or compute capacity unavailable. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"The requested feature is unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Compute or storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Compute or storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes/{id}/start":{"post":{"tags":["sandboxes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"startSandbox","summary":"Restore a saved disk and boot the sandbox","description":"Keeps the sandbox ID and starts a fresh VM on a compatible host. Configured startup runs again; manual commands are not resumed. The existing expiration deadline still applies.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"202":{"description":"The organization-owned sandbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox or volume not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or creation requires reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded or compute capacity unavailable. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"The requested feature is unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Compute or storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Compute or storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes":{"post":{"tags":["sandboxes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"createSandbox","summary":"Create a sandbox","description":"Reuse the Idempotency-Key and configuration on retry. Replays return the original resource, including completed, failed or deleted resources. Sandboxes provision asynchronously; follow /v1/events and read the sandbox snapshot until running or terminal. Optional startup runs the image ENTRYPOINT/CMD or explicit argv and stops the VM when that command exits, retaining bounded output. Omit startup for an interactive sandbox. The default image is ubuntu:24.04. Commands, environment variables, files, and endpoints are supported; volume mounts are not yet supported.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"idempotency-key","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSandboxWithEnvironment"}}}},"responses":{"200":{"description":"The organization-owned sandbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"202":{"description":"The sandbox is provisioning or deletion is still in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox or volume not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or creation requires reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded or compute capacity unavailable. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"The requested feature is unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Compute or storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Compute or storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["sandboxes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"listSandboxes","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Case-insensitive part of the sandbox name (labels.name), or the start of its ID."},"required":false,"description":"Case-insensitive part of the sandbox name (labels.name), or the start of its ID.","name":"query","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Sandboxes, newest first, excluding deleted records. Completed, failed, and deleting sandboxes remain visible.","content":{"application/json":{"schema":{"type":"object","properties":{"sandboxes":{"type":"array","items":{"$ref":"#/components/schemas/Sandbox"}},"nextCursor":{"type":"string","nullable":true,"format":"uuid"}},"required":["sandboxes","nextCursor"]}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox or volume not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or creation requires reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded or compute capacity unavailable. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"The requested feature is unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Compute or storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Compute or storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes/{id}":{"get":{"tags":["sandboxes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"getSandbox","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"The organization-owned sandbox.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox or volume not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or creation requires reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded or compute capacity unavailable. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"The requested feature is unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Compute or storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Compute or storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["sandboxes"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"deleteSandbox","description":"Stop compute and release mount references. Persistent volume data is retained. Confirmed deletion removes the sandbox from lists; its record remains available by ID for inspection and safe retries. Repeating a completed deletion returns 204; concurrent or queued cleanup returns 202.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"202":{"description":"Cleanup is already claimed and will be retried by the controller."},"204":{"description":"Compute is gone; the sandbox record is retained for safe retries."},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox or volume not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting request or creation requires reconciliation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded or compute capacity unavailable. Respect Retry-After.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"The requested feature is unsupported.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"Compute or storage could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Compute or storage is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/usage":{"get":{"operationId":"listUsageEvents","tags":["usage"],"summary":"List usage events by kind","description":"Defaults to sandbox usage. Requires sandboxes:read for sandbox usage or modelGateway:read for model usage. Members see only their own records; owners, admins and organization API keys can filter by user. Records are newest first. Running totals are provisional as of the response timestamp. observationStale marks runs not observed running within 30 seconds. Runtime is controller-observed, not CPU utilization. Model calls are finalized and filtered by creation date; sandboxId applies only to sandboxes. Historical events before metering are not backfilled.","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","enum":["sandbox","model"],"default":"sandbox"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"number"},"required":false,"name":"days","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"sandboxId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"providerId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":false,"name":"model","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Organization-scoped run records and provisional totals.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"oneOf":[{"$ref":"#/components/schemas/SandboxUsageEvent"},{"$ref":"#/components/schemas/ModelUsageEvent"}],"discriminator":{"propertyName":"kind","mapping":{"sandbox":"#/components/schemas/SandboxUsageEvent","model":"#/components/schemas/ModelUsageEvent"}}}},"asOf":{"type":"string","format":"date-time"},"nextCursor":{"type":"string","nullable":true,"format":"uuid"}},"required":["events","asOf","nextCursor"]}}}},"400":{"description":"Invalid query or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/usage/summary":{"get":{"operationId":"getUsageSummary","tags":["usage"],"summary":"Summarize usage by kind and UTC day","description":"Defaults to sandbox usage. Requires sandboxes:read for sandbox usage or modelGateway:read for model usage. Members see their own usage; owners, admins and organization API keys can filter by user. CPU and RAM totals include only runtime inside the range; runs counts allocations created in the range. Ongoing runtime is provisional. Model calls and their measurements are attributed to their creation day. Token totals sum known values, remain null when all measurements are unavailable, and are zero for empty groups.","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","enum":["sandbox","model"],"default":"sandbox"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"number","default":30},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"providerId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":false,"name":"model","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Daily usage, totals and available people filters.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["sandbox"]},"since":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time"},"canViewOrganization":{"type":"boolean"},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"image":{"type":"string","nullable":true}},"required":["id","name","image"]}},"days":{"type":"array","items":{"type":"object","properties":{"runs":{"type":"number"},"cpuMilliseconds":{"type":"number"},"memoryMiBMilliseconds":{"type":"number"},"day":{"type":"string"}},"required":["runs","cpuMilliseconds","memoryMiBMilliseconds","day"]}},"members":{"type":"array","items":{"type":"object","properties":{"runs":{"type":"number"},"cpuMilliseconds":{"type":"number"},"memoryMiBMilliseconds":{"type":"number"},"userId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string"},"image":{"type":"string","nullable":true}},"required":["runs","cpuMilliseconds","memoryMiBMilliseconds","userId","name","image"]}},"totals":{"type":"object","properties":{"runs":{"type":"number"},"cpuMilliseconds":{"type":"number"},"memoryMiBMilliseconds":{"type":"number"}},"required":["runs","cpuMilliseconds","memoryMiBMilliseconds"]}},"required":["kind","since","asOf","canViewOrganization","people","days","members","totals"]},{"type":"object","properties":{"kind":{"type":"string","enum":["model"]},"since":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time"},"canViewOrganization":{"type":"boolean"},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"image":{"type":"string","nullable":true}},"required":["id","name","image"]}},"days":{"type":"array","items":{"type":"object","properties":{"durationMs":{"type":"number"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"cachedTokens":{"type":"number","nullable":true},"cacheWriteTokens":{"type":"number","nullable":true},"reasoningTokens":{"type":"number","nullable":true},"calls":{"type":"number"},"day":{"type":"string"}},"required":["durationMs","inputTokens","outputTokens","cachedTokens","cacheWriteTokens","reasoningTokens","calls","day"]}},"members":{"type":"array","items":{"type":"object","properties":{"durationMs":{"type":"number"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"cachedTokens":{"type":"number","nullable":true},"cacheWriteTokens":{"type":"number","nullable":true},"reasoningTokens":{"type":"number","nullable":true},"calls":{"type":"number"},"userId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string"},"image":{"type":"string","nullable":true}},"required":["durationMs","inputTokens","outputTokens","cachedTokens","cacheWriteTokens","reasoningTokens","calls","userId","name","image"]}},"totals":{"type":"object","properties":{"durationMs":{"type":"number"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"cachedTokens":{"type":"number","nullable":true},"cacheWriteTokens":{"type":"number","nullable":true},"reasoningTokens":{"type":"number","nullable":true},"calls":{"type":"number"}},"required":["durationMs","inputTokens","outputTokens","cachedTokens","cacheWriteTokens","reasoningTokens","calls"]},"models":{"type":"array","items":{"type":"object","properties":{"durationMs":{"type":"number"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"cachedTokens":{"type":"number","nullable":true},"cacheWriteTokens":{"type":"number","nullable":true},"reasoningTokens":{"type":"number","nullable":true},"calls":{"type":"number"},"providerId":{"type":"string"},"model":{"type":"string"}},"required":["durationMs","inputTokens","outputTokens","cachedTokens","cacheWriteTokens","reasoningTokens","calls","providerId","model"]}},"modelDays":{"type":"array","items":{"type":"object","properties":{"durationMs":{"type":"number"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"cachedTokens":{"type":"number","nullable":true},"cacheWriteTokens":{"type":"number","nullable":true},"reasoningTokens":{"type":"number","nullable":true},"calls":{"type":"number"},"providerId":{"type":"string"},"model":{"type":"string"},"day":{"type":"string"}},"required":["durationMs","inputTokens","outputTokens","cachedTokens","cacheWriteTokens","reasoningTokens","calls","providerId","model","day"]}},"providers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"provider":{"type":"string","nullable":true,"enum":["openai","anthropic","google",null]}},"required":["id","name","provider"]}},"availableModels":{"type":"array","items":{"type":"object","properties":{"providerId":{"type":"string"},"model":{"type":"string"}},"required":["providerId","model"]}},"missingTokenCalls":{"type":"number"}},"required":["kind","since","asOf","canViewOrganization","people","days","members","totals","models","modelDays","providers","availableModels","missingTokenCalls"]}]}}}},"400":{"description":"Invalid query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes/{id}/usage":{"get":{"operationId":"getSandboxResourceUsage","tags":["usage"],"summary":"Read measured CPU and resident memory usage","description":"Requires sandboxes:read. CPU is consumed vCPU-thread time; memory is sampled resident guest RAM. Integer totals cover fully observed intervals in the requested window. Missing memory, migration boundaries and unobserved terminal tails are not estimated. These measurements do not trigger charges.","security":[{"bearerAuth":[]},{"sessionCookie":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"number","default":1},"required":false,"name":"hours","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Measured quantities and 240 chart buckets. Null gauges are unavailable, never zero-filled.","content":{"application/json":{"schema":{"type":"object","properties":{"since":{"type":"string","format":"date-time"},"asOf":{"type":"string","format":"date-time"},"lastObservedAt":{"type":"string","nullable":true,"format":"date-time"},"status":{"type":"string","enum":["pending","live","stale","complete","incomplete"]},"totals":{"type":"object","properties":{"cpuNanoseconds":{"type":"string"},"residentByteMilliseconds":{"type":"string"},"observedMs":{"type":"number"},"memoryObservedMs":{"type":"number"},"excludedIntervals":{"type":"number"}},"required":["cpuNanoseconds","residentByteMilliseconds","observedMs","memoryObservedMs","excludedIntervals"]},"points":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string","format":"date-time"},"activeVcpus":{"type":"number","nullable":true},"residentBytes":{"type":"number","nullable":true},"coverage":{"type":"number"}},"required":["at","activeVcpus","residentBytes","coverage"]}}},"required":["since","asOf","lastObservedAt","status","totals","points"]}}}},"400":{"description":"Invalid range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Sandbox not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/execs/{id}/stream":{"get":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["execs"],"operationId":"attachExec","description":"Attach to live execution output and optional stdin over WebSocket. Read-only by default; one writer per execution. Closing detaches. Live bytes are not redacted; retained logs are redacted. Input is not replayed after reconnect.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":9007199254740991,"default":0},"required":false,"name":"after","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"true"},"required":false,"name":"readOnly","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"101":{"description":"WebSocket attached."},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes/{id}/exec":{"post":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["execs"],"operationId":"createExec","description":"Create a node-owned execution using argv, literal environment overrides, cwd, and an optional terminal. Creation returns immediately. Commands survive HTTP disconnects and API restarts; timeout, cancellation, and sandbox lifetime bound execution. Retry the same key to retrieve the same execution.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"idempotency-key","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExec"}}}},"responses":{"200":{"description":"Execution status and retained output. Request secrets are excluded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exec"}}}},"202":{"description":"The execution is accepted or already active.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exec"}}}},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/execs/{id}":{"get":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["execs"],"operationId":"getExec","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Execution status and retained output. Request secrets are excluded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exec"}}}},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/execs/{id}/cancel":{"post":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["execs"],"operationId":"cancelExec","description":"Records durable cancellation and asks the node to stop the execution. Cancellation fences a delayed create. A 202 acknowledges the request; a terminal status confirms completion.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Execution status and retained output. Request secrets are excluded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exec"}}}},"202":{"description":"Execution status and retained output. Request secrets are excluded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Exec"}}}},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/execs/{id}/events":{"get":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["execs"],"operationId":"streamExecEvents","description":"Replay retained stdout/stderr events after cursor, then follow new output. Event IDs are per-execution sequence numbers; Last-Event-ID also resumes. An exit event closes the stream. Disconnecting does not cancel execution.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":4096},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^\\d+$"},"required":false,"name":"last-event-id","in":"header"}],"responses":{"200":{"description":"SSE stdout/stderr events contain sequence, stream, and data. The terminal exit event contains status, exitCode, durationMs, truncated, errorCode, and sequence. An error event reports an interrupted log stream.","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/sandboxes/{id}/files":{"get":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["files"],"operationId":"readSandboxFile","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":2,"maxLength":4096},"required":true,"name":"path","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Guest file bytes, up to 16 MiB.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"put":{"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"tags":["files"],"operationId":"writeSandboxFile","description":"Write up to 16 MiB to a sandbox file. Parent directories must exist; symlinks are rejected. Uploads atomically replace regular files with mode 0644 after integrity checks. A lost response can leave a completed write.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":2,"maxLength":4096},"required":true,"name":"path","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^application\\/octet-stream(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"204":{"description":"The compute service confirmed the file write."},"400":{"description":"Invalid request, organization selection, or cursor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Resource not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Sandbox not running or creation key conflicts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Request or file exceeds its size limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"501":{"description":"Streaming execution is unsupported by this fleet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"502":{"description":"The compute service could not complete the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Execution is not configured or the worker is stopping.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ingresses/{id}/access":{"put":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"setIngressAccess","summary":"Set public or authenticated endpoint access","description":"Requires ingresses:write. Changing access invalidates existing endpoint tokens and closes admitted streams on their next access check.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accessMode":{"type":"string","enum":["public","authenticated"]}},"required":["accessMode"],"additionalProperties":false}}}},"responses":{"200":{"description":"The persistent endpoint and its current binding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingress"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ingresses/{id}/access-tokens":{"post":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"issueIngressAccessToken","summary":"Create a token for one authenticated endpoint","description":"Requires ingresses:use. Tokens expire after 15 minutes. Send the token in X-Adapt-Authorization: Bearer <token>; Authorization remains available to the application.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"A short-lived endpoint credential. Store securely; it is not returned again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngressAccessToken"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"revokeIngressAccessTokens","summary":"Revoke browser sessions and tokens for an endpoint","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Existing tokens revoked. Open streams close on their next access check."},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ingresses":{"post":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"createIngress","summary":"Reserve a persistent endpoint","description":"The URL survives sandbox replacement. Reuse the creation key on retries while the endpoint exists. New endpoints start unbound.","parameters":[{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"accessMode":{"type":"string","enum":["public","authenticated"],"default":"public"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"The persistent endpoint and its current binding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingress"}}}},"201":{"description":"The persistent endpoint and its current binding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingress"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"listIngresses","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Only endpoints bound to this sandbox."},"required":false,"description":"Only endpoints bound to this sandbox.","name":"sandboxId","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Case-insensitive part of the bound sandbox's name (labels.name), or the start of its ID."},"required":false,"description":"Case-insensitive part of the bound sandbox's name (labels.name), or the start of its ID.","name":"query","in":"query"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"Endpoints, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"ingresses":{"type":"array","items":{"$ref":"#/components/schemas/Ingress"}},"nextCursor":{"type":"string","nullable":true,"format":"uuid"}},"required":["ingresses","nextCursor"]}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ingresses/{id}":{"get":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"getIngress","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"The persistent endpoint and its current binding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingress"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"deleteIngress","summary":"Delete the endpoint and its binding","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"204":{"description":"Endpoint deleted. The sandbox continues running."},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/v1/ingresses/{id}/binding":{"put":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"bindIngress","summary":"Bind or rebind an endpoint to a sandbox port","description":"Requires ingresses:write and sandboxes:write. The URL stays the same when the sandbox or port changes. Existing requests may finish on the previous sandbox.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"},{"schema":{"type":"string","pattern":"^application\\/json(?:\\s*;.*)?$/i"},"required":true,"name":"content-type","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngressBinding"}}}},"responses":{"200":{"description":"The persistent endpoint and its current binding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingress"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["ingresses"],"security":[{"bearerAuth":[]},{"sessionCookie":[]}],"operationId":"unbindIngress","summary":"Stop new traffic while retaining the endpoint URL","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid","description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization."},"required":false,"description":"Select an organization for this request. Sessions require current membership; API keys can only select their owning organization.","name":"x-organization-id","in":"header"}],"responses":{"200":{"description":"The persistent endpoint and its current binding.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ingress"}}}},"400":{"description":"Invalid input or organization selection.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient organization permissions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Endpoint or sandbox not found in this organization.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflicting creation key or sandbox is not running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"API key rate or usage limit exceeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"An internal error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Endpoint hosting or compute is not configured or unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/health":{"get":{"tags":["system"],"responses":{"200":{"description":"The API is ready to accept requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/ready":{"get":{"tags":["system"],"responses":{"200":{"description":"The API can reach its database.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"503":{"description":"The database is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}