{"openapi":"3.1.0","info":{"title":"AI Todo","version":"0.1.298"},"paths":{"/v1/healthz":{"get":{"tags":["system"],"summary":"Healthz","description":"Liveness, always 200 (#424, owner decision: a busy database must not restart the\ncontainer); `status` is `degraded` when the database cannot be read or its write lock is\nheld, and `db` says which (`server_db.probe`: never waits, no token or secret).","operationId":"healthz_v1_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz V1 Healthz Get"}}}}}}},"/v1/meta":{"get":{"tags":["system"],"summary":"Get Meta","description":"Published vocabularies: hint types, action types, enums, context guard and package version;\nwho may register a project here (`registration`: open, invite or closed, #145); and the\nversion of the feedback template (`feedback_template_version`, #149); error codes, environment\nvariables and the `tkt` commands (#236).","operationId":"get_meta_v1_meta_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Meta V1 Meta Get"}}}}}}},"/v1/projects":{"post":{"tags":["projects"],"summary":"Register Project","description":"Register a project; the response carries its first admin token, once. Who may register\nfollows `AITODO_REGISTRATION` (#145, `registration` on `/v1/meta`): `open`, `invite` (the\nbody's `invite` code, minted by the operator, used once) or `closed` (403).","operationId":"register_project_v1_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterProject"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Register Project V1 Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}":{"get":{"tags":["projects"],"summary":"Get Project","description":"The project's settings (read), with its server AI budget (#334: the plan, `granted`, the\nshare used; never tokens).","operationId":"get_project_v1_projects__project_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Project V1 Projects  Project Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["projects"],"summary":"Update Project","description":"Switch the server LLM on or off (admin, #131; on needs an LLM or an embedding endpoint on\nthe server (#323), else 503), and its answer cache (#178; off deletes the project's cached\nanswers).","operationId":"update_project_v1_projects__project_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProject"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Project V1 Projects  Project Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Delete Project","description":"Delete the project and everything the server keeps for it, in one transaction (admin,\n#143): its tokens, LLM usage, caps and cached answers, id counters and claim leases. Tickets live in git\nand are never touched; the id is never handed out again.","operationId":"delete_project_v1_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Project V1 Projects  Project Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/whoami":{"get":{"tags":["projects"],"summary":"Whoami","description":"The calling token: name, role, llm grant, expiry (any valid token).","operationId":"whoami_v1_projects__project_id__whoami_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Whoami V1 Projects  Project Id  Whoami Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/tokens":{"post":{"tags":["projects"],"summary":"Create Token","description":"Create a named token (admin); the response carries the token, once.","operationId":"create_token_v1_projects__project_id__tokens_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateToken"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Token V1 Projects  Project Id  Tokens Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["projects"],"summary":"List Tokens","description":"The project's tokens, revoked ones included — never a token value (admin).","operationId":"list_tokens_v1_projects__project_id__tokens_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tokens V1 Projects  Project Id  Tokens Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/tokens/{name}":{"patch":{"tags":["projects"],"summary":"Update Token","description":"Change a token's role, llm grant or expiry (admin).","operationId":"update_token_v1_projects__project_id__tokens__name__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateToken"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Token V1 Projects  Project Id  Tokens  Name  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Revoke Token","description":"Revoke a token; its name stays reserved (admin).","operationId":"revoke_token_v1_projects__project_id__tokens__name__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Token V1 Projects  Project Id  Tokens  Name  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/store":{"post":{"tags":["store"],"summary":"Create Store","description":"Create the project's store on the server (admin): an empty `tkt` store in its own git\nrepository; the location becomes `server`. A project whose store is in its repo moves it\nwith `tkt store move --to server` (#153) instead; a second create is 409 `ERR_STORE_LOCATION`.\nIt counts against the registration rate of the caller's address (#262, 429).","operationId":"create_store_v1_projects__project_id__store_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Store V1 Projects  Project Id  Store Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["store"],"summary":"Get Store","description":"Where the store lives (`repo`, `server`, `moving`), its version (the HEAD of a server\nstore) and when it last moved. `?disk=true` adds `disk` (#261): the project's quota and what\ncounts toward it, part by part, as `tkt doctor` on a server store shows it.","operationId":"get_store_v1_projects__project_id__store_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"disk","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Disk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Store V1 Projects  Project Id  Store Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/cli":{"post":{"tags":["store"],"summary":"Run Cli","description":"Run `tkt <argv>` on the project's server store: `{exit_code, stdout, stderr, files,\nstore_version}`, plus `stage1` for `ticket get`, `next` and `report context` (the client\nruns Stage 2 on its own worktree). The body is read after the token check (#277).","operationId":"run_cli_v1_projects__project_id__cli_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Run Cli V1 Projects  Project Id  Cli Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"description":"`{argv, stdin?, files?, columns?}` — `files` maps a relative name to base64 content;\n`columns` is the caller's terminal width (default 100), so wrapped output matches it. The\nbyte sizes are checked by the server (`api/store_cli.py`), from the encoded lengths, before\nanything is decoded; the whole body is bounded before it is parsed (`api/body_limit.py`).","properties":{"argv":{"items":{"type":"string"},"maxItems":256,"title":"Argv","type":"array"},"stdin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stdin"},"files":{"additionalProperties":{"type":"string"},"maxProperties":256,"title":"Files","type":"object"},"columns":{"anyOf":[{"maximum":1000,"minimum":20,"type":"integer"},{"type":"null"}],"title":"Columns"}},"required":["argv"],"title":"CliCall","type":"object"}}}}}},"/v1/projects/{project_id}/store:import":{"post":{"tags":["store"],"summary":"Import Store","description":"Move the store here from the repo (admin): `{tar, bundle?, forceClaims?}`; checked with\n`tkt doctor` while `moving`, then `server`. Any failure leaves `repo` and no server copy.\nIt counts against the registration rate of the caller's address (#262, 429). The body is\nread after the token check (#277).","operationId":"import_store_v1_projects__project_id__store_import_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Import Store V1 Projects  Project Id  Store Import Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"description":"`store:import` (#153): `tar` (base64) holds the store's committed files; `bundle` (base64)\nits history when the store is its own git root; `forceClaims` drops live claim leases.","properties":{"tar":{"title":"Tar","type":"string"},"bundle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundle"},"forceClaims":{"default":false,"title":"Forceclaims","type":"boolean"}},"required":["tar"],"title":"StoreImport","type":"object"}}}}}},"/v1/projects/{project_id}/store:export":{"post":{"tags":["store"],"summary":"Export Store","description":"Freeze the store for its way back to the repo (admin): `moving`, and its files as a tar.\nOpen decompositions refuse it (409 `ERR_CONFIRM_REQUIRED`) unless `forceDecompositions`.","operationId":"export_store_v1_projects__project_id__store_export_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StoreMoveOptions"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Export Store V1 Projects  Project Id  Store Export Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/store:release":{"post":{"tags":["store"],"summary":"Release Store","description":"The client has the store (admin): `repo`; the server copy goes to `stores/.archive/`.\nOpen decompositions refuse it as in `store:export`, unless `forceDecompositions`.","operationId":"release_store_v1_projects__project_id__store_release_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StoreMoveOptions"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Release Store V1 Projects  Project Id  Store Release Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/llm:complete":{"post":{"tags":["llm"],"summary":"Complete","description":"Forward `{prompt, schema}` to the server's LLM; the answer object (an `llm` grant).\nWith `cacheable: true`, `{answer, cache, generatedAt}` from the project's cache or a call.","operationId":"complete_v1_projects__project_id__llm_complete_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Complete V1 Projects  Project Id  Llm Complete Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/llm/cache:lookup":{"post":{"tags":["llm"],"summary":"Cache Lookup","description":"The stored answers of the client's item keys (#179; an `llm` grant): `{cache: on|off,\nentries: {key: {answer, generatedAt}}}`. Each hit is counted, toward no cap.","operationId":"cache_lookup_v1_projects__project_id__llm_cache_lookup_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmCacheLookup"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cache Lookup V1 Projects  Project Id  Llm Cache Lookup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/llm/limits":{"get":{"tags":["llm"],"summary":"Get Limits","description":"The project's and its tokens' caps, in input + output tokens, and the cache switch (admin).\nA postponed feature: 501 while `ADMIN_CAPS` is off (#334).","operationId":"get_limits_v1_projects__project_id__llm_limits_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Limits V1 Projects  Project Id  Llm Limits Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["llm"],"summary":"Set Limits","description":"Set the project's caps, or a token's with `token`; only the fields sent change, `null`\nclears one (admin). A postponed feature: 501 while `ADMIN_CAPS` is off (#334).","operationId":"set_limits_v1_projects__project_id__llm_limits_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLlmLimits"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Limits V1 Projects  Project Id  Llm Limits Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/llm/status":{"get":{"tags":["llm"],"summary":"Status","description":"Whether the caller's LLM calls can run, without one (#324, any token): the project's switch,\nthe token's `llm` grant, whether the server has an LLM, its provider and place, why a call\nwould be refused now (`quota`: its message, else null) and the plan's budget (#334: the plan,\n`granted`, the share used per month and day, the resets; never tokens).","operationId":"status_v1_projects__project_id__llm_status_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Status V1 Projects  Project Id  Llm Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/llm/usage":{"get":{"tags":["llm"],"summary":"Usage","description":"The plan's budget as a share used (#334: never tokens), the calls made today and this month\n(UTC), the cache switch and its hits, and with `byToken` each token's calls (admin).","operationId":"usage_v1_projects__project_id__llm_usage_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"byToken","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Bytoken"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage V1 Projects  Project Id  Llm Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/embed":{"get":{"tags":["llm"],"summary":"Embed Info","description":"The server's embedding endpoint for this project: `{id, model, place}` (an `llm` grant).","operationId":"embed_info_v1_projects__project_id__embed_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Embed Info V1 Projects  Project Id  Embed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["llm"],"summary":"Embed","description":"One vector per text, in order: `{id, place, vectors}` (an `llm` grant). Nothing is kept.","operationId":"embed_v1_projects__project_id__embed_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Embed V1 Projects  Project Id  Embed Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/ids":{"post":{"tags":["coordination"],"summary":"Take Id","description":"Reserve the next number of a counter (write): above the counter and above `floor`.","operationId":"take_id_v1_projects__project_id__ids_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TakeId"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Take Id V1 Projects  Project Id  Ids Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["coordination"],"summary":"Current Id","description":"The last number a counter handed out, taking nothing (read); 0 when none.","operationId":"current_id_v1_projects__project_id__ids_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kind","in":"query","required":true,"schema":{"enum":["ticket","decision"],"type":"string","title":"Kind"}},{"name":"prefix","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Z][A-Z0-9]{0,9}$","title":"Prefix"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Current Id V1 Projects  Project Id  Ids Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/claims":{"get":{"tags":["coordination"],"summary":"List Claims","description":"The live leases, oldest first (read); `mine` marks the caller's token's.","operationId":"list_claims_v1_projects__project_id__claims_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Claims V1 Projects  Project Id  Claims Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/claims/{ulid}":{"post":{"tags":["coordination"],"summary":"Claim","description":"Create a lease (201), or renew or take over one (200); 409 ERR_ALREADY_CLAIMED.","operationId":"claim_v1_projects__project_id__claims__ulid__post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"ulid","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","title":"Ulid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimLease"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Claim V1 Projects  Project Id  Claims  Ulid  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["coordination"],"summary":"Renew","description":"Renew the caller's own lease (write); 404 when it is gone, 409 for another owner.","operationId":"renew_v1_projects__project_id__claims__ulid__put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"ulid","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","title":"Ulid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimLease"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Renew V1 Projects  Project Id  Claims  Ulid  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["coordination"],"summary":"Release","description":"Release a lease: its token, from any worktree, or an admin (write); 404 when none.","operationId":"release_v1_projects__project_id__claims__ulid__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"ulid","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9A-HJKMNP-TV-Z]{26}$","title":"Ulid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Release V1 Projects  Project Id  Claims  Ulid  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/projects":{"get":{"tags":["operator"],"summary":"List Projects","description":"Every project: id, name, created, created by, how (an invite id, `open` (#145) or\n`operator` (#158)), token counts, last use, its AI plan and use (#334: `plan {name, default}`,\n`ai {enabled, calls, monthCredits}`, calls ever), what it takes on the disk (#261: `diskBytes`,\nits store with the history, archives, an import being built) — never a token. `disk`: the\ndata disk's free space, its `state` (`ok`; `low` under `AITODO_DISK_WARN_FREE_BYTES`; `full`\nunder `AITODO_DISK_MIN_FREE_BYTES`, writes paused), both levels, all the stores together.","operationId":"list_projects_v1_operator_projects_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Projects V1 Operator Projects Get"}}}}}},"post":{"tags":["operator"],"summary":"Create Project","description":"A project registered by the operator, whatever `AITODO_REGISTRATION` says (#158): the\nname rules of `POST /v1/projects`, its first admin token (`as`) in the reply, once; listed\nas created via `operator`. No invite is needed or used.","operationId":"create_project_v1_operator_projects_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewProject"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Project V1 Operator Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/projects/{project_id}":{"delete":{"tags":["operator"],"summary":"Delete Project","description":"What `tkt server project-delete` does: the project and every server row of it, in one\ntransaction. Its tokens answer 401 afterwards; the tickets in git are untouched.","operationId":"delete_project_v1_operator_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Project V1 Operator Projects  Project Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/projects/{project_id}/admin-token":{"post":{"tags":["operator"],"summary":"Admin Token","description":"What `tkt server admin-token` does (recovery): a new admin token, shown once.","operationId":"admin_token_v1_operator_projects__project_id__admin_token_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorAdminToken"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Admin Token V1 Operator Projects  Project Id  Admin Token Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/invites":{"get":{"tags":["operator"],"summary":"List Invites","description":"Every invite with its status (open, used, expired, revoked) — never a code.","operationId":"list_invites_v1_operator_invites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Invites V1 Operator Invites Get"}}}}}},"post":{"tags":["operator"],"summary":"Mint Invite","description":"A one-time registration code (`arc_…`), shown once; the server keeps only its hash.","operationId":"mint_invite_v1_operator_invites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvite"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mint Invite V1 Operator Invites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/invites/{invite_id}":{"delete":{"tags":["operator"],"summary":"Revoke Invite","description":"Revoke an unused invite; the row stays (`revoked`). Unknown, used or revoked → 404.","operationId":"revoke_invite_v1_operator_invites__invite_id__delete","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Invite V1 Operator Invites  Invite Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/projects/{project_id}/store:unfreeze":{"post":{"tags":["operator"],"summary":"Unfreeze Store","description":"A move to the repo left half-done (`moving`): back to `server`, the store as it was.","operationId":"unfreeze_store_v1_operator_projects__project_id__store_unfreeze_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Unfreeze Store V1 Operator Projects  Project Id  Store Unfreeze Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/projects/{project_id}/store:release":{"post":{"tags":["operator"],"summary":"Release Store","description":"A move left half-done (`moving`): finish it to `repo`; the server copy is archived. Its\nexport already passed the open-decomposition check (#176), so this does not repeat it.","operationId":"release_store_v1_operator_projects__project_id__store_release_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Release Store V1 Operator Projects  Project Id  Store Release Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/prices":{"get":{"tags":["operator"],"summary":"List Prices","description":"Every model's price: credits per 1M input and per 1M output tokens.","operationId":"list_prices_v1_operator_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Prices V1 Operator Prices Get"}}}}}},"put":{"tags":["operator"],"summary":"Set Price","description":"Set a model's price (new or changed); calls book their credits by it from then on.","operationId":"set_price_v1_operator_prices_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPrice"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Set Price V1 Operator Prices Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/plans":{"get":{"tags":["operator"],"summary":"List Plans","description":"Every plan with its values, whether it is the default and how many projects are on it.","operationId":"list_plans_v1_operator_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Plans V1 Operator Plans Get"}}}}}},"post":{"tags":["operator"],"summary":"New Plan","description":"A new plan: a name, monthly credits and daily credits (`-1` unlimited, `0` none).","operationId":"new_plan_v1_operator_plans_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewPlan"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response New Plan V1 Operator Plans Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/plans/{name}":{"patch":{"tags":["operator"],"summary":"Update Plan","description":"Change a plan's values; its projects spend by them from their next call.","operationId":"update_plan_v1_operator_plans__name__patch","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePlan"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Plan V1 Operator Plans  Name  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["operator"],"summary":"Delete Plan","description":"Delete a plan that no project and not the default uses (409 `ERR_PLAN_IN_USE`).","operationId":"delete_plan_v1_operator_plans__name__delete","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Plan V1 Operator Plans  Name  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/default-plan":{"put":{"tags":["operator"],"summary":"Set Default Plan","description":"Make a plan the default: every project without a plan of its own spends by it.","operationId":"set_default_plan_v1_operator_default_plan_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DefaultPlan"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Set Default Plan V1 Operator Default Plan Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/operator/projects/{project_id}/plan":{"put":{"tags":["operator"],"summary":"Set Project Plan","description":"Put the project on a plan; `null` puts it back on the default plan.","operationId":"set_project_plan_v1_operator_projects__project_id__plan_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPlan"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Project Plan V1 Operator Projects  Project Id  Plan Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/feedback/template":{"get":{"tags":["feedback"],"summary":"Get Template","description":"The report template: kinds `bug` and `idea`, their sections (required, help), the\ntitle rule, the sections `tkt feedback` fills in itself, and the version.","operationId":"get_template_v1_feedback_template_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Template V1 Feedback Template Get"}}}}}}},"/v1/feedback/cli":{"post":{"tags":["feedback"],"summary":"Report Cli","description":"Run a reporter's call on the intake store. `ticket new --type bug|feature`: forced into\ngroup `intake`, status `backlog`, label `from:<your project>`, checked against the\ntemplate. `ticket get <id>` / `ticket list`: your own reports only (another project's\nid is a 404). `search --similar <text>`: every report, id/title/type/status/case count\nonly (a `tkt` from before #308 sends `ticket search`, read as these two). `ticket section append <id> Cases --text <note>`: the server writes\n`+1 <date>: <note>`. Secrets are redacted first. The body is read after the token check.","operationId":"report_cli_v1_feedback_cli_post","requestBody":{"content":{"application/json":{"schema":{"properties":{"argv":{"items":{"type":"string"},"type":"array","maxItems":256,"title":"Argv"},"stdin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stdin"},"files":{"additionalProperties":{"type":"string"},"type":"object","maxProperties":256,"title":"Files"},"columns":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":20.0},{"type":"null"}],"title":"Columns"}},"additionalProperties":false,"type":"object","required":["argv"],"title":"CliCall","description":"`{argv, stdin?, files?, columns?}` — `files` maps a relative name to base64 content;\n`columns` is the caller's terminal width (default 100), so wrapped output matches it. The\nbyte sizes are checked by the server (`api/store_cli.py`), from the encoded lengths, before\nanything is decoded; the whole body is bounded before it is parsed (`api/body_limit.py`)."}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Report Cli V1 Feedback Cli Post"}}}}}}}},"components":{"schemas":{"ClaimLease":{"properties":{"ticketId":{"type":"string","maxLength":64,"minLength":1,"title":"Ticketid"},"assignee":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Assignee"},"branch":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Branch"},"worktree":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Worktree"},"host":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Host"},"force":{"type":"boolean","title":"Force","default":false}},"additionalProperties":false,"type":"object","required":["ticketId"],"title":"ClaimLease","description":"`POST` / `PUT …/claims/{ulid}`. The owner is the caller's token name; `worktree` and\n`host` complete the owner triple. `force` (POST only) takes a live lease over."},"CreateInvite":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name","description":"Fix the project name the invite registers."},"expires":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires"}},"additionalProperties":false,"type":"object","title":"CreateInvite","description":"`POST /v1/operator/invites {name?, expires?}` (#145): a one-time registration code."},"CreateToken":{"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$","title":"Name"},"role":{"type":"string","enum":["read","write","admin"],"title":"Role"},"llm":{"type":"boolean","title":"Llm","default":false},"expires":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires"}},"additionalProperties":false,"type":"object","required":["name","role"],"title":"CreateToken"},"DefaultPlan":{"properties":{"plan":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$","title":"Plan"}},"additionalProperties":false,"type":"object","required":["plan"],"title":"DefaultPlan","description":"`PUT /v1/operator/default-plan {plan}`: the plan of every project without its own."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LlmCacheLookup":{"properties":{"keys":{"items":{"type":"string","pattern":"^[0-9a-f]{64}$"},"type":"array","maxItems":200,"title":"Keys"}},"additionalProperties":false,"type":"object","required":["keys"],"title":"LlmCacheLookup","description":"`POST …/llm/cache:lookup {keys}` (#179): the client's item keys to look up."},"NewPlan":{"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$","title":"Name"},"monthly":{"type":"integer","minimum":-1.0,"title":"Monthly"},"daily":{"type":"integer","minimum":-1.0,"title":"Daily"}},"additionalProperties":false,"type":"object","required":["name","monthly","daily"],"title":"NewPlan","description":"`POST /v1/operator/plans {name, monthly, daily}`: a basic plan is these three, nothing else."},"NewProject":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"as":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$","title":"As"}},"additionalProperties":false,"type":"object","required":["name","as"],"title":"NewProject","description":"`POST /v1/operator/projects {name, as}` (#158) — `as` names the first admin token. The\nname rules of every registration: `RegisterProject` adds only the invite."},"OperatorAdminToken":{"properties":{"name":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$","title":"Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"OperatorAdminToken","description":"`POST /v1/operator/projects/{id}/admin-token {name}` (#144): a recovery admin token."},"ProjectPlan":{"properties":{"plan":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$"},{"type":"null"}],"title":"Plan"}},"additionalProperties":false,"type":"object","required":["plan"],"title":"ProjectPlan","description":"`PUT /v1/operator/projects/{p}/plan {plan}`: a plan name, or null for the default plan."},"RegisterProject":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"as":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$","title":"As"},"invite":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Invite","description":"The operator's invite code (arc_…) when the server registers by invite (#145); ignored when open."}},"additionalProperties":false,"type":"object","required":["name","as"],"title":"RegisterProject","description":"`POST /v1/projects {name, as, invite?}`."},"SetLlmLimits":{"properties":{"token":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._@-]{0,63}$"},{"type":"null"}],"title":"Token"},"daily":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Daily"},"monthly":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Monthly"}},"additionalProperties":false,"type":"object","title":"SetLlmLimits","description":"`PUT …/llm/limits`: the project's caps, or `token`'s. Only the fields sent change;\n`null` clears a cap. A cap counts input + output tokens."},"SetPrice":{"properties":{"model":{"type":"string","maxLength":200,"minLength":1,"pattern":"^\\S+$","title":"Model"},"input":{"type":"integer","minimum":0.0,"title":"Input"},"output":{"type":"integer","minimum":0.0,"title":"Output"}},"additionalProperties":false,"type":"object","required":["model","input","output"],"title":"SetPrice","description":"`PUT /v1/operator/prices {model, input, output}`: credits per 1M input / output tokens."},"StoreMoveOptions":{"properties":{"forceDecompositions":{"type":"boolean","title":"Forcedecompositions","default":false}},"additionalProperties":false,"type":"object","title":"StoreMoveOptions","description":"`store:export` / `store:release` (#176), an optional body: `forceDecompositions` moves\nalthough decompositions are open on the server (they stay in its archive)."},"TakeId":{"properties":{"kind":{"type":"string","enum":["ticket","decision"],"title":"Kind"},"prefix":{"type":"string","pattern":"^[A-Z][A-Z0-9]{0,9}$","title":"Prefix"},"floor":{"type":"integer","minimum":0.0,"title":"Floor"}},"additionalProperties":false,"type":"object","required":["kind","prefix","floor"],"title":"TakeId","description":"`POST …/ids`: `floor` is the client's local maximum (counters and existing files)."},"UpdatePlan":{"properties":{"monthly":{"anyOf":[{"type":"integer","minimum":-1.0},{"type":"null"}],"title":"Monthly"},"daily":{"anyOf":[{"type":"integer","minimum":-1.0},{"type":"null"}],"title":"Daily"}},"additionalProperties":false,"type":"object","title":"UpdatePlan","description":"`PATCH /v1/operator/plans/{name} {monthly?, daily?}`: at least one."},"UpdateProject":{"properties":{"llmEnabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Llmenabled"},"llmCache":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Llmcache"}},"additionalProperties":false,"type":"object","title":"UpdateProject","description":"`PATCH /v1/projects/{p} {llmEnabled?, llmCache?}` — the admin's switches of the server\nLLM and of its answer cache (#178); at least one."},"UpdateToken":{"properties":{"role":{"anyOf":[{"type":"string","enum":["read","write","admin"]},{"type":"null"}],"title":"Role"},"llm":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Llm"},"expires":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires"}},"additionalProperties":false,"type":"object","title":"UpdateToken","description":"`PATCH …/tokens/{name}`: only the fields sent change; `\"expires\": null` clears it."},"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"}}}}