{"openapi":"3.1.0","info":{"title":"JackHamr API","description":"Your AI dev team. Programmatic access to JackHamr agents, tasks, chat, boards, billing, and more.\n\n**Rate limit:** 100 requests/minute per API key → `429` with a `Retry-After` header.\n\n**Automated clients:** requests pass through an edge WAF first. Default HTTP-library User-Agents (e.g. `python-requests`, high-volume `curl`) may be blocked at the edge with a bare `403` (`error code: 1010`, plain text, not the JSON error envelope) before reaching the app's rate limiter. Send a descriptive/browser-like `User-Agent` to get the documented `429` behavior.","version":"1.0.0"},"paths":{"/keys":{"post":{"tags":["API Keys"],"summary":"Create an API key","description":"Generate a new org-scoped API key.\n\nThe full plaintext key is returned **only** in this response; it is\nnever retrievable again. Subsequent reads return only the masked\n``key_prefix``.","operationId":"create_api_key_keys_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["API Keys"],"summary":"List API keys","description":"List the caller's API keys for the current org.\n\nReturns only the masked ``key_prefix``, never the full key.\nCursor-paginated via ``limit`` / ``cursor`` query params.\n\nThe cursor is decoded eagerly so a malformed cursor surfaces a 422\n``bad_cursor`` before the database is touched. The cursor window is\nthen applied in memory (matching :mod:`app.api_public.agents`):\n``list_keys`` orders by ``created_at.desc()``, so we decode the\ncursor, drop rows up to and including the cursor id, and let\n``build_cursor_from_rows`` split the page + next cursor. When no\ncursor is supplied we fetch ``limit + 1`` so the page builder can\ndetect a next page.","operationId":"list_api_keys_keys_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/{key_id}":{"get":{"tags":["API Keys"],"summary":"Get an API key","description":"Return a single API key (masked prefix only).\n\nReturns 404 when the key does not exist or is not owned by the\ncaller; the org scope is already enforced by ``require_org_role``\nand the service's ``user_id`` filter.","operationId":"get_api_key_keys__key_id__get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["API Keys"],"summary":"Revoke an API key","description":"Revoke an API key by id.\n\nIdempotent: revoking an already-revoked key returns the same\nrow with ``status='revoked'`` without erroring. Returns 404 when\nthe key does not exist or is not owned by the caller.","operationId":"revoke_api_key_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents":{"get":{"tags":["Agents"],"summary":"List agents in the caller's org","description":"List agents in the principal's org.\n\nStrict visibility rules (mirrored from ``AgentService.list_agents``):\nonly agents the caller owns, agents shared org-wide, or agents\nexplicitly shared with the caller are returned. NULL-owner rows\nare hidden from everyone. Ephemeral board clones are excluded.\n\nCursor-paginated via ``limit`` / ``cursor`` query params.","operationId":"list_agents_agents_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_AgentOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Agents"],"summary":"Create and provision an agent","description":"Create a new agent in the caller's org and start provisioning.\n\nReturns 201 with the pending agent record; provisioning (Proxmox\ncontainer, WireGuard, SSH) then runs in a background task. Poll\n``GET /agents/{id}`` to track provisioning status (``pending`` →\n``provisioning`` → ``running``). Requires ``owner`` or ``admin`` role.","operationId":"create_agent_agents_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}":{"get":{"tags":["Agents"],"summary":"Get an agent","description":"Return a single agent by id.\n\n404 when the agent does not exist, belongs to another org, or the\ncaller lacks visibility (owner/share/org-visible). The org scope is\nenforced by ``AgentService.get_agent``'s ownership check; a wrong-org\nagent surfaces as ``AgentNotFoundError`` → 404 so existence is not\nleaked across org boundaries.\n\nNote: ``DELETE`` is a **soft delete**: a destroyed agent stays\nreadable here with ``status: \"destroyed\"`` rather than returning 404.\nPoll for ``status == \"destroyed\"`` to confirm teardown; do not rely on\na 404 (QA Finding #6).","operationId":"get_agent_agents__agent_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Agents"],"summary":"Update agent configuration","description":"Update agent metadata and context-engine fields.\n\nUpdatable: name, description, tags, metadata, soul_override,\nidentity_override, user_override, skill_id, timezone, agent_memory\n(set to null to clear). Uses ``exclude_unset`` so omitted fields\nare left untouched.","operationId":"update_agent_agents__agent_id__patch","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agents"],"summary":"Destroy an agent","description":"Destroy an agent and clean up all resources.\n\nRemoves the Proxmox LXC container, WireGuard tunnel, SSH pool\nregistration, and snapshots. ``force=true`` destroys even if the\nagent is currently running. This is a **soft delete**: the record\nremains readable via ``GET /agents/{id}`` afterward with\n``status: \"destroyed\"`` (it does not 404). See that endpoint.","operationId":"destroy_agent_agents__agent_id__delete","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Force destroy even if running","default":false,"title":"Force"},"description":"Force destroy even if running"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDestroyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/start":{"post":{"tags":["Agents"],"summary":"Start an agent","description":"Start a stopped agent's LXC container.","operationId":"start_agent_agents__agent_id__start_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/stop":{"post":{"tags":["Agents"],"summary":"Stop an agent","description":"Stop a running agent's LXC container (non-destructive).","operationId":"stop_agent_agents__agent_id__stop_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/hibernate":{"post":{"tags":["Agents"],"summary":"Hibernate an agent","description":"Hibernate an agent by snapshotting then stopping it.","operationId":"hibernate_agent_agents__agent_id__hibernate_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"snapshot_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Custom snapshot name","title":"Snapshot Name"},"description":"Custom snapshot name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentHibernateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/resume":{"post":{"tags":["Agents"],"summary":"Resume an agent from hibernation","description":"Resume a hibernated or stopped agent.","operationId":"resume_agent_agents__agent_id__resume_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"use_snapshot","in":"query","required":false,"schema":{"type":"boolean","description":"Restore from hibernation snapshot","default":true,"title":"Use Snapshot"},"description":"Restore from hibernation snapshot"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResumeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/clone":{"post":{"tags":["Agents"],"summary":"Clone an agent","description":"Clone an existing agent's LXC container into a new agent.\n\nReturns 202 immediately with the new agent id; the Proxmox clone +\nWireGuard setup run in the background. Poll ``GET /agents/{new_id}``\nto track provisioning.","operationId":"clone_agent_agents__agent_id__clone_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneAgentRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCloneResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/metrics":{"get":{"tags":["Agents"],"summary":"Get agent resource metrics","description":"Live CPU, memory, disk, and network metrics for a running agent.\n\nThe agent must be running and have a provisioned VMID; otherwise a\n422 ``validation_error`` (agent not running / no VMID) is returned.","operationId":"get_agent_metrics_agents__agent_id__metrics_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMetrics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks":{"get":{"tags":["Tasks"],"summary":"List tasks in the caller's org","description":"List tasks in the principal's org, newest first.\n\nOrg scope is enforced by joining ``tasks`` → ``agents`` on the\ncaller's ``organization_id``. The optional ``board_id`` filter\nnarrows to tasks whose ``agent_id`` matches, useful for surfacing\na single board's work. Cursor-paginated via ``limit``/``cursor``\n(the cursor is decoded lazily by ``build_cursor_from_rows``).","operationId":"list_tasks_tasks_get","parameters":[{"name":"board_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by agent (board) id; tasks are scoped to an agent","title":"Board Id"},"description":"Filter by agent (board) id; tasks are scoped to an agent"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_TaskOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Tasks"],"summary":"Create a task","description":"Create a new task in the caller's org.\n\nWhen ``agent_id`` is provided it must belong to the caller's org;\notherwise a 422 is returned. The task starts in ``pending`` status.","operationId":"create_task_tasks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}":{"get":{"tags":["Tasks"],"summary":"Get a task","description":"Return a single task by id. 404 when not found or outside the org.","operationId":"get_task_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Tasks"],"summary":"Update task metadata","description":"Update task metadata.\n\nUpdatable: name, description, priority, scheduled_at. Status changes\nmust go through the lifecycle endpoints (pause/resume/cancel/retry).\nUses ``exclude_unset`` so omitted fields are left untouched.","operationId":"update_task_tasks__task_id__patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Tasks"],"summary":"Delete a task","description":"Permanently delete a task. 404 when not found or outside the org.","operationId":"delete_task_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}/pause":{"post":{"tags":["Tasks"],"summary":"Pause a running task","description":"Pause a running task. 404 if not found; 409 if not running.","operationId":"pause_task_tasks__task_id__pause_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}/resume":{"post":{"tags":["Tasks"],"summary":"Resume a paused task","description":"Resume a paused task. 404 if not found; 409 if not paused.","operationId":"resume_task_tasks__task_id__resume_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}/cancel":{"post":{"tags":["Tasks"],"summary":"Cancel a pending or running task","description":"Cancel a pending, running, or paused task. 409 otherwise.","operationId":"cancel_task_tasks__task_id__cancel_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}/retry":{"post":{"tags":["Tasks"],"summary":"Retry a failed or cancelled task","description":"Retry a failed or cancelled task. Increments ``retry_count``.\n\n404 if not found; 409 if not in a retryable terminal state.","operationId":"retry_task_tasks__task_id__retry_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}/dependencies":{"post":{"tags":["Tasks"],"summary":"Add a dependency to a task","description":"Mark ``depends_on_task_id`` as a prerequisite of ``task_id``.\n\nBoth tasks must exist and belong to the caller's org. Self-deps\nand duplicates are rejected (409). The dependency is stored as an\nid in the task's JSON ``dependencies`` array.","operationId":"add_dependency_tasks__task_id__dependencies_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DependencyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DependencyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Tasks"],"summary":"List a task's dependencies","description":"List prerequisite tasks for ``task_id``.\n\nEach edge is returned as ``DependencyOut(from_task_id, to_task_id)``\nwhere ``from_task_id`` is the prerequisite and ``to_task_id`` is the\ndependent (always ``task_id``).","operationId":"list_dependencies_tasks__task_id__dependencies_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DependencyOut"},"title":"Response List Dependencies Tasks  Task Id  Dependencies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions":{"get":{"tags":["Chat"],"summary":"List chat sessions in the caller's org","description":"List chat sessions in the principal's org, newest first.\n\nOrg scope is enforced by joining ``chat_sessions`` → ``agents`` on\nthe caller's ``organization_id``. The optional ``agent_id`` filter\nnarrows to a single agent's sessions. Cursor-paginated via\n``limit``/``cursor`` (the cursor is decoded lazily by\n``build_cursor_from_rows``, same pattern as the tasks/keys routers).","operationId":"list_sessions_chat_sessions_get","parameters":[{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to sessions of a specific agent","title":"Agent Id"},"description":"Filter to sessions of a specific agent"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ChatSessionOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Chat"],"summary":"Create a chat session","description":"Create a new chat session in the caller's org.\n\nThe ``agent_id`` must belong to the caller's org; otherwise a 422\n``agent_not_found`` is returned (so a bad agent id is distinguishable\nfrom a not-found session). The session's ``token_max`` is resolved\nfrom the agent's model context window via\n:func:`resolve_agent_token_max`, matching the internal chat router.","operationId":"create_session_chat_sessions_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}":{"get":{"tags":["Chat"],"summary":"Get a chat session","description":"Return a single chat session by id.\n\n404 when the session does not exist or belongs to another org;\nexistence is never leaked across org boundaries.","operationId":"get_session_chat_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Chat"],"summary":"Update chat session metadata","description":"Update a chat session's metadata.\n\nUpdatable: ``title``, ``is_favorite``. Uses ``exclude_unset`` so\nomitted fields are left untouched. An empty title is rejected with a\n422 (matches the internal rename endpoint's non-empty rule).","operationId":"update_session_chat_sessions__session_id__patch","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Chat"],"summary":"Delete a chat session","description":"Delete a chat session and all its messages.\n\nCancels any in-flight chat run for the session (best-effort) before\nremoving the row. 404 when not found or outside the org.","operationId":"delete_session_chat_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/messages":{"get":{"tags":["Chat"],"summary":"List messages in a chat session","description":"Return the message history for a chat session, newest first.\n\nThe session must belong to the caller's org (404 otherwise). The\npublic API returns a flat, cursor-paginated window of messages\nordered by ``(created_at, id)``, the same ordering the\n``build_cursor_from_rows`` helper expects. Backend-internal\n``auto_resume_preamble`` rows are hidden (they're plumbing, not\nuser/agent content) so the public history matches the chat UI.","operationId":"list_messages_chat_sessions__session_id__messages_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ChatMessageOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Chat"],"summary":"Send a message to a chat session","description":"Send a user message to a chat session (REST only, no streaming).\n\nDelegates to :func:`deliver_user_message_to_session`, the canonical\nnon-WebSocket send path also used by board-card \"send to agent\" and\ngate-answer flows. That helper persists the user message and drives\nthe orchestrator: steering an active run (mid-run queue) or starting\na fresh turn (idle → dispatch). The persisted user message is fetched\nback by its ``client_msg_id`` and returned so the client can render\nthe bubble immediately.\n\nA delivery status of ``\"locked\"`` (another run holds the orchestrator\nlock) surfaces as a 409 ``session_locked``; ``\"busy\"`` (the mid-run\nqueue rejected the enqueue) surfaces as a 409 ``session_busy``. In\nboth cases the message may still have been persisted, but the\norchestrator did not accept it for a turn, so the client should retry.","operationId":"send_message_chat_sessions__session_id__messages_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards":{"get":{"tags":["Boards"],"summary":"List boards in the caller's org","description":"List boards the caller can see, newest first.\n\nDelegates to ``board_service.list_boards`` which resolves boards\nthrough the user's org memberships (including virtual orchestrator\nboards). The result is cursor-paginated in-memory via the shared\n``build_cursor_from_rows`` helper.","operationId":"list_boards_boards_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_BoardOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Boards"],"summary":"Create a board","description":"Create a new board in the caller's org with an initial team.","operationId":"create_board_boards_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards/{board_id}":{"get":{"tags":["Boards"],"summary":"Get a board with its columns and cards","description":"Return a single board with its columns (each with cards).\n\n404 when the board does not exist or belongs to another org.\nVirtual boards (``virtual-{skill_id}``) are derived from the skill.","operationId":"get_board_boards__board_id__get","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Boards"],"summary":"Update board metadata","description":"Update board metadata (name, description, status, accent, icon,\nexecution_mode). 404 when the board is not found or outside the org.","operationId":"update_board_boards__board_id__patch","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BoardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Boards"],"summary":"Archive a board","description":"Archive (soft-delete) a board. 404 when not found or outside the org.","operationId":"delete_board_boards__board_id__delete","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards/{board_id}/cards":{"get":{"tags":["Boards"],"summary":"List cards on a board","description":"List all non-archived cards on a board.\n\nCards are returned in the service's natural order (priority desc,\ncreated_at asc). 404 when the board is not found or outside the org.","operationId":"list_cards_boards__board_id__cards_get","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CardOut"},"title":"Response List Cards Boards  Board Id  Cards Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Boards"],"summary":"Create a card on a board","description":"Create a new card on the board. The card starts in ``backlog``.\n\nA virtual board is materialized into a real board on its first card.","operationId":"create_card_boards__board_id__cards_post","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards/{board_id}/cards/{card_id}":{"patch":{"tags":["Boards"],"summary":"Update a card","description":"Update editable card fields (title, description, stages, clone\nlifecycle settings) and/or move the card (state, column_key,\npriority, assignee_agent_id). 404 when the board or card is not\nfound.","operationId":"update_card_boards__board_id__cards__card_id__patch","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Boards"],"summary":"Archive a card","description":"Archive (soft-delete) a card. 404 when the board or card is not found.","operationId":"delete_card_boards__board_id__cards__card_id__delete","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards/{board_id}/columns":{"get":{"tags":["Boards"],"summary":"List columns on a board","description":"List the board's columns (each with its cards).\n\n404 when the board is not found or outside the org.","operationId":"list_columns_boards__board_id__columns_get","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ColumnOut"},"title":"Response List Columns Boards  Board Id  Columns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards/{board_id}/members":{"post":{"tags":["Boards"],"summary":"Add a member to a board","description":"Add an agent to the board's team.\n\nReturns the updated team roster. 404 when the board is not found;\n422 when the agent doesn't exist, is cross-org, or lacks the\nboard's orchestrator skill.","operationId":"add_member_boards__board_id__members_post","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberAdd"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentRef"},"title":"Response Add Member Boards  Board Id  Members Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/boards/{board_id}/members/{agent_id}":{"delete":{"tags":["Boards"],"summary":"Remove a member (agent) from a board","description":"Remove an agent from the board's team.\n\nBoard members are agents (``POST .../members`` takes ``agent_id``), so\nthe path parameter is the agent id. It was previously named\n``user_id``, which misleadingly implied a human user (QA Finding #9).\nReturns the updated team roster. 404 when the board is not found or\noutside the org.","operationId":"remove_member_boards__board_id__members__agent_id__delete","parameters":[{"name":"board_id","in":"path","required":true,"schema":{"type":"string","title":"Board Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentRef"},"title":"Response Remove Member Boards  Board Id  Members  Agent Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs":{"get":{"tags":["Organizations"],"summary":"List organizations the caller belongs to","description":"List every organization the caller is a member of.\n\nCursor-paginated via ``limit`` / ``cursor`` query params. For\nAPI-key principals this typically returns a single org (the key's\nbound org); for JWT principals it returns every org the user\nbelongs to.","operationId":"list_orgs_orgs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_OrgOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}":{"get":{"tags":["Organizations"],"summary":"Get an organization","description":"Return a single organization by id.\n\n404 when the org does not exist or the caller is not a member.\nExistence is not leaked across org boundaries.","operationId":"get_org_orgs__org_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members":{"get":{"tags":["Organizations"],"summary":"List members of an organization","description":"List all members of an organization with user details.\n\n404 when the org does not exist or the caller is not a member.","operationId":"list_org_members_orgs__org_id__members_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrgMemberOut"},"title":"Response List Org Members Orgs  Org Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Organizations"],"summary":"Add a member to an organization","description":"Add a user to an organization by email.\n\nRequires ``owner`` or ``admin`` org role. The new member is\nidentified by ``email`` (the public API never exposes internal\nuser ids). ``owner`` is rejected; ownership changes go through\ntransfer-ownership. Only the ``owner`` may assign the ``admin``\nrole; admins may only add ``member``/``viewer`` members. 404 when\nthe org or target user does not exist; 409 when the user is\nalready a member.","operationId":"add_org_member_orgs__org_id__members_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberAdd"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members/{user_id}":{"patch":{"tags":["Organizations"],"summary":"Update a member's role","description":"Change a member's role in the organization.\n\nRequires the ``owner`` org role. The org Owner's own role cannot\nbe changed via this endpoint (ownership transfer is a separate\nflow). 404 when the org or member does not exist.","operationId":"update_org_member_orgs__org_id__members__user_id__patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Organizations"],"summary":"Remove a member from an organization","description":"Remove a member from an organization.\n\nRequires the ``owner`` org role. The org Owner cannot be removed\n(transfer ownership first). Agents owned by the removed member are\nreassigned to the org Owner. 404 when the org or member does not\nexist.","operationId":"remove_org_member_orgs__org_id__members__user_id__delete","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/templates":{"get":{"tags":["Templates"],"summary":"List templates visible to the caller's org","description":"List templates visible to the principal's org, newest first.\n\nIncludes org-scoped templates (``visibility == \"org\"``) and\nplatform-wide system templates (``visibility == \"system\"``).\nPrivate user templates are excluded. Cursor-paginated via\n``limit`` / ``cursor`` query params.","operationId":"list_templates_templates_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_TemplateOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/templates/{template_id}":{"get":{"tags":["Templates"],"summary":"Get a template","description":"Return a single template by id.\n\n404 when the template does not exist, belongs to another org, or is\na private user template. Existence is not leaked across org\nboundaries.","operationId":"get_template_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skills":{"get":{"tags":["Skills"],"summary":"List skills visible to the caller's org","description":"List skills visible to the principal's org, newest first.\n\nIncludes org-scoped skills and global platform skills. Cursor-\npaginated via ``limit`` / ``cursor`` query params.","operationId":"list_skills_skills_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SkillOut_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/skills/{skill_id}":{"get":{"tags":["Skills"],"summary":"Get a skill","description":"Return a single skill by id.\n\n404 when the skill does not exist or belongs to another org.\nExistence is not leaked across org boundaries.","operationId":"get_skill_skills__skill_id__get","parameters":[{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/summary":{"get":{"tags":["Billing"],"summary":"Get the caller's org cost summary","description":"Return the org-level cost summary for the period.\n\nDefaults to the current calendar month. Category totals come from\n:func:`~app.services.billing._queries.get_org_summary`.","operationId":"get_billing_summary_billing_summary_get","parameters":[{"name":"period_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of period (ISO 8601)","title":"Period Start"},"description":"Start of period (ISO 8601)"},{"name":"period_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of period (ISO 8601)","title":"Period End"},"description":"End of period (ISO 8601)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/breakdown":{"get":{"tags":["Billing"],"summary":"Get the caller's org cost breakdown","description":"Return costs broken down by category (default), agent, or user.\n\nDelegates to\n:func:`~app.services.billing._queries.get_org_breakdown`.","operationId":"get_billing_breakdown_billing_breakdown_get","parameters":[{"name":"period_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of period (ISO 8601)","title":"Period Start"},"description":"Start of period (ISO 8601)"},{"name":"period_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of period (ISO 8601)","title":"Period End"},"description":"End of period (ISO 8601)"},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","description":"Group by: category, agent, or user","default":"category","title":"Group By"},"description":"Group by: category, agent, or user"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingBreakdown"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/history":{"get":{"tags":["Billing"],"summary":"Get the caller's org daily billing history","description":"Return daily cost rows for the period, newest first.\n\nEach row is a single day's 5-category cost breakdown. Cursor-\npaginated via ``limit`` / ``cursor`` query params.","operationId":"get_billing_history_billing_history_get","parameters":[{"name":"period_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of period (ISO 8601)","title":"Period Start"},"description":"Start of period (ISO 8601)"},{"name":"period_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of period (ISO 8601)","title":"Period End"},"description":"End of period (ISO 8601)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_BillingHistoryItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/agents/{agent_id}/cost":{"get":{"tags":["Billing"],"summary":"Get hourly cost rows for a single agent","description":"Return hourly cost rows for a single agent in the caller's org.\n\nThe agent must belong to the caller's org; otherwise a 404 is\nreturned (existence is not leaked across org boundaries). Delegates\nto :func:`~app.services.billing._queries.get_costs_by_agent_detail`.","operationId":"get_agent_cost_billing_agents__agent_id__cost_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"period_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of period (ISO 8601)","title":"Period Start"},"description":"Start of period (ISO 8601)"},{"name":"period_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of period (ISO 8601)","title":"Period End"},"description":"End of period (ISO 8601)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BillingHistoryItem"},"title":"Response Get Agent Cost Billing Agents  Agent Id  Cost Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/credits/balance":{"get":{"tags":["Credits"],"summary":"Get the caller's org credit balance","description":"Return the org's credit balance, status, and plan info.\n\nReads through :class:`~app.services.credit_service.CreditService`\nwhich caches the balance in Redis and falls back to PostgreSQL.","operationId":"get_credit_balance_credits_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}}}}},"/credits/transactions":{"get":{"tags":["Credits"],"summary":"List credit transactions for the caller's org","description":"List the org's credit transactions, newest first.\n\nCursor-paginated via ``limit`` / ``cursor`` query params.","operationId":"list_credit_transactions_credits_transactions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_CreditTransaction_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/uploads/agents/{agent_id}/avatar":{"post":{"tags":["Uploads"],"summary":"Upload an agent avatar image","description":"Upload an image and set it as the agent's avatar.\n\nStores the uploaded bytes in the same ``app/static/avatars``\ndirectory the internal ``agent_avatars`` router uses, persists an\n:class:`~app.models.agent_avatar.AgentAvatar` row, and links it to\nthe agent via ``tags[\"avatar_id\"]`` (the convention every avatar\nlookup in the codebase reads). Returns the updated agent with the\nresolved ``avatar_image_url``.\n\nOrg scope: the agent must belong to the caller's org; a wrong-org\nagent surfaces as 404 so existence is not leaked across org\nboundaries. Requires the ``owner`` or ``admin`` org role.","operationId":"upload_agent_avatar_uploads_agents__agent_id__avatar_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_agent_avatar_uploads_agents__agent_id__avatar_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/uploads/chat/sessions/{session_id}/files":{"post":{"tags":["Uploads"],"summary":"Upload a chat session file attachment","description":"Upload a file attachment scoped to a chat session.\n\nMirrors the internal ``POST /api/chat/files/upload`` path: same\n``UPLOAD_DIR``, same MIME allow-list, same 50 MB cap, same\n``ChatFile`` row shape, same ``FileUploadResponse`` contract. The\nsession's agent must belong to the caller's org; a cross-org\nsession surfaces as 404 so existence is not leaked across org\nboundaries.","operationId":"upload_chat_session_file_uploads_chat_sessions__session_id__files_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_chat_session_file_uploads_chat_sessions__session_id__files_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/decision":{"get":{"tags":["Agent work"],"summary":"The decision the agent is waiting on, if any","operationId":"get_decision_chat_sessions__session_id__decision_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/decisions":{"get":{"tags":["Agent work"],"summary":"Every topic where an agent is waiting on you","operationId":"list_decisions_decisions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/decision/answer":{"post":{"tags":["Agent work"],"summary":"Answer the agent's open decision","operationId":"answer_decision_chat_sessions__session_id__decision_answer_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionAnswer"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/wait":{"get":{"tags":["Agent work"],"summary":"Wait (up to ~55s) for the agent to reply or ask you something","description":"Returns as soon as the turn ends, a decision opens, or ``timeout``\npasses. ``status``: ``done`` (replied, idle), ``waiting_on_you`` (open\ndecision), ``working`` (still running at timeout), ``error`` (the turn\nfailed; the error message is in ``messages``), ``idle``.","operationId":"wait_for_reply_chat_sessions__session_id__wait_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"after_message_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Message Id"}},{"name":"after_seq","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"After Seq"}},{"name":"timeout","in":"query","required":false,"schema":{"type":"integer","maximum":55,"minimum":0,"default":25,"title":"Timeout"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/files":{"get":{"tags":["Agent work"],"summary":"Files in a topic","operationId":"list_topic_files_chat_sessions__session_id__files_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/files/{file_id}":{"get":{"tags":["Agent work"],"summary":"A file's content (text, or base64 up to 5 MB)","operationId":"get_file_files__file_id__get","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/artifacts":{"get":{"tags":["Agent work"],"summary":"An agent's artifacts","operationId":"list_artifacts_agents__agent_id__artifacts_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/artifacts/{artifact_id}":{"get":{"tags":["Agent work"],"summary":"An artifact and its content","operationId":"get_artifact_agents__agent_id__artifacts__artifact_id__get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"artifact_id","in":"path","required":true,"schema":{"type":"string","title":"Artifact Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/workflows":{"get":{"tags":["Agent work"],"summary":"Workflows (multi-stage pipelines) an agent can run","operationId":"list_workflows_agents__agent_id__workflows_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/autonomy":{"get":{"tags":["Agent work"],"summary":"A topic's autonomy settings and plan","operationId":"get_autonomy_chat_sessions__session_id__autonomy_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Agent work"],"summary":"Turn on or change autonomy in a topic","operationId":"put_autonomy_chat_sessions__session_id__autonomy_put","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agent work"],"summary":"Turn autonomy off and forget its settings","operationId":"delete_autonomy_chat_sessions__session_id__autonomy_delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_id}/schedules":{"get":{"tags":["Agent work"],"summary":"Schedules in a topic","operationId":"list_schedules_chat_sessions__session_id__schedules_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Agent work"],"summary":"Create a schedule","operationId":"create_schedule_chat_sessions__session_id__schedules_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedules/{schedule_id}":{"patch":{"tags":["Agent work"],"summary":"Change a schedule","operationId":"update_schedule_schedules__schedule_id__patch","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agent work"],"summary":"Delete a schedule","operationId":"delete_schedule_schedules__schedule_id__delete","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/schedules/{schedule_id}/run":{"post":{"tags":["Agent work"],"summary":"Run a schedule now","operationId":"run_schedule_schedules__schedule_id__run_post","parameters":[{"name":"schedule_id","in":"path","required":true,"schema":{"type":"string","title":"Schedule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/exec":{"post":{"tags":["Agent work"],"summary":"Run a shell command on the agent's machine","operationId":"exec_command_agents__agent_id__exec_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/fs":{"get":{"tags":["Agent work"],"summary":"Read a file on the agent's machine","operationId":"read_machine_file_agents__agent_id__fs_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":4096,"title":"Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Agent work"],"summary":"Write a file on the agent's machine","operationId":"write_machine_file_agents__agent_id__fs_put","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents/{agent_id}/previews":{"get":{"tags":["Agent work"],"summary":"Published preview URLs for the agent's ports","operationId":"list_previews_agents__agent_id__previews_get","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Agent work"],"summary":"Publish a port on the agent's machine at a public URL","operationId":"create_preview_agents__agent_id__previews_post","parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/me":{"get":{"tags":["partner"],"summary":"Me","description":"Your partner, pool balance and customer-org totals.","operationId":"me_partner_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/partner/agent-sizes":{"get":{"tags":["partner"],"summary":"Agent Sizes","description":"Compute sizes (id, specs, live hourly price) and your default + lock.","operationId":"agent_sizes_partner_agent_sizes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/partner/orgs":{"get":{"tags":["partner"],"summary":"List Orgs","description":"Your customer orgs with balance, cap, 30-day usage and status.","operationId":"list_orgs_partner_orgs_get","parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["partner"],"summary":"Create Org","description":"Create a customer org (+ credits, agent limit, size) and invite its owner.\nSend ``Idempotency-Key`` so a retry can't create twice.","operationId":"create_org_partner_orgs_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOrgCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/orgs/{org_id}":{"patch":{"tags":["partner"],"summary":"Update Org","description":"``{cap?, is_active?}``: credit cap, or suspend / reactivate.","operationId":"update_org_partner_orgs__org_id__patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOrgUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/orgs/{org_id}/limits":{"get":{"tags":["partner"],"summary":"Get Limits","operationId":"get_limits_partner_orgs__org_id__limits_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["partner"],"summary":"Set Limits","description":"``{max_agents?, size_preset_id?}``: 0 agents = no limit; size null = your default.","operationId":"set_limits_partner_orgs__org_id__limits_patch","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOrgLimits"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/credits":{"post":{"tags":["partner"],"summary":"Assign Credits","description":"Assign credits to a customer (``org_id`` or ``email``) from your pool;\na negative ``amount`` takes credits back. 409 insufficient_pool /\ncap_exceeded / ambiguous_email; 404 when nobody matches. Send\n``Idempotency-Key`` to make retries safe.","operationId":"assign_credits_partner_credits_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/orgs/{org_id}/credits":{"post":{"tags":["partner"],"summary":"Assign Org Credits","operationId":"assign_org_credits_partner_orgs__org_id__credits_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/usage":{"get":{"tags":["partner"],"summary":"Usage","description":"A customer's usage over ``days`` (``org_id`` or ``email``): total and by\nkind, per day, per agent, per member, plus their current balance.","operationId":"usage_partner_usage_get","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Org Id"}},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":366,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/orgs/{org_id}/usage":{"get":{"tags":["partner"],"summary":"Org Usage","operationId":"org_usage_partner_orgs__org_id__usage_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":366,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/orgs/{org_id}/agents":{"get":{"tags":["partner"],"summary":"Org Agents","description":"A customer's agents (name, size, status) with each one's hourly price and cost over ``days``.","operationId":"org_agents_partner_orgs__org_id__agents_get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":366,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/partner/hq-agents":{"get":{"tags":["partner"],"summary":"Hq Agents","description":"Agents in your own workspace that can be copied to customers.","operationId":"hq_agents_partner_hq_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/partner/orgs/{org_id}/agents/duplicate":{"post":{"tags":["partner"],"summary":"Duplicate Agent","description":"Copy one of your agents into the customer's account. Before their owner\njoins, the copy is held by the partner admin who created this API key and\nhanded to the owner when they accept.","operationId":"duplicate_agent_partner_orgs__org_id__agents_duplicate_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDuplicate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentActionResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"action":{"type":"string","title":"Action"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["agent_id","action","status","message"],"title":"AgentActionResponse","description":"Generic lifecycle-action response (start/stop)."},"AgentCloneResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"source_agent_id":{"type":"string","title":"Source Agent Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["agent_id","source_agent_id","name","status","message"],"title":"AgentCloneResponse","description":"Clone response — returned with 202 Accepted."},"AgentCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"os_template":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Os Template","default":"ubuntu-22.04-standard_22.04-1_amd64.tar.zst"},"cores":{"type":"integer","maximum":32.0,"minimum":1.0,"title":"Cores","default":2},"memory":{"type":"integer","maximum":131072.0,"minimum":512.0,"title":"Memory","default":4096},"disk_size":{"type":"integer","maximum":1000.0,"minimum":5.0,"title":"Disk Size","default":10},"hostname":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Hostname"},"tags":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tags"},"avatar_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avatar Id"},"subtitle":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Subtitle"},"size_preset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Size Preset Id"}},"type":"object","required":["name"],"title":"AgentCreate","description":"Request body for ``POST /api/v1/agents``."},"AgentDestroyResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"destroyed_at":{"type":"string","format":"date-time","title":"Destroyed At"}},"type":"object","required":["agent_id","status","message","destroyed_at"],"title":"AgentDestroyResponse","description":"Destroy response."},"AgentDuplicate":{"properties":{"source_agent_id":{"type":"string","maxLength":36,"minLength":1,"title":"Source Agent Id"},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"}},"additionalProperties":false,"type":"object","required":["source_agent_id"],"title":"AgentDuplicate","description":"Copy an agent from the partner's own (HQ) workspace into a customer org."},"AgentHibernateResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"snapshot_name":{"type":"string","title":"Snapshot Name"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"hibernated_at":{"type":"string","format":"date-time","title":"Hibernated At"}},"type":"object","required":["agent_id","snapshot_name","status","message","hibernated_at"],"title":"AgentHibernateResponse","description":"Hibernation response."},"AgentMetrics":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"cpu_usage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpu Usage"},"cpu_cores_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cpu Cores Used"},"memory_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Memory Used"},"memory_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Memory Total"},"memory_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Memory Percent"},"disk_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Used"},"disk_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Total"},"disk_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Percent"},"net_in":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net In"},"net_out":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Net Out"},"process_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Process Count"},"uptime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uptime"}},"type":"object","required":["agent_id","timestamp"],"title":"AgentMetrics","description":"Live resource metrics for an agent."},"AgentOut":{"properties":{"id":{"type":"string","title":"Id"},"organization_id":{"type":"string","title":"Organization Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","title":"Status"},"owner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner User Id"},"allow_cloning":{"type":"boolean","title":"Allow Cloning","default":false},"visible_to_org":{"type":"boolean","title":"Visible To Org","default":false},"cores":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cores"},"memory":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Memory"},"disk_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Disk Size"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"os_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Template"},"size_preset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Size Preset Id"},"sort_order":{"type":"integer","title":"Sort Order","default":0},"is_board_clone":{"type":"boolean","title":"Is Board Clone","default":false},"clone_of_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clone Of Agent Id"},"avatar_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Image Url"},"avatar_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Color"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"tags":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tags"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"subagent_max_iterations":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Subagent Max Iterations"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"last_error_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Error At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"provisioned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provisioned At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"stopped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stopped At"},"hibernated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Hibernated At"}},"type":"object","required":["id","organization_id","name","status","created_at","updated_at"],"title":"AgentOut","description":"An agent as returned by ``GET/POST /api/v1/agents``."},"AgentRef":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"clone_of_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Clone Of Agent Id"}},"type":"object","required":["id","name"],"title":"AgentRef","description":"Compact agent reference for team rosters / assignee chips."},"AgentResumeResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"resumed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resumed At"}},"type":"object","required":["agent_id","status","message"],"title":"AgentResumeResponse","description":"Resume-from-hibernation response."},"AgentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tags"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"soul_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Soul Override"},"identity_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Identity Override"},"user_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Override"},"skill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skill Id"},"timezone":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Timezone"},"agent_memory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Memory"},"subtitle":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Subtitle"},"subagent_max_iterations":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Subagent Max Iterations"}},"type":"object","title":"AgentUpdate","description":"Request body for ``PATCH /api/v1/agents/{id}``."},"ApiKeyCreate":{"properties":{"label":{"type":"string","maxLength":120,"minLength":1,"title":"Label"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","required":["label"],"title":"ApiKeyCreate","description":"Request body for ``POST /api/v1/keys``."},"ApiKeyCreated":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"key":{"type":"string","title":"Key"},"key_prefix":{"type":"string","title":"Key Prefix"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","required":["id","label","key","key_prefix","created_at"],"title":"ApiKeyCreated","description":"Response for ``POST /api/v1/keys`` — the full key, shown once."},"ApiKeyListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ApiKeyOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"ApiKeyListResponse","description":"Cursor-paginated list of API keys.\n\nUses the same ``{data, next_cursor}`` shape as the rest of the\npublic API so clients can reuse one pagination helper."},"ApiKeyOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"key_prefix":{"type":"string","title":"Key Prefix"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"}},"type":"object","required":["id","label","key_prefix","status","created_at"],"title":"ApiKeyOut","description":"A masked API key as returned by ``GET /api/v1/keys``.\n\nNever contains the full key — only the ``key_prefix`` used for\ndisplay (``jk_live_aBcD…``)."},"AutonomyBody":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"job":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Job"},"goals":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Goals"},"rules":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Rules"},"cadence_minutes":{"anyOf":[{"type":"integer","maximum":10080.0,"minimum":15.0},{"type":"null"}],"title":"Cadence Minutes"},"days":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Days"},"start_hour":{"anyOf":[{"type":"integer","maximum":23.0,"minimum":0.0},{"type":"null"}],"title":"Start Hour"},"end_hour":{"anyOf":[{"type":"integer","maximum":24.0,"minimum":1.0},{"type":"null"}],"title":"End Hour"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"AutonomyBody"},"BillingBreakdown":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"group_by":{"type":"string","title":"Group By","default":"category"},"categories":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Categories"},"agents":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Agents"},"users":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Users"}},"type":"object","required":["organization_id","period_start","period_end"],"title":"BillingBreakdown","description":"Costs broken down by category, agent, or user."},"BillingHistoryItem":{"properties":{"date":{"type":"string","format":"date-time","title":"Date"},"compute_cost":{"type":"number","title":"Compute Cost","default":0.0},"ram_cost":{"type":"number","title":"Ram Cost","default":0.0},"storage_cost":{"type":"number","title":"Storage Cost","default":0.0},"llm_cost":{"type":"number","title":"Llm Cost","default":0.0},"data_transfer_cost":{"type":"number","title":"Data Transfer Cost","default":0.0},"total_cost":{"type":"number","title":"Total Cost","default":0.0}},"type":"object","required":["date"],"title":"BillingHistoryItem","description":"A single day's cost row in the billing history."},"BillingSummary":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"today_cost":{"type":"number","title":"Today Cost","default":0.0},"yesterday_cost":{"type":"number","title":"Yesterday Cost","default":0.0},"current_hourly_rate":{"type":"number","title":"Current Hourly Rate","default":0.0},"projected_daily":{"type":"number","title":"Projected Daily","default":0.0},"projected_monthly":{"type":"number","title":"Projected Monthly","default":0.0},"projected_yearly":{"type":"number","title":"Projected Yearly","default":0.0},"currency":{"type":"string","title":"Currency","default":"USD"},"compute_cost":{"type":"number","title":"Compute Cost","default":0.0},"ram_cost":{"type":"number","title":"Ram Cost","default":0.0},"storage_cost":{"type":"number","title":"Storage Cost","default":0.0},"llm_cost":{"type":"number","title":"Llm Cost","default":0.0},"data_transfer_cost":{"type":"number","title":"Data Transfer Cost","default":0.0},"total_cost":{"type":"number","title":"Total Cost","default":0.0},"total_input_tokens":{"type":"integer","title":"Total Input Tokens","default":0},"total_output_tokens":{"type":"integer","title":"Total Output Tokens","default":0},"total_cache_read_tokens":{"type":"integer","title":"Total Cache Read Tokens","default":0},"total_cache_write_tokens":{"type":"integer","title":"Total Cache Write Tokens","default":0},"input_token_cost":{"type":"number","title":"Input Token Cost","default":0.0},"output_token_cost":{"type":"number","title":"Output Token Cost","default":0.0},"cache_read_token_cost":{"type":"number","title":"Cache Read Token Cost","default":0.0},"cache_write_token_cost":{"type":"number","title":"Cache Write Token Cost","default":0.0}},"type":"object","required":["organization_id","period_start","period_end"],"title":"BillingSummary","description":"Org-level cost summary for a period."},"BoardCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"orchestrator_skill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orchestrator Skill Id"},"accent":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Accent"},"icon":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Icon"},"agent_ids":{"items":{"type":"string"},"type":"array","title":"Agent Ids","default":[]},"execution_mode":{"type":"string","title":"Execution Mode","default":"queue"}},"type":"object","required":["name"],"title":"BoardCreate","description":"Request body for ``POST /api/v1/boards``."},"BoardDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"accent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"status":{"type":"string","title":"Status","default":"active"},"execution_mode":{"type":"string","title":"Execution Mode","default":"queue"},"orchestrator_skill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orchestrator Skill Id"},"is_virtual":{"type":"boolean","title":"Is Virtual","default":false},"team":{"items":{"$ref":"#/components/schemas/AgentRef"},"type":"array","title":"Team","default":[]},"card_count":{"type":"integer","title":"Card Count","default":0},"done_count":{"type":"integer","title":"Done Count","default":0},"waiting_count":{"type":"integer","title":"Waiting Count","default":0},"progress":{"type":"number","title":"Progress","default":0.0},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"columns":{"items":{"$ref":"#/components/schemas/ColumnOut"},"type":"array","title":"Columns","default":[]},"orchestrator_stages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Orchestrator Stages"},"archived_count":{"type":"integer","title":"Archived Count","default":0}},"type":"object","required":["id","name"],"title":"BoardDetail","description":"A board detail with columns and cards.\n\nReturned by ``GET /api/v1/boards/{id}``. Extends :class:`BoardOut`\nwith the column/card breakdown, orchestrator stage names, and the\narchived-run count."},"BoardOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"accent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accent"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"status":{"type":"string","title":"Status","default":"active"},"execution_mode":{"type":"string","title":"Execution Mode","default":"queue"},"orchestrator_skill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orchestrator Skill Id"},"is_virtual":{"type":"boolean","title":"Is Virtual","default":false},"team":{"items":{"$ref":"#/components/schemas/AgentRef"},"type":"array","title":"Team","default":[]},"card_count":{"type":"integer","title":"Card Count","default":0},"done_count":{"type":"integer","title":"Done Count","default":0},"waiting_count":{"type":"integer","title":"Waiting Count","default":0},"progress":{"type":"number","title":"Progress","default":0.0},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name"],"title":"BoardOut","description":"A board summary as returned by ``GET /api/v1/boards``."},"BoardUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"accent":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Accent"},"icon":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Icon"},"execution_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Mode"},"orchestrator_skill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orchestrator Skill Id"}},"type":"object","title":"BoardUpdate","description":"Request body for ``PATCH /api/v1/boards/{id}``."},"Body_upload_agent_avatar_uploads_agents__agent_id__avatar_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Avatar image (png/jpeg/gif/webp, ≤10 MB)"}},"type":"object","required":["file"],"title":"Body_upload_agent_avatar_uploads_agents__agent_id__avatar_post"},"Body_upload_chat_session_file_uploads_chat_sessions__session_id__files_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"File attachment (≤50 MB)"}},"type":"object","required":["file"],"title":"Body_upload_chat_session_file_uploads_chat_sessions__session_id__files_post"},"CardCreate":{"properties":{"title":{"type":"string","maxLength":1000,"minLength":1,"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"owner":{"type":"string","title":"Owner","default":"agent"},"assignee_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Agent Id"},"priority":{"type":"integer","title":"Priority","default":0},"stages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stages"},"execution_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Mode"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"clone_idle_stop_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clone Idle Stop Minutes"},"clone_stop_on_done":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Clone Stop On Done"}},"type":"object","required":["title"],"title":"CardCreate","description":"Request body for ``POST /api/v1/boards/{id}/cards``."},"CardOut":{"properties":{"id":{"type":"string","title":"Id"},"board_id":{"type":"string","title":"Board Id"},"org_task_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Org Task Number"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"column_key":{"type":"string","title":"Column Key","default":"backlog"},"state":{"type":"string","title":"State","default":"backlog"},"owner":{"type":"string","title":"Owner","default":"agent"},"skipped_count":{"type":"integer","title":"Skipped Count","default":0},"priority":{"type":"integer","title":"Priority","default":0},"stages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stages"},"assignee":{"anyOf":[{"$ref":"#/components/schemas/AgentRef"},{"type":"null"}]},"execution_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Mode"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"clone_idle_stop_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clone Idle Stop Minutes"},"clone_stop_on_done":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Clone Stop On Done"},"pipeline_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline Run Id"},"chat_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Session Id"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"comment_count":{"type":"integer","title":"Comment Count","default":0},"attachment_count":{"type":"integer","title":"Attachment Count","default":0},"ready_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ready At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"is_projected":{"type":"boolean","title":"Is Projected","default":false}},"type":"object","required":["id","board_id","title"],"title":"CardOut","description":"A board card."},"CardUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":1000,"minLength":1},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"stages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stages"},"execution_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Mode"},"clone_idle_stop_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Clone Idle Stop Minutes"},"clone_stop_on_done":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Clone Stop On Done"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"column_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Column Key"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"assignee_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Agent Id"}},"additionalProperties":false,"type":"object","title":"CardUpdate","description":"Request body for ``PATCH /api/v1/boards/{bid}/cards/{cid}``.\n\n``extra=\"forbid\"`` rejects unknown fields with a 422 instead of\nsilently accepting them (QA BUG-050). ``org_task_number`` is\nserver-assigned and therefore rejected here by the same rule."},"ChatMessageCreate":{"properties":{"role":{"type":"string","title":"Role","default":"user"},"content":{"type":"string","minLength":1,"title":"Content"},"file_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"File Ids"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"}},"type":"object","required":["content"],"title":"ChatMessageCreate","description":"Request body for ``POST /api/v1/chat/sessions/{id}/messages``.\n\nREST-only: the message is enqueued for the next agent turn and the\nresponse returns the persisted user message (no streaming)."},"ChatMessageOut":{"properties":{"id":{"type":"string","title":"Id"},"session_id":{"type":"string","title":"Session Id"},"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_input":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Input"},"tool_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Result"},"tokens":{"type":"integer","title":"Tokens","default":0},"seq":{"type":"integer","title":"Seq","default":0},"kind":{"type":"string","title":"Kind","default":"chat"},"metadata":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata"},"sender_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender User Id"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","session_id","role","created_at"],"title":"ChatMessageOut","description":"A chat message as returned by ``GET /api/v1/chat/sessions/{id}/messages``."},"ChatSessionCreate":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","default":"New topic"}},"type":"object","required":["agent_id"],"title":"ChatSessionCreate","description":"Request body for ``POST /api/v1/chat/sessions``."},"ChatSessionOut":{"properties":{"id":{"type":"string","title":"Id"},"agent_id":{"type":"string","title":"Agent Id"},"user_id":{"type":"string","title":"User Id"},"title":{"type":"string","title":"Title"},"token_used":{"type":"integer","title":"Token Used","default":0},"token_max":{"type":"integer","title":"Token Max","default":0},"tool_call_count":{"type":"integer","title":"Tool Call Count","default":0},"is_favorite":{"type":"boolean","title":"Is Favorite","default":false},"active_orchestrator_skill_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Orchestrator Skill Id"},"preferred_model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Model Id"},"runtime_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime Id"},"runtime_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime Model"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","agent_id","user_id","title","created_at","updated_at"],"title":"ChatSessionOut","description":"A chat session as returned by ``GET/POST /api/v1/chat/sessions``."},"ChatSessionUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Title"},"is_favorite":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Favorite"}},"type":"object","title":"ChatSessionUpdate","description":"Request body for ``PATCH /api/v1/chat/sessions/{id}``.\n\nMirrors the updatable surface of the internal chat router's\n``PATCH /sessions/{id}`` (title) and ``PATCH /sessions/{id}/favorite``\nendpoints. All fields optional — omitted fields are left untouched\n(handler uses ``exclude_unset``)."},"CloneAgentRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":2,"title":"Name"},"subtitle":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Subtitle"}},"type":"object","required":["name"],"title":"CloneAgentRequest","description":"Request body for ``POST /api/v1/agents/{id}/clone``."},"ColumnOut":{"properties":{"key":{"type":"string","title":"Key"},"title":{"type":"string","title":"Title"},"cards":{"items":{"$ref":"#/components/schemas/CardOut"},"type":"array","title":"Cards","default":[]}},"type":"object","required":["key","title"],"title":"ColumnOut","description":"A kanban column with its cards."},"CreditBalance":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"balance":{"type":"number","title":"Balance"},"currency":{"type":"string","title":"Currency","default":"USD"},"status":{"type":"string","title":"Status"},"free_signup_credit":{"type":"number","title":"Free Signup Credit","default":0.0},"grace_amount":{"type":"number","title":"Grace Amount","default":0.0},"grace_period_days":{"type":"integer","title":"Grace Period Days","default":0},"lifetime_credits_added":{"type":"number","title":"Lifetime Credits Added","default":0.0},"lifetime_credits_used":{"type":"number","title":"Lifetime Credits Used","default":0.0},"allowance_used":{"type":"number","title":"Allowance Used","default":0.0},"allowance_remaining":{"type":"number","title":"Allowance Remaining","default":0.0},"overage_amount":{"type":"number","title":"Overage Amount","default":0.0},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"managed_by":{"anyOf":[{"$ref":"#/components/schemas/ManagedBy"},{"type":"null"}]}},"type":"object","required":["organization_id","balance","status"],"title":"CreditBalance","description":"Org credit balance as returned by ``GET /api/v1/credits/balance``."},"CreditTransaction":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"amount":{"type":"number","title":"Amount"},"balance_after":{"type":"number","title":"Balance After"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"type":"string","title":"Category"},"period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End"},"stripe_payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Payment Intent Id"},"stripe_checkout_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Checkout Session Id"},"admin_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","type","amount","balance_after","category","created_at"],"title":"CreditTransaction","description":"A single credit transaction."},"CreditsBody":{"properties":{"amount":{"title":"Amount"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"},"org_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Org Id"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"}},"additionalProperties":false,"type":"object","title":"CreditsBody","description":"Positive ``amount`` assigns credits from your pool; negative takes them back.\nAddress the customer by ``org_id`` or by ``email``."},"CustomerOrgCreate":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name"},"admin_email":{"type":"string","format":"email","title":"Admin Email"},"allocation":{"anyOf":[{"type":"number","maximum":1000000.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d{0,2}0*$"}],"title":"Allocation","default":"0"},"cap":{"anyOf":[{"type":"number","maximum":999999999999.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d{0,2}0*$"},{"type":"null"}],"title":"Cap"},"send_invite":{"type":"boolean","title":"Send Invite","default":true},"max_agents":{"type":"integer","maximum":1000.0,"minimum":0.0,"title":"Max Agents","default":0},"size_preset_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Size Preset Id"}},"additionalProperties":false,"type":"object","required":["name","admin_email"],"title":"CustomerOrgCreate","description":"``POST /partner/orgs`` (dashboard assumption 34). ``cap: null`` = the\npartner default; ``0`` = no cap. Money in whole cents."},"CustomerOrgLimits":{"properties":{"max_agents":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Max Agents"},"size_preset_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Size Preset Id"}},"additionalProperties":false,"type":"object","title":"CustomerOrgLimits","description":"``PATCH /partner/orgs/{id}/limits``: ``max_agents`` 0 = no limit;\n``size_preset_id: null`` = the partner's default size."},"CustomerOrgUpdate":{"properties":{"cap":{"anyOf":[{"type":"number","maximum":999999999999.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d{0,2}0*$"},{"type":"null"}],"title":"Cap"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"additionalProperties":false,"type":"object","title":"CustomerOrgUpdate","description":"``PATCH /partner/orgs/{id}`` (dashboard assumption 37). ``cap: null``\nclears the override (the partner default applies); ``0`` = no cap.\nOnly the fields sent are changed (``model_fields_set``)."},"DecisionAnswer":{"properties":{"option_id":{"type":"string","maxLength":200,"minLength":1,"title":"Option Id"},"text":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Text"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"}},"type":"object","required":["option_id"],"title":"DecisionAnswer"},"DependencyCreate":{"properties":{"depends_on_task_id":{"type":"string","maxLength":36,"minLength":1,"title":"Depends On Task Id"}},"type":"object","required":["depends_on_task_id"],"title":"DependencyCreate","description":"Request body for ``POST /api/v1/tasks/{id}/dependencies``.\n\nIdentifies the task that ``{id}`` should wait on (the new\nprerequisite). The dependent task is the ``{id}`` path param."},"DependencyOut":{"properties":{"from_task_id":{"type":"string","title":"From Task Id"},"to_task_id":{"type":"string","title":"To Task Id"}},"type":"object","required":["from_task_id","to_task_id"],"title":"DependencyOut","description":"A single task dependency edge.\n\nMirrors the internal ``TaskEdge`` (from -> to) but with explicit\nfield names so the public shape is unambiguous. ``from_task_id`` is\nthe prerequisite task; ``to_task_id`` is the dependent task."},"ExecBody":{"properties":{"command":{"type":"string","maxLength":20000,"minLength":1,"title":"Command"},"cwd":{"type":"string","maxLength":1024,"title":"Cwd","default":"/root"},"timeout":{"type":"integer","maximum":300.0,"minimum":1.0,"title":"Timeout","default":120}},"type":"object","required":["command"],"title":"ExecBody"},"FileUploadResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"size":{"type":"integer","title":"Size"},"mime_type":{"type":"string","title":"Mime Type"},"url":{"type":"string","title":"Url"},"uploaded_at":{"type":"string","title":"Uploaded At"}},"type":"object","required":["id","name","size","mime_type","url","uploaded_at"],"title":"FileUploadResponse","description":"Response for ``POST /api/v1/chat/sessions/{id}/files``.\n\nMirrors the internal chat-files upload contract: the stored file id,\noriginal name, size, MIME type, and a relative download URL."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ManagedBy":{"properties":{"name":{"type":"string","title":"Name"},"support_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Support Email"}},"type":"object","required":["name"],"title":"ManagedBy","description":"The partner that funds a wholesale org's credits."},"MemberAdd":{"properties":{"agent_id":{"type":"string","minLength":1,"title":"Agent Id"}},"type":"object","required":["agent_id"],"title":"MemberAdd","description":"Request body for ``POST /api/v1/boards/{id}/members``."},"OrgMemberAdd":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","pattern":"^(owner|admin|member|viewer)$","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"OrgMemberAdd","description":"Request body for ``POST /api/v1/orgs/{id}/members``.\n\nThe caller identifies the new member by email (the public API never\nexposes internal user ids); the role is one of\n``owner|admin|member|viewer``. ``owner`` is rejected by the endpoint\n(ownership changes go through transfer-ownership)."},"OrgMemberOut":{"properties":{"id":{"type":"string","title":"Id"},"organization_id":{"type":"string","title":"Organization Id"},"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role"},"user_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Email"},"user_full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Full Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","user_id","role","created_at","updated_at"],"title":"OrgMemberOut","description":"An organization member."},"OrgMemberUpdate":{"properties":{"role":{"type":"string","pattern":"^(admin|member|viewer)$","title":"Role"}},"type":"object","required":["role"],"title":"OrgMemberUpdate","description":"Request body for ``PATCH /api/v1/orgs/{id}/members/{user_id}``."},"OrgOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","slug","created_at","updated_at"],"title":"OrgOut","description":"An organization as returned by ``GET /api/v1/orgs``."},"PaginatedResponse_AgentOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AgentOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[AgentOut]"},"PaginatedResponse_BillingHistoryItem_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BillingHistoryItem"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[BillingHistoryItem]"},"PaginatedResponse_BoardOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/BoardOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[BoardOut]"},"PaginatedResponse_ChatMessageOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ChatMessageOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[ChatMessageOut]"},"PaginatedResponse_ChatSessionOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ChatSessionOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[ChatSessionOut]"},"PaginatedResponse_CreditTransaction_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CreditTransaction"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[CreditTransaction]"},"PaginatedResponse_OrgOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrgOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[OrgOut]"},"PaginatedResponse_SkillOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SkillOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[SkillOut]"},"PaginatedResponse_TaskOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TaskOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[TaskOut]"},"PaginatedResponse_TemplateOut_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/TemplateOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","title":"PaginatedResponse[TemplateOut]"},"PreviewBody":{"properties":{"port":{"type":"integer","maximum":65535.0,"minimum":1.0,"title":"Port"}},"type":"object","required":["port"],"title":"PreviewBody"},"ScheduleBody":{"properties":{"name":{"type":"string","maxLength":200,"title":"Name","default":"Schedule"},"cron":{"type":"string","maxLength":120,"title":"Cron"},"message":{"type":"string","maxLength":20000,"minLength":1,"title":"Message"},"timezone":{"type":"string","maxLength":64,"title":"Timezone","default":"UTC"},"busy_behavior":{"type":"string","title":"Busy Behavior","default":"skip"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["cron","message"],"title":"ScheduleBody"},"SchedulePatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"},"cron":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Cron"},"message":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Message"},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Timezone"},"busy_behavior":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Busy Behavior"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"SchedulePatch"},"SkillOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"model_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Id"},"model_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Display Name"},"is_active":{"type":"boolean","title":"Is Active","default":true},"version":{"type":"integer","title":"Version","default":1},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","updated_at"],"title":"SkillOut","description":"A skill as returned by ``GET /api/v1/skills``."},"TaskActionResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"action":{"type":"string","title":"Action"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["task_id","action","status","message","timestamp"],"title":"TaskActionResponse","description":"Lifecycle action acknowledgment (pause/resume/cancel/retry)."},"TaskCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"task_type":{"type":"string","pattern":"^(setup|deploy|test|custom)$","title":"Task Type","default":"custom"},"agent_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Agent Id"},"parent_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Parent Id"},"command":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Command"},"working_directory":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Working Directory"},"environment_vars":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment Vars"},"dependencies":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Dependencies"},"priority":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Priority","default":0},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"max_retries":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Max Retries","default":3}},"type":"object","required":["name"],"title":"TaskCreate","description":"Request body for ``POST /api/v1/tasks``."},"TaskOut":{"properties":{"id":{"type":"string","title":"Id"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"task_type":{"type":"string","title":"Task Type"},"status":{"type":"string","title":"Status"},"priority":{"type":"integer","title":"Priority","default":5},"command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Command"},"working_directory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Working Directory"},"environment_vars":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment Vars"},"dependencies":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Dependencies"},"progress_percent":{"type":"integer","title":"Progress Percent","default":0},"progress_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Message"},"result_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Data"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"max_retries":{"type":"integer","title":"Max Retries","default":3},"retry_count":{"type":"integer","title":"Retry Count","default":0},"retry_delay_seconds":{"type":"integer","title":"Retry Delay Seconds","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","task_type","status","created_at","updated_at"],"title":"TaskOut","description":"A task as returned by ``GET/POST/PATCH /api/v1/tasks``."},"TaskUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"priority":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Priority"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"}},"type":"object","title":"TaskUpdate","description":"Request body for ``PATCH /api/v1/tasks/{id}``."},"TemplateOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"visibility":{"type":"string","title":"Visibility"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"created_by":{"type":"string","title":"Created By"},"snapshot_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Snapshot Id"},"proxmox_template_vmid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Proxmox Template Vmid"},"os_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Type"},"default_cores":{"type":"integer","title":"Default Cores","default":2},"default_memory":{"type":"integer","title":"Default Memory","default":2048},"default_disk_size":{"type":"integer","title":"Default Disk Size","default":10},"installed_packages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Installed Packages"},"pre_configured_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Pre Configured Tools"},"version":{"type":"string","title":"Version","default":"1.0.0"},"is_active":{"type":"boolean","title":"Is Active","default":true},"usage_count":{"type":"integer","title":"Usage Count","default":0},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","visibility","created_by","created_at","updated_at"],"title":"TemplateOut","description":"An environment template as returned by ``GET /api/v1/templates``."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WriteBody":{"properties":{"path":{"type":"string","maxLength":4096,"minLength":1,"title":"Path"},"content":{"anyOf":[{"type":"string","maxLength":10485760},{"type":"null"}],"title":"Content"},"content_base64":{"anyOf":[{"type":"string","maxLength":14680064},{"type":"null"}],"title":"Content Base64"}},"type":"object","required":["path"],"title":"WriteBody"}}}}