{"openapi":"3.1.0","info":{"title":"Octo API","description":"The public Octo API. Authenticate with `Authorization: Bearer <key>`. Every error is `{\"error\": {type, code, message, param, retryable, details, trace_id}}`. Reference: /v1/docs.","version":"1"},"paths":{"/v1/spaces":{"post":{"tags":["turns"],"summary":"Create Space","description":"Create an isolated API-native space owned by the key's account (no Telegram\nchat). The bot provisions + runs it from this DB record and routes it by the\nfleet POLICY. `engine`/`model` are DEPRECATED: when sent they are validated as\nbefore and become the space's orchestration override (the same record PUT\n/v1/spaces/{slug}/policy writes), and the response carries a `deprecation`.\nAn `Idempotency-Key` makes a retry return the same space\n(services/api_idempotency).","operationId":"create_space_v1_spaces_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSpaceIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["turns"],"summary":"List Spaces","description":"List the spaces this key may reach. Workspace-free:\n* A space-bound key (space_slug set) returns EXACTLY its one bound space and\n  nothing else — regardless of that space's origin or legacy workspace.\n* An account-wide key returns the account's API-native spaces; scoped to 'own'\n  it returns only the spaces it created.\n* A space-admin key returns its main space's tenants (`?end_user_ref=` for\n  one end user's, `?include_archived=true` for archived ones too).","operationId":"list_spaces_v1_spaces_get","parameters":[{"name":"end_user_ref","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Ref"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}":{"patch":{"tags":["turns"],"summary":"Patch Space","description":"Change an existing API space's engine/model. Takes effect on the space's NEXT\nturn — the running orchestrator switches engine inflight (the conversation\ncontinues from the space's memory/CONTEXT). Provide `model_pin` (an id from\nGET /v1/models) OR `engine` (+ optional `model`). Ownership + key-scope guarded.\nDEPRECATED in favour of PUT /v1/spaces/{slug}/policy {\"orchestration\": pin}.","operationId":"patch_space_v1_spaces__slug__patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchSpaceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/turns":{"get":{"tags":["turns"],"summary":"List Space Turns","description":"Recent turns for an owned API space — chat history for the console.","operationId":"list_space_turns_v1_spaces__slug__turns_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/manifest":{"put":{"tags":["turns"],"summary":"Set Manifest","operationId":"set_manifest_v1_spaces__slug__manifest_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManifestIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["turns"],"summary":"Get Manifest","operationId":"get_manifest_v1_spaces__slug__manifest_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/limits":{"get":{"tags":["turns"],"summary":"Get Space Limits","description":"The space's daily energy cap, today's spend, and the key's own daily cap\n(the outer bound across every space it runs).","operationId":"get_space_limits_v1_spaces__slug__limits_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["turns"],"summary":"Set Space Limits","description":"Set (or, with `daily_energy: null`, clear) the space's DAILY energy cap.\nOnly the key that created the space; a turn past it is refused 429\nQUOTA_EXCEEDED `limit_reached: space_daily_energy` until UTC midnight. A cap\nthe owner set in the space settings is theirs: 403 OWNER_LIMIT_SET.","operationId":"set_space_limits_v1_spaces__slug__limits_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/secret":{"put":{"tags":["turns"],"summary":"Set Secret","description":"Store the space's app credential, encrypted (write-only — never returned in\nplaintext to the client/model; the bot gets it over the gate to inject into .env).","operationId":"set_secret_v1_spaces__slug__secret_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/secrets":{"post":{"tags":["turns"],"summary":"Set Space Secrets","description":"Set/upsert one or more named secrets for an owned API space — the SAME encrypted\nper-space store (space_secrets) the Mini App / web UI writes. These become env vars\nthe agent's tools read (e.g. ACME_API_KEY). Encrypted at rest, write-only (never\nreturned). Names must match [A-Z_][A-Z0-9_]* ; reserved names are refused with\nRESERVED_SECRET_NAME: bot-token names (400), the OOIH_ namespace and the names\nAI engines read for their own config such as OPENAI_*/ANTHROPIC_* (422; store it\nas APP_OPENAI_API_KEY instead). Platform-managed names land in `skipped_system`,\nmalformed names or empty values in `skipped_invalid`.\nSend `{name, value}` for one, or `{secrets: {NAME: value, …}}` for a batch.","operationId":"set_space_secrets_v1_spaces__slug__secrets_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceSecretsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["turns"],"summary":"Set Space Secrets","description":"Set/upsert one or more named secrets for an owned API space — the SAME encrypted\nper-space store (space_secrets) the Mini App / web UI writes. These become env vars\nthe agent's tools read (e.g. ACME_API_KEY). Encrypted at rest, write-only (never\nreturned). Names must match [A-Z_][A-Z0-9_]* ; reserved names are refused with\nRESERVED_SECRET_NAME: bot-token names (400), the OOIH_ namespace and the names\nAI engines read for their own config such as OPENAI_*/ANTHROPIC_* (422; store it\nas APP_OPENAI_API_KEY instead). Platform-managed names land in `skipped_system`,\nmalformed names or empty values in `skipped_invalid`.\nSend `{name, value}` for one, or `{secrets: {NAME: value, …}}` for a batch.","operationId":"set_space_secrets_v1_spaces__slug__secrets_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpaceSecretsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["turns"],"summary":"List Space Secrets","description":"List the NAMES of a space's secrets — values are never returned (write-only store).\n`system` flags a reserved name managed by the platform.","operationId":"list_space_secrets_v1_spaces__slug__secrets_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/secrets/{name}":{"delete":{"tags":["turns"],"summary":"Delete Space Secret","description":"Delete a named secret from an owned API space.","operationId":"delete_space_secret_v1_spaces__slug__secrets__name__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/tools":{"put":{"tags":["turns"],"summary":"Set Tools","description":"Set the space's tool config: which built-in capabilities the agent may use\n(allowlist) + the client's own MCP server(s) so it can drive their app via\nstructured tools. The bot materializes this into the per-space engine MCP config.\n\nFull-replace. Use PATCH to flip a single capability without resending the set.","operationId":"set_tools_v1_spaces__slug__tools_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["turns"],"summary":"Patch Tools","description":"Merge-update the space's tool config. Unlike PUT (full-replace), only the\nfields present in the request body are changed — the rest are preserved.","operationId":"patch_tools_v1_spaces__slug__tools_patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolsPatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["turns"],"summary":"Get Tools","operationId":"get_tools_v1_spaces__slug__tools_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tools/catalog":{"get":{"tags":["turns"],"summary":"Tools Catalog","description":"The built-in capability keys a space may put in `allow` (least-privilege).","operationId":"tools_catalog_v1_tools_catalog_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/app-api":{"get":{"tags":["turns"],"summary":"List App Apis","description":"The app APIs handed to this space (secret NAMES, never values).","operationId":"list_app_apis_v1_spaces__slug__app_api_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/app-api/{name}":{"put":{"tags":["turns"],"summary":"Put App Api","description":"Register or replace the app API `name` on a space this key reaches.","operationId":"put_app_api_v1_spaces__slug__app_api__name__put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppApiIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["turns"],"summary":"Patch App Api","description":"Change only the fields sent, e.g. `{\"credentials\": {\"ORDERS_API_TOKEN\": \"<new>\"}}`\nrotates the token (the old value is overwritten, never returned).","operationId":"patch_app_api_v1_spaces__slug__app_api__name__patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppApiIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["turns"],"summary":"Delete App Api","description":"Unregister the app API `name`: its MCP server, its manifest block and the\nsecrets it holds are removed.","operationId":"delete_app_api_v1_spaces__slug__app_api__name__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/settings":{"get":{"tags":["turns"],"summary":"Get Tenant Settings","description":"A tenant space's settings (space-admin keys).","operationId":"get_tenant_settings_v1_spaces__slug__settings_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["turns"],"summary":"Patch Tenant Settings","description":"Configure a tenant space (space-admin keys). Merge-PATCH: only the fields\nsent change. Capabilities and the Mid-turn corrections\nswitches go no higher than the main space's; every change lands\nin the space's settings history as this key.","operationId":"patch_tenant_settings_v1_spaces__slug__settings_patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSettingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/archive":{"post":{"tags":["turns"],"summary":"Archive Tenant","description":"Archive a tenant space (space-admin keys): it leaves every list and takes no\nmore turns. Its history and billing rows stay. Idempotent.","operationId":"archive_tenant_v1_spaces__slug__archive_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/policy":{"get":{"tags":["turns"],"summary":"Get Space Policy","description":"The space's routing policy: per kind of work, the configured choice, the\nmodel it resolves to right now, the source (fleet_default, space_override,\npin, platform) and, when it is not the first choice, the typed reasons\n(INELIGIBLE, OUT_OF_BUDGET, AT_CAPACITY, UNHEALTHY). A pure read: resolving\nit can never move the space onto another model.\n\n`model_state` is the space's orchestrator model and session: what it runs,\nwhat it is configured to, a pending soft switch and what it waits for, a\nforced switch and whether the session has rolled for it, the context used\nagainst the dream threshold, the estimated turns until the dream, the last\ndream, the session's age and resumability, the pool headroom, and who decides\n(`policy_source`: default | api | dashboard | admin).","operationId":"get_space_policy_v1_spaces__slug__policy_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["turns"],"summary":"Put Space Policy","description":"Set per-kind overrides for this space: {\"<kind>\": \"<model id>\"}. Only the\nkinds in `settable` are writable by the space (today `orchestration`, the\nspace's own default model, written exactly as the Policies tab writes it).\nAn operator-level kind is refused with OPERATOR_ONLY, an unknown kind with\nINVALID_KIND, and a model the space may not use with its typed code.\n\n`switch` says when the orchestration model changes: \"soft\" (the default) at\nthe session's next dream, \"force\" now (the session is dreamed and rolled\nbefore the next turn), \"cancel\" drops a pending soft switch and needs no\nmodel. The response carries `model_state`, the same block GET returns.","operationId":"put_space_policy_v1_spaces__slug__policy_put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/policy/{kind}":{"delete":{"tags":["turns"],"summary":"Delete Space Policy","description":"Drop this space's override for one kind, so it returns to the fleet\ndefault. For orchestration that clears the space's own model record, the\nstate a space created without engine/model starts in.","operationId":"delete_space_policy_v1_spaces__slug__policy__kind__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/models":{"get":{"tags":["turns"],"summary":"Models Catalog","description":"The model catalog for routing policies: each model's id (the value PUT\n/v1/spaces/{slug}/policy takes), label, the kinds it may run, its price tier,\nand the fleet default policy (the table every space routes by until it sets\nan override). `engine`/`model` stay on each entry for the deprecated\nengine/model fields of POST /v1/spaces.","operationId":"models_catalog_v1_models_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["turns"],"summary":"Usage Breakdown","description":"Spend ledger rolled up by end_user | space | key, in energy (each turn's\nwhole cost, as GET /v1/turns/{id} shows it). scope='account' (default) = the\nwhole account (for re-billing across all your keys) for an account-wide key,\nthe key's own space for a space-bound one; scope='key' = only this key's own\nturns (what the per-key console shows).","operationId":"usage_breakdown_v1_usage_get","parameters":[{"name":"group_by","in":"query","required":false,"schema":{"type":"string","default":"end_user","title":"Group By"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"account","title":"Scope"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/end-users/{ref}":{"patch":{"tags":["turns"],"summary":"Set End User Limit","description":"Set an end-user's cumulative spend limit in energy (the 'grant credits' lever).","operationId":"set_end_user_limit_v1_spaces__slug__end_users__ref__patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndUserLimitIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/end-users":{"get":{"tags":["turns"],"summary":"List End Users","description":"List the space's end-users with cumulative spend + limit, in energy.","operationId":"list_end_users_v1_spaces__slug__end_users_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/turns":{"post":{"tags":["turns"],"summary":"Create Turn","operationId":"create_turn_v1_turns_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTurnIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/turns/{turn_id}":{"get":{"tags":["turns"],"summary":"Get Turn","operationId":"get_turn_v1_turns__turn_id__get","parameters":[{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/turns/{turn_id}/cancel":{"post":{"tags":["turns"],"summary":"Cancel Turn","operationId":"cancel_turn_v1_turns__turn_id__cancel_post","parameters":[{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/turns/{turn_id}/files":{"get":{"tags":["turns"],"summary":"List Turn Files","description":"Files produced by a turn in a space the caller's account owns — the console's\ndownload buttons. Account-level (like history + /v1/files/{id}), so it works\nregardless of which of the account's keys produced the turn.","operationId":"list_turn_files_v1_turns__turn_id__files_get","parameters":[{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/files/{file_id}":{"get":{"tags":["turns"],"summary":"Download File","description":"Download by opaque id — Bearer + ownership scoped, bytes proxied from the store.\n404 (not 403) on an unknown/non-owned id so existence isn't even leaked.","operationId":"download_file_v1_files__file_id__get","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/files":{"post":{"tags":["turns"],"summary":"Upload Space File","description":"Upload an attachment into a space you own — the bytes land in the FileStore as\nan unbound `upload`. Reference the returned `file_id` in `POST /v1/turns`\n(`file_ids: [...]`) to attach it to a turn; the bot then pulls the bytes into the\nspace before the agent runs (same as a Telegram file download). Key-scoped: a key\nonly reaches spaces it owns (own-scoped → only spaces it created). Max 200 MB,\nstreamed: the body is never held whole in memory.","operationId":"upload_space_file_v1_spaces__slug__files_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_space_file_v1_spaces__slug__files_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/responses":{"post":{"tags":["responses"],"summary":"Create Response","description":"Create a response (OpenAI Responses API). One-off unless the key has\n`continue_space` on or `previous_response_id` continues a thread; see\n/v1/docs#responses.","operationId":"create_response_v1_responses_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseCreateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/responses/{response_id}":{"get":{"tags":["responses"],"summary":"Retrieve Response","description":"A response by id (poll a background response; `?stream=true` streams it\nfrom here to its end).","operationId":"retrieve_response_v1_responses__response_id__get","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}},{"name":"stream","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Stream"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/responses/{response_id}/cancel":{"post":{"tags":["responses"],"summary":"Cancel Response","description":"Cancel a response's turn (idempotent: a finished one answers its state).","operationId":"cancel_response_v1_responses__response_id__cancel_post","parameters":[{"name":"response_id","in":"path","required":true,"schema":{"type":"string","title":"Response Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/key":{"get":{"tags":["responses"],"summary":"Get Key","description":"This key's options (`continue_space`: /v1/responses runs a call without\nprevious_response_id in the key's space instead of one-off).","operationId":"get_key_v1_key_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["responses"],"summary":"Patch Key","description":"Set this key's options.","operationId":"patch_key_v1_key_patch","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyOptionsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks":{"post":{"tags":["webhooks"],"summary":"Create Webhook","description":"Register a webhook for this key. The signing `secret` is returned in THIS\nresponse only (never on GET); omit it to have one generated.","operationId":"create_webhook_v1_webhooks_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["webhooks"],"summary":"List Webhooks","operationId":"list_webhooks_v1_webhooks_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}":{"get":{"tags":["webhooks"],"summary":"Get Webhook","operationId":"get_webhook_v1_webhooks__webhook_id__get","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["webhooks"],"summary":"Patch Webhook","description":"Edit url / events / space / active, or rotate the secret (`secret` to set\nyour own, `rotate_secret: true` to have one generated). A rotated secret is\nreturned once in this response. Re-activating a webhook the platform disabled\n(410 Gone, or 'failing' after sustained failures) clears `disabled_reason`\nand the failure streak.","operationId":"patch_webhook_v1_webhooks__webhook_id__patch","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhooks"],"summary":"Delete Webhook","description":"Remove the webhook. Pending deliveries to it are dropped; delivered/failed\nrows stay for the log (their webhook_id becomes null).","operationId":"delete_webhook_v1_webhooks__webhook_id__delete","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Deliveries","description":"Most recent deliveries to this webhook: status, code, attempts, timestamps.","operationId":"list_deliveries_v1_webhooks__webhook_id__deliveries_get","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/turns/{turn_id}/deliveries":{"get":{"tags":["webhooks"],"summary":"List Turn Deliveries","description":"Every delivery for one of this key's turns — including one-off per-turn\n`webhook_url` targets, which have no webhook row to list them under.","operationId":"list_turn_deliveries_v1_turns__turn_id__deliveries_get","parameters":[{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/{webhook_id}/deliveries/{delivery_id}/redeliver":{"post":{"tags":["webhooks"],"summary":"Redeliver","description":"Replay a delivery: a new pending row with the same event id + payload.","operationId":"redeliver_v1_webhooks__webhook_id__deliveries__delivery_id__redeliver_post","parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"integer","title":"Webhook Id"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"Tasks in the key's spaces, most recently updated first. `space` narrows to\none space; `status` is open|done|partial|failed|cancelled|all; `q` matches the title\n(case-insensitive). Page with the opaque `next_cursor`.","operationId":"list_tasks_v1_tasks_get","parameters":[{"name":"space","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Space"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","operationId":"get_task_v1_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/updates":{"get":{"tags":["tasks"],"summary":"List Task Updates","description":"The task's timeline, oldest first. Pass the last seen `id` (or the\nreturned `next_cursor`) as `after` to get only what happened since.","operationId":"list_task_updates_v1_tasks__task_id__updates_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/spaces":{"get":{"tags":["account"],"summary":"List Account Spaces","description":"The owner's spaces with their stable numbers, lowest first.","operationId":"list_account_spaces_v1_account_spaces_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/spaces/{ref}":{"get":{"tags":["account"],"summary":"Get Account Space","description":"One space by number (\"3\") or slug — what \"Space 3\" means.","operationId":"get_account_space_v1_account_spaces__ref__get","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/account/spaces/{ref}/number":{"put":{"tags":["account"],"summary":"Renumber Account Space","description":"Give a space another number the owner is not using (409 NUMBER_TAKEN if\nanother space has it, archived ones included). Nothing else moves.","operationId":"renumber_account_space_v1_account_spaces__ref__number_put","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","title":"Ref"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenumberIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/cross-space/asks":{"get":{"tags":["account"],"summary":"List Asks","description":"The asks between the owner's spaces, newest first. `space` (number or\nslug) = either end; `from_space` / `to_space` = one end; `status` =\nqueued|running|done|failed; `since` = sent at or after (ISO 8601);\n`cursor` = the previous page's `next_cursor`.","operationId":"list_asks_v1_cross_space_asks_get","parameters":[{"name":"space","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Space"}},{"name":"from_space","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Space"}},{"name":"to_space","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Space"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/cross-space/asks/{ask_id}":{"get":{"tags":["account"],"summary":"Get Ask","description":"One ask with its full question and latest result.","operationId":"get_ask_v1_cross_space_asks__ask_id__get","parameters":[{"name":"ask_id","in":"path","required":true,"schema":{"type":"string","title":"Ask Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/calls":{"post":{"tags":["calls"],"summary":"Mint Call","description":"A single-use join link for one end user's live call with Octo in ``slug``.\nAn ``Idempotency-Key`` makes a retry return the same link.","operationId":"mint_call_v1_spaces__slug__calls_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintCallIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/spaces/{slug}/calls/{call_id}":{"get":{"tags":["calls"],"summary":"Get Call","description":"An app's call, for any key of the account that minted it, in a space the\nkey reaches: state, minutes, energy, transcript, the summary turn and its\nmetrics (time to first audio, tiers and handoffs, energy by part).","operationId":"get_call_v1_spaces__slug__calls__call_id__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/transcriptions":{"post":{"tags":["audio"],"summary":"Create Transcription","description":"One recording to text (ElevenLabs Scribe), billed by its duration. An\n``Idempotency-Key`` makes a retry replay the transcript, billed once.","operationId":"create_transcription_v1_audio_transcriptions_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_transcription_v1_audio_transcriptions_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/speech":{"post":{"tags":["audio"],"summary":"Create Speech","description":"Text to speech, streamed back as it is made; billed by characters once\nthe first audio byte is out. With an ``Idempotency-Key`` a repeat is never\nbilled twice: the audio is not kept, so it answers 409\n``IDEMPOTENCY_ALREADY_PROCESSED`` with the first request's audio id.","operationId":"create_speech_v1_audio_speech_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audio/usage/{audio_id}":{"get":{"tags":["audio"],"summary":"Get Audio Usage","description":"One /v1/audio request of this key's account: what it metered and cost.","operationId":"get_audio_usage_v1_audio_usage__audio_id__get","parameters":[{"name":"audio_id","in":"path","required":true,"schema":{"type":"string","title":"Audio Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AppApiIn":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"},"mcp_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mcp Url"},"docs_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docs Url"},"credentials":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Credentials"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"},"acts_for":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acts For"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"}},"type":"object","title":"AppApiIn","description":"An app's own API for a space (services/app_api). `credentials` become the\nspace's encrypted secrets and are never returned; `mcp_url` is registered as\nthe space's MCP server `name`; the rest lands in the space's manifest."},"Body_create_transcription_v1_audio_transcriptions_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"model":{"type":"string","title":"Model","default":"scribe_v2"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"timestamps":{"type":"boolean","title":"Timestamps","default":false}},"type":"object","required":["file"],"title":"Body_create_transcription_v1_audio_transcriptions_post"},"Body_upload_space_file_v1_spaces__slug__files_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_space_file_v1_spaces__slug__files_post"},"CreateSpaceIn":{"properties":{"engine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"external_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Ref"},"end_user_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Ref"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"capabilities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capabilities"},"midturn_filter":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Midturn Filter"},"secrets_from_parent":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Secrets From Parent"},"app_api":{"anyOf":[{"$ref":"#/components/schemas/AppApiIn"},{"type":"null"}]}},"type":"object","title":"CreateSpaceIn"},"CreateTurnIn":{"properties":{"space":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Space"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"engine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine"},"end_user_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Ref"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"file_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"File Ids"},"voice_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice File Id"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"webhook_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret"},"stateless":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stateless"},"announce_on_call":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Announce On Call"}},"type":"object","title":"CreateTurnIn"},"EndUserLimitIn":{"properties":{"total_limit_energy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Limit Energy"},"total_limit_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Limit Usd"}},"type":"object","title":"EndUserLimitIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KeyOptionsIn":{"properties":{"continue_space":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Continue Space"}},"type":"object","title":"KeyOptionsIn"},"LimitsIn":{"properties":{"daily_energy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Daily Energy"}},"type":"object","title":"LimitsIn"},"ManifestIn":{"properties":{"manifest":{"type":"string","title":"Manifest"}},"type":"object","required":["manifest"],"title":"ManifestIn"},"MintCallIn":{"properties":{"end_user_ref":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"End User Ref"},"display_name":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Display Name"},"lang":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Lang"},"mode":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Mode"}},"type":"object","title":"MintCallIn"},"PatchSpaceIn":{"properties":{"model_pin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Pin"},"engine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Engine"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},"type":"object","title":"PatchSpaceIn"},"PolicyIn":{"properties":{"orchestration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orchestration"},"switch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Switch"}},"additionalProperties":true,"type":"object","title":"PolicyIn"},"RenumberIn":{"properties":{"number":{"type":"integer","title":"Number"}},"type":"object","required":["number"],"title":"RenumberIn"},"ResponseCreateIn":{"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"input":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Input"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"previous_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Response Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"stream":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Stream","default":false},"store":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Store","default":true},"background":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Background","default":false},"tools":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"title":"Tool Choice"},"text":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Text"},"conversation":{"title":"Conversation"},"prompt":{"title":"Prompt"},"space":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Space"}},"additionalProperties":true,"type":"object","title":"ResponseCreateIn","description":"The OpenAI Responses request. Fields not listed are accepted and ignored."},"SecretIn":{"properties":{"secret":{"type":"string","title":"Secret"}},"type":"object","required":["secret"],"title":"SecretIn"},"SpaceSecretsIn":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"secrets":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Secrets"}},"type":"object","title":"SpaceSecretsIn"},"SpeechIn":{"properties":{"input":{"type":"string","title":"Input"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["input"],"title":"SpeechIn"},"TenantSettingsIn":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"end_user_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End User Ref"},"capabilities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Capabilities"},"midturn_filter":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Midturn Filter"},"secrets_from_parent":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Secrets From Parent"}},"type":"object","title":"TenantSettingsIn"},"ToolsIn":{"properties":{"allow":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allow"},"mcp_servers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Mcp Servers"}},"type":"object","title":"ToolsIn"},"ToolsPatchIn":{"properties":{"allow":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allow"},"mcp_servers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Mcp Servers"}},"type":"object","title":"ToolsPatchIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookIn":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"space":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Space"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"WebhookIn"},"WebhookPatchIn":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"space":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Space"},"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"rotate_secret":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rotate Secret"}},"type":"object","title":"WebhookPatchIn"}}},"servers":[{"url":"/"}]}