{"openapi":"3.1.0","info":{"title":"LeapMemory","version":"0.1.0"},"paths":{"/v1/health":{"get":{"summary":"Health","operationId":"health_v1_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health V1 Health Get"}}}}}}},"/signup":{"post":{"tags":["auth"],"summary":"Signup","description":"Create org + owner user + default project + admin API key + session.\n\nPersonal accounts also get one auto-provisioned tenant (\"me\") so their\nmemory has somewhere to live with no API call. Provisioning runs after the\ncontrol-plane transaction commits, because it makes external calls (TDB,\nArango, ES) that cannot sit inside a Postgres transaction.\n\n`api_key` in the response is the ONLY chance to capture it.","operationId":"signup_signup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Signup Signup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/login":{"post":{"tags":["auth"],"summary":"Login","description":"Verify credentials → return session token + user + org + projects.","operationId":"login_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Login Login Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"Delete the current session.","operationId":"logout_logout_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Logout Logout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Email a reset link. Always succeeds — never reveals if the email exists.","operationId":"forgot_password_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Forgot Password Forgot Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Consume a reset token, set the new password, notify by email.","operationId":"reset_password_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Reset Password Reset Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contact":{"post":{"tags":["auth"],"summary":"Contact","description":"Send a contact-form message to the founder inbox via Resend.\n\nreply_to is the visitor's address, so a normal inbox reply goes straight\nback to them. No DB row — a failed send fails loudly (500) and the page\nsurfaces the direct support@ address instead.","operationId":"contact_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Contact Contact Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants":{"post":{"tags":["tenants"],"summary":"Create Tenant","description":"Provision a tenant: TDB (Mongo+Redis) + Arango DB + ES index + lm_tenants row.","operationId":"create_tenant_v1_tenants_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Tenant V1 Tenants Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tenants"],"summary":"List Tenants","description":"List tenants in the project, filtered by key scope.\n\nSoft-deleted tenants are hidden by default; ?include_deleted=true lists\nthem too, with status='deleted', so a caller can find one to restore.","operationId":"list_tenants_v1_tenants_get","parameters":[{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tenants V1 Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","operationId":"get_tenant_v1_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tenant V1 Tenants  Tenant Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Update Tenant","description":"Set the label, and optionally who is who in this tenant.\n\nlabel is written on every call (empty clears it). members is written\nonly when sent, and replaces the whole list. Each member is a speaker_id\nand the names that mean them; extraction uses the list to resolve a\nname, misheard or not, to that member's anchor, and never stores the\nassistant as a person. A name may belong to one member only.","operationId":"update_tenant_v1_tenants__tenant_id__patch","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Tenant V1 Tenants  Tenant Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Tenant","description":"Delete a tenant. Soft by default; ?hard=true removes the lm_tenants row.","operationId":"delete_tenant_v1_tenants__tenant_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"hard","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Hard"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Tenant V1 Tenants  Tenant Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/restore":{"post":{"tags":["tenants"],"summary":"Restore Tenant","description":"Restore a soft-deleted tenant. Storage was kept alive, so just flip status.","operationId":"restore_tenant_v1_tenants__tenant_id__restore_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore Tenant V1 Tenants  Tenant Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/turns":{"post":{"tags":["memory"],"summary":"Ingest Turn","description":"Ingest a single turn. Sync Mongo write + NATS publish for async extraction.","operationId":"ingest_turn_v1_tenants__tenant_id__turns_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ingest Turn V1 Tenants  Tenant Id  Turns Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["memory"],"summary":"List Turns","description":"The tenant's stored turns, newest first, page by page.\n\nrecall answers a question; this lists what is there, which is what an app\nneeds to show someone their own memory. Free like recall — only saving is\nbilled.\n\nsearch runs on ES over each turn's chunks (lexical, multilingual analyzer).\nspeaker is an exact speaker_id, start/end an inclusive ts window, order\nasc|desc by ts. total reflects the filtered set, so it paginates. speakers\nlists the tenant's distinct speaker_ids so a client can offer real filters\ninstead of guessing them.\n\nSame shape the dashboard's Turns tab already receives (Rule 3) — one\nresponse to learn, whichever door you came through.","operationId":"list_turns_v1_tenants__tenant_id__turns_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"title":"Search"}},{"name":"speaker","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Speaker"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"desc","title":"Order"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Turns V1 Tenants  Tenant Id  Turns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/turns/batch":{"post":{"tags":["memory"],"summary":"Ingest Batch","description":"Ingest N turns in parallel.","operationId":"ingest_batch_v1_tenants__tenant_id__turns_batch_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchTurnsRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ingest Batch V1 Tenants  Tenant Id  Turns Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/documents":{"post":{"tags":["memory"],"summary":"Ingest Document","description":"Ingest one upload: cut it into turns, then hand them to the batch.\n\nThe cover is the only new thing here. Cutting reuses the chunker the\nworker already splits turns with, so a piece IS a chunk by\nconstruction rather than by two numbers agreeing, and one piece is one\nqueue unit. That size is also what the queue can carry: measured 2 Oct\n2026 over 121 real turns, processing costs 9.8 s per 1000 chars on\naverage and 102.8 s per 1000 at the worst observed, so a 2,048-char\npiece lands at 210 s worst case — a 4.3x margin under\nNATS_ACK_WAIT_SECONDS=900, where 8,192 would leave 1.1x and the\n100,000 a single turn may carry would need hours.\n\nEverything after cutting is the proven path, called rather than\ncopied (Rule 3): /turns/batch already runs the pieces as separate\nunits, bills per piece, and refunds the failed share. Billing by size\nis therefore not new machinery, it is what feeding the batch gives.\n\nPieces default to context_only: stored verbatim, chunked, embedded and\nsearchable, with no fact derived. Nothing is lost by that — the whole\ntext stays and answers quote it — and it costs no paid call. Set\nextract to pay for facts from a document worth learning.","operationId":"ingest_document_v1_tenants__tenant_id__documents_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ingest Document V1 Tenants  Tenant Id  Documents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/documents/{document_id}":{"delete":{"tags":["memory"],"summary":"Delete Document","description":"Delete one upload: every piece it was cut into, and what each derived.\n\nOne handle for a thing stored as many: without it a caller has to keep\neach piece's turn id to undo an upload, which is the bookkeeping the\ndocument cover exists to remove.\n\nNo new deletion logic — this walks the document's pieces and runs the\nsame cascade a single turn gets, so verbatim text, searchable chunk,\ngraph provenance and recognition cache go together (Rule 3). Deleting\nnothing is success: an unknown id means the document is already gone.","operationId":"delete_document_v1_tenants__tenant_id__documents__document_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Document Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Document V1 Tenants  Tenant Id  Documents  Document Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/containers/{source}/{container}":{"delete":{"tags":["memory"],"summary":"Delete Container","description":"Delete everything written from one place: a mailbox, a channel.\n\nWhat arrived together leaves together. Same cascade a single turn\ngets, once per turn, so nothing outlives the place it came from.\n`DELETE /documents/{id}` is this call with source fixed to \"document\".\n\nThe container is a path parameter so a mailbox address or a channel\nname with slashes arrives whole. Deleting nothing is success. A turn\nstill being ingested returns 409 and nothing is deleted.","operationId":"delete_container_v1_tenants__tenant_id__containers__source___container__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Source"}},{"name":"container","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":400,"title":"Container"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Container V1 Tenants  Tenant Id  Containers  Source   Container  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/recall":{"post":{"tags":["memory"],"summary":"Recall","description":"Recall facts + chunks + detected anchors for a query.","operationId":"recall_v1_tenants__tenant_id__recall_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Recall V1 Tenants  Tenant Id  Recall Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/briefing":{"get":{"tags":["memory"],"summary":"Briefing","description":"The tenant's standing rules plus its picture, as one injectable\ntext block. Written offline, read here. Pull once per session start;\nuse recall for questions.","operationId":"briefing_v1_tenants__tenant_id__briefing_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Briefing V1 Tenants  Tenant Id  Briefing Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/turns/status":{"get":{"tags":["memory"],"summary":"Turns Status","description":"Ingest progress: turn counts by status plus failed turn ids. Poll\nafter bulk ingest until indexed == total. Unmetered, like briefing.","operationId":"turns_status_v1_tenants__tenant_id__turns_status_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Turns Status V1 Tenants  Tenant Id  Turns Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/turns/{turn_id}":{"get":{"tags":["memory"],"summary":"Get Turn","description":"One turn, verbatim: the answer to \"where does it know this from\".\n\nEvery fact carries the turn_ids it was drawn from; this reads one of\nthem back. Without it those ids name nothing a caller can show, and a\nperson asking why their memory believes something gets a uuid.\n\nSame turn shape the list returns (Rule 3). 404 when the id names no\nturn in this tenant, which is also what an id from another tenant\ngets: turns live in per-tenant databases, so there is nothing to\nrefuse. Free, like the list.","operationId":"get_turn_v1_tenants__tenant_id__turns__turn_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Turn V1 Tenants  Tenant Id  Turns  Turn Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory"],"summary":"Delete Turn","description":"Delete one turn and everything derived from it: the verbatim turn,\nits chunks, and any facts sourced only from this turn. Facts with other\nsurviving sources stay. 404 if the turn doesn't exist; 409 if it is\nstill being processed (retry once settled).","operationId":"delete_turn_v1_tenants__tenant_id__turns__turn_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Turn V1 Tenants  Tenant Id  Turns  Turn Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/conversation/end":{"post":{"tags":["memory"],"summary":"End Conversation","description":"The app says this tenant's conversation has ended (a call hung up, a\nchat closed). In conversation mode what was said before now is read as\nsoon as its last line is stored, instead of after window_quiet_seconds\nof quiet; without the call, the quiet gap still ends it. Call it after\nthe conversation's last POST /turns has answered: a line still on its\nway when the end is read is read on its own, after the quiet gap.","operationId":"end_conversation_v1_tenants__tenant_id__conversation_end_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response End Conversation V1 Tenants  Tenant Id  Conversation End Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/login":{"get":{"tags":["oauth"],"summary":"Oauth Login Page","operationId":"oauth_login_page_oauth_login_get","parameters":[{"name":"return_to","in":"query","required":false,"schema":{"type":"string","default":"/","title":"Return To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["oauth"],"summary":"Oauth Login Submit","operationId":"oauth_login_submit_oauth_login_post","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_login_submit_oauth_login_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["oauth"],"summary":"Oauth Metadata","operationId":"oauth_metadata__well_known_oauth_authorization_server_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["oauth"],"summary":"Oauth Protected Resource","operationId":"oauth_protected_resource__well_known_oauth_protected_resource_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/register":{"post":{"tags":["oauth"],"summary":"Oauth Register","operationId":"oauth_register_oauth_register_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/oauth/authorize":{"get":{"tags":["oauth"],"summary":"Oauth Authorize","operationId":"oauth_authorize_oauth_authorize_get","parameters":[{"name":"client_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Client Id"}},{"name":"redirect_uri","in":"query","required":false,"schema":{"type":"string","default":"","title":"Redirect Uri"}},{"name":"response_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Response Type"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"","title":"Scope"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"code_challenge","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code Challenge"}},{"name":"code_challenge_method","in":"query","required":false,"schema":{"type":"string","default":"","title":"Code Challenge Method"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/consent":{"post":{"tags":["oauth"],"summary":"Oauth Consent","operationId":"oauth_consent_oauth_consent_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_consent_oauth_consent_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/token":{"post":{"tags":["oauth"],"summary":"Oauth Token","operationId":"oauth_token_oauth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_token_oauth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/revoke":{"post":{"tags":["oauth"],"summary":"Oauth Revoke","operationId":"oauth_revoke_oauth_revoke_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_oauth_revoke_oauth_revoke_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp":{"post":{"tags":["mcp"],"summary":"Mcp Endpoint","operationId":"mcp_endpoint_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/d/apikeys":{"get":{"tags":["api keys"],"summary":"List Api Keys","operationId":"list_api_keys_d_apikeys_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Api Keys D Apikeys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["api keys"],"summary":"Create Api Key","operationId":"create_api_key_d_apikeys_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Api Key D Apikeys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/apikeys/{key_id}":{"delete":{"tags":["api keys"],"summary":"Delete Api Key","operationId":"delete_api_key_d_apikeys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Api Key D Apikeys  Key Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/apikeys/{key_id}/spend":{"get":{"tags":["api keys"],"summary":"Get Api Key Spend","description":"Spend buckets + limit for one key — the key detail view's data.","operationId":"get_api_key_spend_d_apikeys__key_id__spend_get","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Api Key Spend D Apikeys  Key Id  Spend Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/apikeys/{key_id}/limit":{"post":{"tags":["api keys"],"summary":"Set Api Key Limit","description":"Set or clear a key's dev credit limit.","operationId":"set_api_key_limit_d_apikeys__key_id__limit_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLimitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Api Key Limit D Apikeys  Key Id  Limit Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects":{"get":{"tags":["projects"],"summary":"List Projects","operationId":"list_projects_d_projects_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Projects D Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects"],"summary":"Create Project","operationId":"create_project_d_projects_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project D Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}":{"patch":{"tags":["projects"],"summary":"Rename Project","operationId":"rename_project_d_projects__public_id__patch","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rename Project D Projects  Public Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Delete Project","description":"Delete a project. Refuses while tenants remain; ?force=true tears them\ndown first (TDB + Arango + ES), then deletes the project — lm_tenants rows\ngo with it via ON DELETE CASCADE, same as delete_org.","operationId":"delete_project_d_projects__public_id__delete","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Project D Projects  Public Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants":{"get":{"tags":["projects"],"summary":"List Project Tenants","operationId":"list_project_tenants_d_projects__public_id__tenants_get","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Status"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Project Tenants D Projects  Public Id  Tenants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects"],"summary":"Create Project Tenant","operationId":"create_project_tenant_d_projects__public_id__tenants_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenantRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project Tenant D Projects  Public Id  Tenants Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}":{"patch":{"tags":["projects"],"summary":"Update Project Tenant","description":"Set a tenant's human-readable label. Empty clears it and the panel\nfalls back to showing tenant_id.","operationId":"update_project_tenant_d_projects__public_id__tenants__tenant_id__patch","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTenantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Project Tenant D Projects  Public Id  Tenants  Tenant Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Delete Project Tenant","operationId":"delete_project_tenant_d_projects__public_id__tenants__tenant_id__delete","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"hard","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Hard"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Project Tenant D Projects  Public Id  Tenants  Tenant Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/suspend":{"post":{"tags":["projects"],"summary":"Suspend Project Tenant","operationId":"suspend_project_tenant_d_projects__public_id__tenants__tenant_id__suspend_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Suspend Project Tenant D Projects  Public Id  Tenants  Tenant Id  Suspend Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/resume":{"post":{"tags":["projects"],"summary":"Resume Project Tenant","operationId":"resume_project_tenant_d_projects__public_id__tenants__tenant_id__resume_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resume Project Tenant D Projects  Public Id  Tenants  Tenant Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/restore":{"post":{"tags":["projects"],"summary":"Restore Project Tenant","operationId":"restore_project_tenant_d_projects__public_id__tenants__tenant_id__restore_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore Project Tenant D Projects  Public Id  Tenants  Tenant Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/move":{"post":{"tags":["projects"],"summary":"Move Project","description":"Hand a project, with everything under it, to another organization.\n\nNeeded once a project stops being a side experiment and becomes its own\nproduct with its own books: while it sits inside another org, its spend\nand its usage are reported as that org's.\n\nAuthorised on both ends. Being an admin where the project lives is not\nenough, because that alone would let someone push a project, and its\nrunning costs, into an organisation they have no say over. The caller\nmust hold owner or admin in the destination too.","operationId":"move_project_d_projects__public_id__move_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Move Project D Projects  Public Id  Move Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects":{"post":{"tags":["projects"],"summary":"Create Project By Key","description":"A new project beside the key's own, in the same organization, with\nits first admin key; the key is returned once and never shown again.\n\nOnly a project-scoped admin key of a real (not personal) project in a\nlive organization may open projects: a tenant-scoped key is bound to\nits tenants and must not mint keys that reach past them. The project\nand its key are one transaction, so a failed key never leaves a\nproject nobody can reach.","operationId":"create_project_by_key_v1_projects_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project By Key V1 Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/recall":{"post":{"tags":["memory"],"summary":"Recall Tenant","description":"Session-authed recall for the dashboard test bench.\n\nWraps do_recall so the browser never holds an lm_sk_ key. count_usage=False:\noperator test-bench recalls should not inflate the tenant's metered recall\ntotal. Flip to True if you want dashboard recalls billed.","operationId":"recall_tenant_d_projects__public_id__tenants__tenant_id__recall_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Recall Tenant D Projects  Public Id  Tenants  Tenant Id  Recall Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/turns":{"get":{"tags":["memory"],"summary":"List Tenant Turns","description":"Raw turns for the browser's Turns tab.\n\nsearch runs on ES over the turn's chunks (lexical, multilingual analyzer).\nspeaker is an exact speaker_id, start/end an inclusive ts window, order\nasc|desc by ts. total reflects the filtered set. speakers lists the\ntenant's distinct speaker_ids so the client renders real filter chips.","operationId":"list_tenant_turns_d_projects__public_id__tenants__tenant_id__turns_get","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"title":"Search"}},{"name":"speaker","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Speaker"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"desc","title":"Order"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tenant Turns D Projects  Public Id  Tenants  Tenant Id  Turns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/facts":{"get":{"tags":["memory"],"summary":"List Tenant Facts","description":"Distilled facts for the browser's Facts tab, newest first.\n\norder=mentions restores the most-repeated-first list. Recency is the\ndefault because this tab answers \"what is in my memory\": sorted by\nmention count, a fact saved an hour ago sits under a year of\nrepetition and the person concludes nothing was stored.","operationId":"list_tenant_facts_d_projects__public_id__tenants__tenant_id__facts_get","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","pattern":"^(recent|mentions)$","default":"recent","title":"Order"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tenant Facts D Projects  Public Id  Tenants  Tenant Id  Facts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/graph/walk":{"post":{"tags":["memory"],"summary":"Graph Walk","description":"Walk one entity's neighborhood for the graph's search and tap-to-expand.\n\nFacts only: no chunk search, no reranker, so this never hits the recall\ntimeout path. Reaches any entity in the tenant regardless of the facts\nfeed's top-N window, which is the whole point of the scale fix.","operationId":"graph_walk_d_projects__public_id__tenants__tenant_id__graph_walk_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphWalkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Graph Walk D Projects  Public Id  Tenants  Tenant Id  Graph Walk Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/turns/{turn_id}":{"delete":{"tags":["memory"],"summary":"Delete Tenant Turn","description":"Delete one turn and its chunks. Admin only. The browser's prune action.","operationId":"delete_tenant_turn_d_projects__public_id__tenants__tenant_id__turns__turn_id__delete","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"turn_id","in":"path","required":true,"schema":{"type":"string","title":"Turn Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Tenant Turn D Projects  Public Id  Tenants  Tenant Id  Turns  Turn Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/rules":{"get":{"tags":["memory"],"summary":"List Tenant Rules","description":"The tenant's rules for the browser's Rules tab, ordered by position.","operationId":"list_tenant_rules_d_projects__public_id__tenants__tenant_id__rules_get","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Tenant Rules D Projects  Public Id  Tenants  Tenant Id  Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/projects/{public_id}/tenants/{tenant_id}/rules/{rule_id}":{"patch":{"tags":["memory"],"summary":"Update Tenant Rule","description":"Edit one rule in place from the dashboard. Admin only, like prune.","operationId":"update_tenant_rule_d_projects__public_id__tenants__tenant_id__rules__rule_id__patch","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Tenant Rule D Projects  Public Id  Tenants  Tenant Id  Rules  Rule Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory"],"summary":"Delete Tenant Rule","description":"Remove one rule from the dashboard. Admin only, like prune.","operationId":"delete_tenant_rule_d_projects__public_id__tenants__tenant_id__rules__rule_id__delete","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Tenant Rule D Projects  Public Id  Tenants  Tenant Id  Rules  Rule Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/rules":{"get":{"tags":["rules"],"summary":"List Rules","description":"A tenant's rules, ordered by position. Omit scope to get all.","operationId":"list_rules_v1_tenants__tenant_id__rules_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Scope"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Rules V1 Tenants  Tenant Id  Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rules"],"summary":"Create Rule","description":"Write one rule. Unmetered: a rule is configuration, not a memory.","operationId":"create_rule_v1_tenants__tenant_id__rules_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Rule V1 Tenants  Tenant Id  Rules Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/rules/{rule_id}":{"patch":{"tags":["rules"],"summary":"Update Rule","description":"Edit a rule in place.\n\nA changed rule replaces its old text outright. Unlike a fact, there is\nno earlier version to keep for provenance and nothing to supersede.","operationId":"update_rule_v1_tenants__tenant_id__rules__rule_id__patch","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Rule V1 Tenants  Tenant Id  Rules  Rule Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rules"],"summary":"Delete Rule","description":"Remove one rule. 404 if it doesn't exist.","operationId":"delete_rule_v1_tenants__tenant_id__rules__rule_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Rule V1 Tenants  Tenant Id  Rules  Rule Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/entities":{"get":{"tags":["entities"],"summary":"List Entities","description":"Everything this memory holds, newest first.\n\nkind filters to one type, q matches the name (case-insensitive,\nsubstring). total counts the filtered set, so a search paginates.\n\nThe person themselves is an entity like any other: their vertex is\n`_speaker:<speaker_id>` with kind `speaker`, created on their first\nturn. A map built around \"me\" starts there.","operationId":"list_entities_v1_tenants__tenant_id__entities_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"title":"Kind"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}],"title":"Q"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Entities V1 Tenants  Tenant Id  Entities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/entities/kinds":{"get":{"tags":["entities"],"summary":"Entity Kinds","description":"The entity types in this tenant, most common first.\n\nTypes are learned during extraction, not chosen from a fixed list, so\ntwo tenants rarely share the same set and a client cannot hardcode\nthem. This is how a UI offers real categories.","operationId":"entity_kinds_v1_tenants__tenant_id__entities_kinds_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Entity Kinds V1 Tenants  Tenant Id  Entities Kinds Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/entities/{entity_id}":{"get":{"tags":["entities"],"summary":"Get Entity","description":"One entity with every fact touching it, in either direction.\n\nEach fact carries turn_ids: the turns it was drawn from, which is the\nanswer to \"where does it know this from\" and the input to a delete.","operationId":"get_entity_v1_tenants__tenant_id__entities__entity_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity V1 Tenants  Tenant Id  Entities  Entity Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tenants/{tenant_id}/facts":{"get":{"tags":["entities"],"summary":"List Facts","description":"Every edge in the graph, page by page. The whole map in one read.\n\nNewest first; order=mentions for most-repeated first. Same fact shape\nas the entity card, so a client parses one thing.","operationId":"list_facts_v1_tenants__tenant_id__facts_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","pattern":"^(recent|mentions)$","default":"recent","title":"Order"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Facts V1 Tenants  Tenant Id  Facts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/usage":{"get":{"tags":["usage"],"summary":"Get Usage","operationId":"get_usage_d_usage_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Scope"}},{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}},{"name":"group","in":"query","required":false,"schema":{"type":"string","default":"project","title":"Group"}},{"name":"project","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage D Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["usage"],"summary":"Get Usage V1","description":"What this API key's project has consumed, so a customer can bill it on.\n\nLM meters every call it serves, but until now that data only existed\nbehind the dashboard session, so a developer reselling LM had no way to\nread their own consumption. This is that read: the key's own project,\nnever another, and never billing state, only counters.\n\nWindow defaults to the current calendar month, which is the unit a\ncustomer reconciles against. 'to' is inclusive of the whole day named,\nbecause a caller asking for usage 'to 2026-09-06' means including it.\n\nA tenant-scoped key sees only its own tenants, matching how the same\nkey is already restricted on every other /v1 route.","operationId":"get_usage_v1_v1_usage_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"by_tenant","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"By Tenant"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage V1 V1 Usage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/orgs":{"post":{"tags":["organizations"],"summary":"Create Org","description":"Create an org, make the caller its owner, and seed a starter project.","operationId":"create_org_d_orgs_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Org D Orgs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["organizations"],"summary":"List Orgs","description":"Every org the user belongs to, with role and which one is active.","operationId":"list_orgs_d_orgs_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Orgs D Orgs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/orgs/switch":{"post":{"tags":["organizations"],"summary":"Switch Org","description":"Set the session's active org. Must be one the user belongs to.","operationId":"switch_org_d_orgs_switch_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchOrgRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Switch Org D Orgs Switch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/orgs/{public_id}/rename":{"post":{"tags":["organizations"],"summary":"Rename Org","description":"Rename an organization. Owner-only.","operationId":"rename_org_d_orgs__public_id__rename_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameOrgRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rename Org D Orgs  Public Id  Rename Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/orgs/{public_id}/archive":{"post":{"tags":["organizations"],"summary":"Archive Org","description":"Archive (soft-delete) an org. Owner-only, not the active org, not your last live one.","operationId":"archive_org_d_orgs__public_id__archive_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Archive Org D Orgs  Public Id  Archive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/orgs/{public_id}/restore":{"post":{"tags":["organizations"],"summary":"Restore Org","description":"Restore an archived org. Owner-only.","operationId":"restore_org_d_orgs__public_id__restore_post","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Restore Org D Orgs  Public Id  Restore Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/orgs/{public_id}":{"delete":{"tags":["organizations"],"summary":"Delete Org","description":"Permanently delete an ARCHIVED org: tear down every tenant's physical\nstorage, then delete its projects, memberships, and the org row. Owner-only.\n\nTeardown reuses the per-tenant cleanup from the tenant delete path so it can\nnever drift from it. Projects and memberships are deleted explicitly (not via\nan org-level cascade) so the result is correct regardless of FK config.","operationId":"delete_org_d_orgs__public_id__delete","parameters":[{"name":"public_id","in":"path","required":true,"schema":{"type":"string","title":"Public Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Org D Orgs  Public Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me":{"get":{"tags":["account"],"summary":"Get Me","operationId":"get_me_d_me_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Me D Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["account"],"summary":"Delete Account","description":"Permanently delete the current user's account, orgs, projects,\ntenants, and all stored memory. Irreversible.\n\nConfirmed by the account password, verified the same way login verifies it.\nThe org-member guard still applies: an org with another member is refused.","operationId":"delete_account_d_me_delete","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Account D Me Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me/personal-project":{"get":{"tags":["account"],"summary":"Get Personal Project","description":"The active org's personal-memory project (is_personal=true), if any.\n\nThe personal shell calls this to find where the \"me\" tenant lives, since\nthe dev Projects list deliberately hides is_personal projects.","operationId":"get_personal_project_d_me_personal_project_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Personal Project D Me Personal Project Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me/connect-status":{"get":{"tags":["account"],"summary":"Get Connect Status","description":"Whether this user's personal 'me' tenant has a live MCP connection.\n\nLive = an unrevoked OAuth token whose refresh is still valid. Powers the\nMemory screen's three-state empty view and the Connect screen's real\n(read-back) connected state. No connection or no personal setup returns\nconnected: false rather than an error, so the caller branches on one shape.","operationId":"get_connect_status_d_me_connect_status_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Connect Status D Me Connect Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me/owner-names":{"get":{"tags":["account"],"summary":"Get Owner Names","description":"The personal tenant's owner-name list. Empty = attribution off.","operationId":"get_owner_names_d_me_owner_names_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Owner Names D Me Owner Names Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account"],"summary":"Post Owner Names","description":"Replace the owner's names, keeping every other member. Same checks as\nPATCH /v1/tenants members (Rule 3).","operationId":"post_owner_names_d_me_owner_names_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OwnerNamesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Owner Names D Me Owner Names Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me/password":{"post":{"tags":["account"],"summary":"Change Password","operationId":"change_password_d_me_password_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Change Password D Me Password Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me/onboarded":{"post":{"tags":["account"],"summary":"Mark Onboarded","operationId":"mark_onboarded_d_me_onboarded_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mark Onboarded D Me Onboarded Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/me/account-type":{"post":{"tags":["account"],"summary":"Set Account Type","description":"Move the caller between developer and personal use.\n\nAlone in the active org, this converts that org in place:\ndeveloper -> personal ensures a is_personal \"Personal\" project holding a\n\"me\" tenant (find-or-create); personal -> developer just flips the flag and\nleaves the Personal project and \"me\" tenant in place, hidden from the dev\nProjects list by the filter.\n\nSharing the org with anyone else, converting is refused, because it would\nrewrite the account for every other member. Asking for personal use then\nmeans \"give me my own space\": the caller gets their own org, owned by them,\nwith the same shape a personal signup produces, and the session switches\ninto it. Their membership of the shared org is untouched.\n\nIdempotent throughout: re-running a switch never duplicates an org, a\nproject or a tenant, and a caller who already owns a personal org is sent\nback to it rather than given a second one.","operationId":"set_account_type_d_me_account_type_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAccountTypeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Account Type D Me Account Type Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/members":{"get":{"tags":["members"],"summary":"List Members","operationId":"list_members_d_members_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Members D Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["members"],"summary":"Add Member","operationId":"add_member_d_members_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddMemberRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Member D Members Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/members/{user_id}":{"patch":{"tags":["members"],"summary":"Update Member Role","operationId":"update_member_role_d_members__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Member Role D Members  User Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["members"],"summary":"Remove Member","operationId":"remove_member_d_members__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Member D Members  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/paddle":{"post":{"tags":["billing"],"summary":"Paddle Webhook","operationId":"paddle_webhook_webhooks_paddle_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/d/billing":{"get":{"tags":["billing"],"summary":"Get Billing","description":"The active org's billing state.\n\nNo subscription row means the org is on the free plan; return that directly.\nOtherwise enrich the stored row with the live next-billing date and Paddle's\nmanagement URLs, which we never store.","operationId":"get_billing_d_billing_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Billing D Billing Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/billing/overage":{"post":{"tags":["billing"],"summary":"Set Overage","description":"Turn overage on/off for the active org (opt in/out of a hard cap).\n\nA free org has no subscription row and cannot toggle — returns a clear\nerror rather than silently no-opping.","operationId":"set_overage_d_billing_overage_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_OverageToggle"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Overage D Billing Overage Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/credits":{"get":{"tags":["billing"],"summary":"Get Credits","description":"The active org's credit balance + a ledger page, for the Credits\nscreen. Credits are open to every org; the personal project bills via\nsubscription, all other projects spend credits.\n\n?type= filters before paging, so `total` reflects the filter and the UI\ncan page within it. project_name/project_public_id are null for rows with\nno originating api key (top-ups, grants) or a deleted one.","operationId":"get_credits_d_credits_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Credits D Credits Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/credits/autotopup":{"post":{"tags":["billing"],"summary":"Set Autotopup","description":"Set or clear the org's auto top-up rule.\n\nThe min/max range is a RATE, enforced here rather than in control/credits\n(that module never reads config_pricing) — the same check\ncreate_topup_checkout applies to a manual top-up, so a rule can never buy\nan amount a person could not buy by hand.","operationId":"set_autotopup_d_credits_autotopup_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoTopupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Autotopup D Credits Autotopup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/credits/checkout":{"post":{"tags":["billing"],"summary":"Create Topup Checkout","description":"Create a Paddle draft transaction for a credit top-up.\n\nThe org and the dev_credits purpose are stamped into custom_data HERE,\nserver-side from the session — the client cannot attribute a top-up to a\ndifferent org. Returns the txn id; the dashboard passes it to Paddle.js\n(Checkout.open transactionId) to collect payment inline. Crediting the\nbalance happens in the transaction.completed webhook, not here.","operationId":"create_topup_checkout_d_credits_checkout_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_TopUpRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Topup Checkout D Credits Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/d/credits/card":{"get":{"tags":["billing"],"summary":"Get Saved Card","description":"Describe the payment method on file, so the UI can name it.\n\nIts own endpoint rather than a field on GET /d/credits: that one is hit on\nevery page, filter and pagination change, and none of those should wait on\na Paddle round trip. This is read once when the card row renders.\n\nNever fails the caller. Paddle being slow, the customer being unknown, or\nthe method having been removed all come back as method=null, and the UI\nfalls back to \"payment method saved\" — a named card is a convenience, not\nsomething worth breaking a billing page over.","operationId":"get_saved_card_d_credits_card_get","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Saved Card D Credits Card Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["billing"],"summary":"Create Card Checkout","description":"Create a Paddle draft transaction that saves a card for auto top-up.\n\nSame server-side pattern as create_topup_checkout: the org and purpose are\nstamped into custom_data HERE, from the session, so a client cannot attach\na card to a different org. The difference is the item — a CATALOG price id\nwith a monthly billing cycle rather than an inline one-off amount. Paddle's\nrule: \"an automatically-collected transaction is completed, Paddle\nautomatically creates a related subscription for the items on the\ntransaction\", so completing this $0 checkout both stores the payment method\nand produces the subscription that later top-ups are charged against.\n\nReturns the txn id; the dashboard passes it to Checkout.open({transactionId}),\nthe same bridge the top-up flow already uses. The subscription id reaches us\non the subscription.activated webhook, not here.","operationId":"create_card_checkout_d_credits_card_post","parameters":[{"name":"Authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Card Checkout D Credits Card Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin":{"get":{"tags":["admin"],"summary":"Admin Page","description":"The dashboard. No auth: the secret is typed into the page and travels\non the data calls, exactly as TenantsDB's admin does.","operationId":"admin_page_admin_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/summary":{"get":{"tags":["admin"],"summary":"Summary","operationId":"summary_admin_summary_get","parameters":[{"name":"x-admin-secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Summary Admin Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"User List","operationId":"user_list_admin_users_get","parameters":[{"name":"x-admin-secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response User List Admin Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/user/{user_id}":{"get":{"tags":["admin"],"summary":"User Detail","operationId":"user_detail_admin_user__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"x-admin-secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response User Detail Admin User  User Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/funnel":{"get":{"tags":["admin"],"summary":"Funnel","description":"Signup to first recall. Each step counts DISTINCT users, so a person\nwith two orgs is one person, not two.","operationId":"funnel_admin_funnel_get","parameters":[{"name":"x-admin-secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Funnel Admin Funnel Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/health":{"get":{"tags":["admin"],"summary":"Health","operationId":"health_admin_health_get","parameters":[{"name":"x-admin-secret","in":"header","required":false,"schema":{"type":"string","default":"","title":"X-Admin-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Health Admin Health Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AddMemberRequest":{"properties":{"email":{"type":"string","minLength":1,"title":"Email"},"role":{"type":"string","title":"Role"}},"type":"object","required":["email","role"],"title":"AddMemberRequest"},"AutoTopupRequest":{"properties":{"below":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Below"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"}},"type":"object","title":"AutoTopupRequest","description":"Both null turns auto top-up off."},"BatchTurnsRequest":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/TurnRequest"},"type":"array","maxItems":100,"minItems":1,"title":"Turns"}},"type":"object","required":["turns"],"title":"BatchTurnsRequest"},"Body_oauth_consent_oauth_consent_post":{"properties":{"action":{"type":"string","title":"Action"},"client_id":{"type":"string","title":"Client Id"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"scope":{"type":"string","title":"Scope"},"state":{"type":"string","title":"State","default":""},"binding":{"type":"string","title":"Binding","default":""},"code_challenge":{"type":"string","title":"Code Challenge","default":""},"code_challenge_method":{"type":"string","title":"Code Challenge Method","default":""}},"type":"object","required":["action","client_id","redirect_uri","scope"],"title":"Body_oauth_consent_oauth_consent_post"},"Body_oauth_login_submit_oauth_login_post":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"return_to":{"type":"string","title":"Return To","default":"/"}},"type":"object","required":["email","password"],"title":"Body_oauth_login_submit_oauth_login_post"},"Body_oauth_revoke_oauth_revoke_post":{"properties":{"token":{"type":"string","title":"Token"},"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"}},"type":"object","required":["token","client_id","client_secret"],"title":"Body_oauth_revoke_oauth_revoke_post"},"Body_oauth_token_oauth_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"},"code":{"type":"string","title":"Code","default":""},"redirect_uri":{"type":"string","title":"Redirect Uri","default":""},"code_verifier":{"type":"string","title":"Code Verifier","default":""},"refresh_token":{"type":"string","title":"Refresh Token","default":""}},"type":"object","required":["grant_type","client_id","client_secret"],"title":"Body_oauth_token_oauth_token_post"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","minLength":1,"title":"Current Password"},"new_password":{"type":"string","minLength":8,"title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest"},"ContactRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"reason":{"type":"string","pattern":"^(product|developers|billing|other)$","title":"Reason"},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"},"website":{"type":"string","maxLength":200,"title":"Website","default":""}},"type":"object","required":["name","email","reason","message"],"title":"ContactRequest"},"CreateKeyRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"project_id":{"type":"string","minLength":1,"title":"Project Id"},"role":{"type":"string","title":"Role"},"scope_type":{"type":"string","title":"Scope Type","default":"project"},"scope_values":{"items":{"type":"string"},"type":"array","title":"Scope Values","default":[]}},"type":"object","required":["name","project_id","role"],"title":"CreateKeyRequest"},"CreateOrgRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"CreateOrgRequest"},"CreateProjectRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"CreateProjectRequest"},"CreateTenantRequest":{"properties":{"tenant_id":{"type":"string","maxLength":18,"minLength":1,"title":"Tenant Id"},"label":{"type":"string","maxLength":200,"title":"Label","default":""}},"type":"object","required":["tenant_id"],"title":"CreateTenantRequest"},"DeleteAccountRequest":{"properties":{"password":{"type":"string","minLength":1,"title":"Password"}},"type":"object","required":["password"],"title":"DeleteAccountRequest"},"DocumentRequest":{"properties":{"content":{"type":"string","maxLength":204800,"minLength":1,"title":"Content"},"document_id":{"type":"string","maxLength":200,"minLength":1,"title":"Document Id"},"speaker_id":{"type":"string","maxLength":200,"title":"Speaker Id","default":""},"role":{"type":"string","maxLength":50,"minLength":1,"title":"Role","default":"user"},"ts":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ts"},"extract":{"type":"boolean","title":"Extract","default":false}},"type":"object","required":["content","document_id"],"title":"DocumentRequest","description":"One upload, which the cover cuts into turns before ingesting.\n\nmax_length is the batch ceiling expressed in characters: the cover\nfeeds POST /turns/batch, which takes at most 100 turns, and a piece is\none chunk (CHUNKER_TARGET_TOKENS x 4 = 2,048 chars). A longer document\nis the caller's loop, the same way a longer conversation is."},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GraphWalkRequest":{"properties":{"entity":{"type":"string","title":"Entity"},"is_speaker":{"type":"boolean","title":"Is Speaker","default":false}},"type":"object","required":["entity"],"title":"GraphWalkRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":200,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"MemberEntry":{"properties":{"speaker_id":{"type":"string","maxLength":200,"minLength":1,"title":"Speaker Id"},"kind":{"type":"string","enum":["person","assistant"],"title":"Kind"},"owner":{"type":"boolean","title":"Owner","default":false},"names":{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"title":"Names"}},"additionalProperties":false,"type":"object","required":["speaker_id","kind","names"],"title":"MemberEntry","description":"One participant: the speaker_id their turns carry, and the names that\nmean them (first = current, the rest = old names and aliases)."},"MoveProjectRequest":{"properties":{"organization":{"type":"string","maxLength":64,"minLength":1,"title":"Organization"}},"type":"object","required":["organization"],"title":"MoveProjectRequest"},"OwnerNamesRequest":{"properties":{"names":{"items":{"type":"string"},"type":"array","maxItems":10,"title":"Names"}},"type":"object","required":["names"],"title":"OwnerNamesRequest"},"RecallRequest":{"properties":{"query":{"type":"string","maxLength":10000,"minLength":1,"title":"Query"},"speaker_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Speaker Id"},"anchor_entity":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Anchor Entity"},"start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"},"min_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Min Score"}},"type":"object","required":["query"],"title":"RecallRequest"},"RenameOrgRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"RenameOrgRequest"},"RenameProjectRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"RenameProjectRequest"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","minLength":1,"title":"Token"},"new_password":{"type":"string","maxLength":200,"minLength":8,"title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"RuleCreate":{"properties":{"text":{"type":"string","maxLength":2000,"minLength":1,"title":"Text"},"scope":{"type":"string","maxLength":100,"minLength":1,"title":"Scope","default":"always"},"position":{"type":"integer","minimum":0.0,"title":"Position","default":0}},"type":"object","required":["text"],"title":"RuleCreate"},"RuleUpdate":{"properties":{"text":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Text"},"scope":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Scope"},"position":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Position"}},"type":"object","title":"RuleUpdate"},"SetAccountTypeRequest":{"properties":{"account_type":{"type":"string","pattern":"^(developer|personal)$","title":"Account Type"}},"type":"object","required":["account_type"],"title":"SetAccountTypeRequest"},"SetLimitRequest":{"properties":{"limit":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Limit"}},"type":"object","title":"SetLimitRequest"},"SignupRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":200,"minLength":8,"title":"Password"},"organization_name":{"type":"string","maxLength":200,"minLength":1,"title":"Organization Name","default":"My Organisation"},"account_type":{"type":"string","pattern":"^(developer|personal)$","title":"Account Type","default":"developer"}},"type":"object","required":["email","password"],"title":"SignupRequest"},"SwitchOrgRequest":{"properties":{"public_id":{"type":"string","minLength":1,"title":"Public Id"}},"type":"object","required":["public_id"],"title":"SwitchOrgRequest"},"TurnRequest":{"properties":{"role":{"type":"string","maxLength":50,"minLength":1,"title":"Role"},"content":{"type":"string","maxLength":100000,"minLength":1,"title":"Content"},"speaker_id":{"type":"string","maxLength":200,"title":"Speaker Id","default":""},"ts":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ts"},"context_only":{"type":"boolean","title":"Context Only","default":false},"source":{"type":"string","maxLength":100,"title":"Source","default":""},"container":{"type":"string","maxLength":400,"title":"Container","default":""},"tz":{"type":"string","maxLength":64,"title":"Tz","default":""}},"type":"object","required":["role","content"],"title":"TurnRequest"},"UpdateMemberRoleRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"UpdateMemberRoleRequest"},"UpdateTenantRequest":{"properties":{"label":{"type":"string","maxLength":200,"title":"Label","default":""},"members":{"anyOf":[{"items":{"$ref":"#/components/schemas/MemberEntry"},"type":"array","maxItems":40},{"type":"null"}],"title":"Members"},"extraction":{"anyOf":[{"type":"string","enum":["per_turn","conversation"]},{"type":"null"}],"title":"Extraction"},"window_quiet_seconds":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":60.0},{"type":"null"}],"title":"Window Quiet Seconds"}},"additionalProperties":false,"type":"object","title":"UpdateTenantRequest"},"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"},"_OverageToggle":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"_OverageToggle"},"_TopUpRequest":{"properties":{"amount":{"type":"number","title":"Amount"}},"type":"object","required":["amount"],"title":"_TopUpRequest"}}}}