{"openapi":"3.1.0","info":{"title":"infra-logs templater","description":"Token compression for log streams. POST raw logs, get back templates or capsules.","version":"0.1.0"},"paths":{"/api/auth/google":{"post":{"summary":"Google Login","description":"Exchange a Google authorization code for a session JWT + user/org info.\n\nSignup is open: any Google account can sign in. A first-time user with an\norg invite token joins that org; otherwise they land with no org and the\nconsole prompts them to create their first org via `POST /api/orgs/self-serve`.","operationId":"google_login_api_auth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"summary":"Get Me","operationId":"get_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}}},"patch":{"summary":"Update Me","operationId":"update_me_api_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"summary":"Logout","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Logout Api Auth Logout Post"}}}}}}},"/api/auth/console-session":{"post":{"summary":"Mint Console Session","description":"Mint a short-lived browser bearer for direct /v1/* calls.\n\nAuthenticated by the user's session JWT. The returned token carries\n(user_id, org_id, aud=console-v1) and is valid for ~10 min. The browser\nholds it in memory and presents it on POST /v1/compact (and, for admins,\nthe deprecated /v1/capsule) direct to the API host (no Vercel proxy on the\ndata plane).\n\nBody must specify the target org. Prefer `org_id` (unambiguous);\n`org_slug` is accepted as a one-release deprecation path and is\nresolved against the caller's memberships only — 409 `slug_ambiguous`\nwhen the user belongs to ≥2 orgs sharing that slug.","operationId":"mint_console_session_api_auth_console_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsoleSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsoleSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs":{"get":{"summary":"List My Orgs","operationId":"list_my_orgs_api_orgs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List My Orgs Api Orgs Get"}}}}}},"post":{"summary":"Create Org","description":"Create an org. Global admin only.\n\nThe admin is added as `owner` so they can manage members/keys via the UI.","operationId":"create_org_api_orgs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrgRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Org Api Orgs Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/self-serve":{"post":{"summary":"Self Serve Create Org","description":"Create the caller's first org.\n\nWorkspace-domain signup (alice@acme.com) can call this with no body —\nwe title-case the domain label into a default name (\"Acme\") and slug.\n\nConsumer-domain signup (michael@gmail.com) must supply `{name, slug}`\nexplicitly; calling with no body returns `409 name_required` so the\nconsole can render its FirstOrgForm prompt instead of inflicting\n\"Gmail\" on the user.\n\nAllowed only when the caller has zero existing memberships; subsequent\norg creation goes through `POST /api/admin/orgs`.\n\nIdempotency: a Postgres TRANSACTION-scoped advisory lock keyed on\nuser_id serializes concurrent self-serve calls. (We deliberately do\nNOT use the session-scoped pg_advisory_lock — on a pooled connection a\nsession lock leaks across requests.)","operationId":"self_serve_create_org_api_orgs_self_serve_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SelfServeCreateRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Self Serve Create Org Api Orgs Self Serve Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboard/sources":{"get":{"summary":"Get Onboard Sources","description":"Return per-source warm history for a specific org the caller belongs to.\n\nThe dashboard pairs this with its hardcoded source catalog to show\n'Last warmed: 2h ago, +127 templates' next to each integration tile.\n\nPrefer `?org_id=<numeric>`. `?slug=<org-slug>` is accepted as a\none-release deprecation path (resolved against the caller's\nmemberships, 409 `slug_ambiguous` on collision). Without either, we\nreturn an empty list rather than guessing — guessing leaks data when\na user belongs to multiple orgs.","operationId":"get_onboard_sources_api_onboard_sources_get","parameters":[{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"}},{"name":"slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Onboard Sources Api Onboard Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}":{"get":{"summary":"Get Org","operationId":"get_org_api_orgs__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Org Api Orgs  Slug  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update Org","operationId":"update_org_api_orgs__slug__patch","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Org Api Orgs  Slug  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/keys":{"get":{"summary":"List Keys","operationId":"list_keys_api_orgs__slug__keys_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Keys Api Orgs  Slug  Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Key","operationId":"create_key_api_orgs__slug__keys_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"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 Key Api Orgs  Slug  Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/keys/{key_id}":{"delete":{"summary":"Revoke Key","operationId":"revoke_key_api_orgs__slug__keys__key_id__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Revoke Key Api Orgs  Slug  Keys  Key Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/members":{"get":{"summary":"List Members","operationId":"list_members_api_orgs__slug__members_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Members Api Orgs  Slug  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/members/{user_id}":{"delete":{"summary":"Remove Member","operationId":"remove_member_api_orgs__slug__members__user_id__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Remove Member Api Orgs  Slug  Members  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/invites":{"get":{"summary":"List Invites","operationId":"list_invites_api_orgs__slug__invites_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Invites Api Orgs  Slug  Invites Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Send Invite","operationId":"send_invite_api_orgs__slug__invites_post","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Invite Api Orgs  Slug  Invites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/invites/{invite_id}":{"delete":{"summary":"Cancel Invite","operationId":"cancel_invite_api_orgs__slug__invites__invite_id__delete","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cancel Invite Api Orgs  Slug  Invites  Invite Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/invites/{token}/accept":{"post":{"summary":"Accept Invite","operationId":"accept_invite_api_orgs_invites__token__accept_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Accept Invite Api Orgs Invites  Token  Accept Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/usage/summary":{"get":{"summary":"Get Usage Summary","description":"Aggregate counters for the dashboard's headline KPI cards.\n\nLegacy slug route. Console uses `GET /api/org/usage/summary` now (id\nvia X-Codag-Org-Id header). Body identical via the shared helper.","operationId":"get_usage_summary_api_orgs__slug__usage_summary_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage Summary Api Orgs  Slug  Usage Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/{slug}/usage/timeseries":{"get":{"summary":"Get Usage Timeseries","description":"Bucketed series for the dashboard's bar chart. Legacy slug route.","operationId":"get_usage_timeseries_api_orgs__slug__usage_timeseries_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Period"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Bucket"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage Timeseries Api Orgs  Slug  Usage Timeseries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org":{"get":{"summary":"Get Current Org","operationId":"get_current_org_api_org_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Current Org Api Org Get"}}}}}},"patch":{"summary":"Update Current Org","operationId":"update_current_org_api_org_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrgRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Update Current Org Api Org Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/keys":{"get":{"summary":"List Current Org Keys","operationId":"list_current_org_keys_api_org_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Current Org Keys Api Org Keys Get"}}}}}},"post":{"summary":"Create Current Org Key","operationId":"create_current_org_key_api_org_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Current Org Key Api Org Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/keys/{key_id}":{"delete":{"summary":"Revoke Current Org Key","operationId":"revoke_current_org_key_api_org_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Revoke Current Org Key Api Org Keys  Key Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/members":{"get":{"summary":"List Current Org Members","operationId":"list_current_org_members_api_org_members_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Current Org Members Api Org Members Get"}}}}}}},"/api/org/members/{user_id}":{"delete":{"summary":"Remove Current Org Member","operationId":"remove_current_org_member_api_org_members__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Remove Current Org Member Api Org Members  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/invites":{"get":{"summary":"List Current Org Invites","operationId":"list_current_org_invites_api_org_invites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Current Org Invites Api Org Invites Get"}}}}}},"post":{"summary":"Send Current Org Invite","operationId":"send_current_org_invite_api_org_invites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Send Current Org Invite Api Org Invites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/invites/{invite_id}":{"delete":{"summary":"Cancel Current Org Invite","operationId":"cancel_current_org_invite_api_org_invites__invite_id__delete","parameters":[{"name":"invite_id","in":"path","required":true,"schema":{"type":"integer","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Cancel Current Org Invite Api Org Invites  Invite Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/activate/{code}":{"get":{"summary":"Preview Activation Code","description":"Public (unauthenticated) preview so the landing page can show what the\nlink grants *before* Google sign-in. Reveals kind, trial/opt-out length,\nvalidity, and the label (prospect-facing copy on the deal card) — never\nredemption internals. Rate-limited: this is a code-validity oracle. The\nslowapi decorator buckets per path (per guessed code), so unknown-code\nlookups additionally burn a cross-path per-IP budget.","operationId":"preview_activation_code_api_activate__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Activation Code Api Activate  Code  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/activate/{code}/redeem":{"post":{"summary":"Redeem Activation Code","description":"Redeem an activation code: grant the caller's org a time-boxed inference\ntrial. Idempotent per (code, org) — re-clicking neither double-counts nor\nre-extends.","operationId":"redeem_activation_code_api_activate__code__redeem_post","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RedeemActivationRequest"},{"type":"null"}],"title":"Req"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Redeem Activation Code Api Activate  Code  Redeem Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/activation-codes":{"get":{"summary":"List Activation Codes","operationId":"list_activation_codes_api_admin_activation_codes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Activation Codes Api Admin Activation Codes Get"}}}}}},"post":{"summary":"Create Activation Code","operationId":"create_activation_code_api_admin_activation_codes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateActivationCodeRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Activation Code Api Admin Activation Codes Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/activation-codes/{code_id}":{"delete":{"summary":"Revoke Activation Code","operationId":"revoke_activation_code_api_admin_activation_codes__code_id__delete","parameters":[{"name":"code_id","in":"path","required":true,"schema":{"type":"integer","title":"Code Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Revoke Activation Code Api Admin Activation Codes  Code Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orgs/by-id/{org_id}":{"get":{"summary":"Get Org By Id Route","description":"Fetch an org by its base62 id.\n\nUsed by the console's switch-org route for global admins jumping to an\norg they aren't yet a member of. Membership is verified — for non-admin\ncallers a 403 falls out of `_require_org_access`.","operationId":"get_org_by_id_route_api_orgs_by_id__org_id__get","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Org By Id Route Api Orgs By Id  Org Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/usage/summary":{"get":{"summary":"Get Current Org Usage Summary","operationId":"get_current_org_usage_summary_api_org_usage_summary_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Period"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Usage Summary Api Org Usage Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/usage/timeseries":{"get":{"summary":"Get Current Org Usage Timeseries","operationId":"get_current_org_usage_timeseries_api_org_usage_timeseries_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Period"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Bucket"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Usage Timeseries Api Org Usage Timeseries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/usage/by-dimension":{"get":{"summary":"Get Current Org Usage By Dimension","operationId":"get_current_org_usage_by_dimension_api_org_usage_by_dimension_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Period"}},{"name":"dimension","in":"query","required":false,"schema":{"type":"string","default":"service","title":"Dimension"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Usage By Dimension Api Org Usage By Dimension Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/usage/patterns":{"get":{"summary":"Get Current Org Usage Patterns","operationId":"get_current_org_usage_patterns_api_org_usage_patterns_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Period"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":15,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"count","title":"Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Usage Patterns Api Org Usage Patterns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/incidents/summary":{"get":{"summary":"Get Current Org Incidents Summary","description":"Per-day incident counts for the console's Incidents rollup chart.\n\nReads incident_memory_runs directly (rides ix_incident_memory_runs_org_created).\nNo Pro gate: non-Pro orgs simply have no rows.","operationId":"get_current_org_incidents_summary_api_org_incidents_summary_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Incidents Summary Api Org Incidents Summary Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/usage/efficiency":{"get":{"summary":"Get Current Org Usage Efficiency","operationId":"get_current_org_usage_efficiency_api_org_usage_efficiency_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Usage Efficiency Api Org Usage Efficiency Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/org/usage/new-patterns":{"get":{"summary":"Get Current Org Usage New Patterns","operationId":"get_current_org_usage_new_patterns_api_org_usage_new_patterns_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"month","title":"Period"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Org Usage New Patterns Api Org Usage New Patterns Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/device/code":{"post":{"summary":"Device Code Endpoint","description":"Issue a fresh device + user code pair. No authentication.","operationId":"device_code_endpoint_oauth_device_code_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_device_code_endpoint_oauth_device_code_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/oauth/token":{"post":{"summary":"Token Endpoint","description":"Exchange a device_code or refresh_token for a fresh access token.","operationId":"token_endpoint_oauth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_token_endpoint_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"}}}}}}},"/api/cli/confirm":{"post":{"summary":"Cli Confirm","description":"Browser → server: 'I'm signed in, please link this user_code to me + org X'.","operationId":"cli_confirm_api_cli_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CLIConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CLIConfirmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/cli/deny":{"post":{"summary":"Cli Deny","description":"Browser → server: 'user clicked Deny on the /cli-auth page'.","operationId":"cli_deny_api_cli_deny_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CLIConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CLIConfirmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/whoami":{"get":{"summary":"Whoami Endpoint","description":"Return the authenticated user and token-selected org, if any.\n\nSame JWT shape as /api/auth/me — accessible from the CLI via the\nBearer access_token issued by /oauth/token. Used both as `codag\nwhoami` and as the post-login validation step in `codag setup`.","operationId":"whoami_endpoint_v1_whoami_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhoamiResponse"}}}}}}},"/api/billing/state":{"get":{"tags":["billing"],"summary":"Get Billing State","description":"Snapshot of plan + current-period usage for the dashboard.","operationId":"get_billing_state_api_billing_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStateResponse"}}}}}}},"/api/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout","operationId":"create_checkout_api_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/monthly-switch-portal":{"post":{"tags":["billing"],"summary":"Monthly Switch Portal","description":"Apply a monthly offer to an existing Team subscription.\n\nTrialing legacy deals switch and invoice immediately. Active annual Team\nsubscribers confirm the exact price change in Stripe's hosted portal.","operationId":"monthly_switch_portal_api_billing_monthly_switch_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlySwitchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlySwitchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal","operationId":"create_portal_api_billing_portal_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}}}}},"/api/billing/webhooks/stripe":{"post":{"tags":["billing"],"summary":"Stripe Webhook","operationId":"stripe_webhook_api_billing_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Api Billing Webhooks Stripe Post"}}}}}}},"/v1/auth/status":{"get":{"tags":["agent-cost"],"summary":"Auth Status","description":"Validate the configured workspace credential without conflating it\nwith a paid/trial entitlement.\n\nThis endpoint contains no customer content and remains available after a\ntrial expires so the CLI can explain \"auth valid, optimization inactive\"\ninstead of incorrectly reporting an authentication failure.","operationId":"auth_status_v1_auth_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthStatusResponse"}}}}}}},"/v1/actions/self-test":{"post":{"tags":["agent-cost"],"summary":"Action Self Test","description":"Run one fixed, unbilled request through the production reducer.\n\nThe fixture is server-owned, contains no customer data, and never writes a\nusage or reduction row. It proves that the workspace entitlement and\nconfigured reducer can produce a smaller evidence-preserving response.","operationId":"action_self_test_v1_actions_self_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelfTestResponse"}}}}}}},"/v1/actions/reduce":{"post":{"tags":["agent-cost"],"summary":"Reduce Action","description":"Reduce one eligible tool result without retaining its content.","operationId":"reduce_action_v1_actions_reduce_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionEnvelope"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metrics/batch":{"post":{"tags":["agent-cost"],"summary":"Record Metrics","operationId":"record_metrics_v1_metrics_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsBatch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"integer"},"type":"object","title":"Response Record Metrics V1 Metrics Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage/summary":{"get":{"tags":["agent-cost"],"summary":"Usage Summary","operationId":"usage_summary_v1_usage_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Usage Summary V1 Usage Summary Get"}}}}}}},"/v1/usage/timeseries":{"get":{"tags":["agent-cost"],"summary":"Usage Timeseries","operationId":"usage_timeseries_v1_usage_timeseries_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage Timeseries V1 Usage Timeseries Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage/breakdown":{"get":{"tags":["agent-cost"],"summary":"Usage Breakdown","operationId":"usage_breakdown_v1_usage_breakdown_get","parameters":[{"name":"dimension","in":"query","required":false,"schema":{"enum":["action","provider","model","harness","member"],"type":"string","default":"action","title":"Dimension"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage Breakdown V1 Usage Breakdown Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage/reliability":{"get":{"tags":["agent-cost"],"summary":"Usage Reliability","operationId":"usage_reliability_v1_usage_reliability_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Usage Reliability V1 Usage Reliability Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/trials/report":{"get":{"tags":["agent-cost"],"summary":"Trial Report","operationId":"trial_report_v1_trials_report_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Trial Report V1 Trials Report Get"}}}}}}},"/v1/model-prices":{"get":{"tags":["agent-cost"],"summary":"Model Prices","operationId":"model_prices_v1_model_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Model Prices V1 Model Prices Get"}}}}}}},"/v1/service/status":{"get":{"tags":["agent-cost"],"summary":"Service Status","operationId":"service_status_v1_service_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Service Status V1 Service Status Get"}}}}}}},"/v1/workspace/policy":{"get":{"tags":["agent-cost"],"summary":"Get Workspace Policy","operationId":"get_workspace_policy_v1_workspace_policy_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePolicy"}}}}}},"put":{"tags":["agent-cost"],"summary":"Set Workspace Policy","operationId":"set_workspace_policy_v1_workspace_policy_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePolicyWrite"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePolicy"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/notifications/run":{"post":{"summary":"Internal Notifications Run","description":"Secret-gated trigger for the email engine (spike alerts + weekly digest).\nWire a daily cron to POST here with `X-Cron-Secret`. `dry_run` defaults True\n(computes and returns what it *would* send, emails nobody).","operationId":"internal_notifications_run_internal_notifications_run_post","parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"all","title":"Kind"}},{"name":"dry_run","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Dry Run"}},{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Internal Notifications Run Internal Notifications Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/training-pairs/export":{"get":{"summary":"Export Training Pairs","description":"Secret-gated JSONL export of the frontier distillation corpus\n(`frontier_training_pairs`). A scheduled job snapshots this to the\n`codag-training-data` Modal volume so the LoRA v4 corpus is not captive\nto the prod database. Cursor via `since_id`; rows are append-only.","operationId":"export_training_pairs_internal_training_pairs_export_get","parameters":[{"name":"since_id","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Since Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/install.sh":{"get":{"summary":"Install Script Redirect","description":"Count install-script starts, then redirect to the current installer.","operationId":"install_script_redirect_install_sh_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/anonymous/token":{"post":{"summary":"Anonymous Token Endpoint","description":"Mint a server-side anonymous token for free hosted compact calls.","operationId":"anonymous_token_endpoint_v1_anonymous_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnonymousTokenResponse"}}}}}}},"/v1/parse":{"post":{"summary":"Parse Endpoint","operationId":"parse_endpoint_v1_parse_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/v1/capsule":{"post":{"summary":"Capsule Endpoint","operationId":"capsule_endpoint_v1_capsule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapsuleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapsuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"deprecated":true}},"/v1/compact":{"post":{"summary":"Compact Endpoint","operationId":"compact_endpoint_v1_compact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapsuleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/compact/jobs":{"post":{"summary":"Compact Job Create Endpoint","operationId":"compact_job_create_endpoint_v1_compact_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapsuleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompactJobCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/compact/jobs/{job_id}":{"get":{"summary":"Compact Job Get Endpoint","operationId":"compact_job_get_endpoint_v1_compact_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompactJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/incident-memory/search":{"post":{"summary":"Incident Memory Search Endpoint","operationId":"incident_memory_search_endpoint_v1_incident_memory_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentMemorySearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentMemorySearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/incident-memory/{incident_id}":{"get":{"summary":"Incident Memory Detail Endpoint","operationId":"incident_memory_detail_endpoint_v1_incident_memory__incident_id__get","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentMemoryGraphResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Incident Memory Delete Endpoint","operationId":"incident_memory_delete_endpoint_v1_incident_memory__incident_id__delete","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Incident Memory Delete Endpoint V1 Incident Memory  Incident Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/incident-memory/{incident_id}/raw":{"get":{"summary":"Incident Memory Raw Endpoint","operationId":"incident_memory_raw_endpoint_v1_incident_memory__incident_id__raw_get","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentRawLogsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/free/compact":{"post":{"summary":"Free Compact Endpoint","description":"Anonymous free hosted compression backed by private codag-drain.\n\nThis endpoint intentionally avoids the request-scoped DB middleware path.\nIt validates/touches the anonymous token with one short checkout, performs\ndrain work without holding a connection, then records metadata/archive rows\nin a background task with a separate checkout.","operationId":"free_compact_endpoint_v1_free_compact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapsuleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/onboard/warm":{"post":{"summary":"Warm Endpoint","description":"Bulk pre-warm template_cache from historical user logs.\n\nReuses pipeline.parse() so persistence (template_cache + incident_families)\nhappens through the same ON CONFLICT DO UPDATE path as live /v1/compact\ncalls. Idempotent across re-runs. Daily per-org line quota guards against\nrunaway LLM cost on a misconfigured client.","operationId":"warm_endpoint_v1_onboard_warm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WarmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActionEnvelope":{"properties":{"id":{"type":"string","maxLength":256,"minLength":1,"title":"Id"},"session_id":{"type":"string","maxLength":256,"title":"Session Id","default":""},"harness":{"type":"string","maxLength":128,"title":"Harness","default":""},"provider":{"type":"string","maxLength":128,"title":"Provider","default":""},"model":{"type":"string","maxLength":256,"title":"Model","default":""},"kind":{"type":"string","enum":["unknown","log","test_build_lint","search","file_list","document_read","agent_handoff","query","verbatim"],"title":"Kind"},"tool":{"$ref":"#/components/schemas/ToolCall"},"result":{"type":"string","maxLength":33554432,"title":"Result"},"task":{"type":"string","maxLength":32768,"title":"Task","default":""},"intent":{"type":"string","maxLength":8192,"title":"Intent","default":""},"retrieval_handle":{"type":"string","maxLength":256,"title":"Retrieval Handle","default":""},"client_version":{"type":"string","maxLength":128,"title":"Client Version","default":""}},"additionalProperties":false,"type":"object","required":["id","kind","tool","result"],"title":"ActionEnvelope"},"ActionResponse":{"properties":{"action_id":{"type":"string","title":"Action Id"},"kind":{"type":"string","enum":["unknown","log","test_build_lint","search","file_list","document_read","agent_handoff","query","verbatim"],"title":"Kind"},"decision":{"type":"string","enum":["passthrough","reduced"],"title":"Decision"},"content":{"type":"string","title":"Content","default":""},"reason":{"type":"string","title":"Reason","default":""},"selectors":{"items":{"$ref":"#/components/schemas/Selector"},"type":"array","maxItems":64,"title":"Selectors"},"usage":{"$ref":"#/components/schemas/ActionUsage"}},"additionalProperties":false,"type":"object","required":["action_id","kind","decision","usage"],"title":"ActionResponse"},"ActionUsage":{"properties":{"bytes_in":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Bytes In"},"bytes_out":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Bytes Out"},"reducer_input_tokens":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Reducer Input Tokens","default":0},"reducer_output_tokens":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Reducer Output Tokens","default":0},"reducer_cost_microusd":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Reducer Cost Microusd","default":0},"elapsed_ms":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Elapsed Ms","default":0}},"additionalProperties":false,"type":"object","required":["bytes_in","bytes_out"],"title":"ActionUsage"},"AnonymousTokenResponse":{"properties":{"token":{"type":"string","title":"Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"}},"type":"object","required":["token"],"title":"AnonymousTokenResponse"},"AuthStatusResponse":{"properties":{"authenticated":{"type":"boolean","title":"Authenticated","default":true},"credential_type":{"type":"string","enum":["oauth","api_key"],"title":"Credential Type"},"org_id":{"type":"string","title":"Org Id"},"org_name":{"type":"string","title":"Org Name"},"plan_tier":{"type":"string","title":"Plan Tier"},"subscription_status":{"type":"string","title":"Subscription Status","default":"none"},"role":{"type":"string","title":"Role","default":""},"trial_active":{"type":"boolean","title":"Trial Active"},"trial_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Ends At"},"optimization_entitled":{"type":"boolean","title":"Optimization Entitled"},"policy":{"$ref":"#/components/schemas/WorkspacePolicy"}},"additionalProperties":false,"type":"object","required":["credential_type","org_id","org_name","plan_tier","trial_active","optimization_entitled","policy"],"title":"AuthStatusResponse"},"BillingStateResponse":{"properties":{"plan_tier":{"type":"string","title":"Plan Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"pro_enabled":{"type":"boolean","title":"Pro Enabled"},"can_manage_billing":{"type":"boolean","title":"Can Manage Billing"},"monthly_price_cents":{"type":"integer","title":"Monthly Price Cents"},"monthly_mb_included":{"type":"integer","title":"Monthly Mb Included"},"overage_per_gb_cents":{"type":"integer","title":"Overage Per Gb Cents"},"used_bytes":{"type":"integer","title":"Used Bytes"},"period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End"},"trial_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Ends At"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End"}},"type":"object","required":["plan_tier","subscription_status","pro_enabled","can_manage_billing","monthly_price_cents","monthly_mb_included","overage_per_gb_cents","used_bytes","period_start","period_end","trial_ends_at","cancel_at_period_end"],"title":"BillingStateResponse"},"Body_device_code_endpoint_oauth_device_code_post":{"properties":{"client_id":{"type":"string","title":"Client Id","default":"codag-cli"},"scope":{"type":"string","title":"Scope","default":""},"anonymous_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anonymous Token"}},"type":"object","title":"Body_device_code_endpoint_oauth_device_code_post"},"Body_token_endpoint_oauth_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"device_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Code"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"client_id":{"type":"string","title":"Client Id","default":"codag-cli"}},"type":"object","required":["grant_type"],"title":"Body_token_endpoint_oauth_token_post"},"CLIConfirmRequest":{"properties":{"user_code":{"type":"string","maxLength":10,"minLength":8,"title":"User Code"},"org_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Org Id"},"org_slug":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Org Slug"}},"type":"object","required":["user_code"],"title":"CLIConfirmRequest"},"CLIConfirmResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"user_code":{"type":"string","title":"User Code"},"org":{"type":"string","title":"Org"}},"type":"object","required":["ok","user_code","org"],"title":"CLIConfirmResponse"},"CapsuleRequest":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/LineRecord"},"type":"array","maxItems":1000000,"title":"Lines"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["lines"],"title":"CapsuleRequest"},"CapsuleResponse":{"properties":{"capsule":{"additionalProperties":true,"type":"object","title":"Capsule"},"stats":{"$ref":"#/components/schemas/ParseStats"}},"type":"object","required":["capsule","stats"],"title":"CapsuleResponse"},"CheckoutRequest":{"properties":{"plan":{"type":"string","pattern":"^(hobby|team|team_annual)$","title":"Plan"},"deal_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Deal Code"}},"type":"object","required":["plan"],"title":"CheckoutRequest"},"CheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"}},"type":"object","required":["checkout_url"],"title":"CheckoutResponse"},"CompactJobCreateResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"poll_url":{"type":"string","title":"Poll Url"}},"type":"object","required":["job_id","status","poll_url"],"title":"CompactJobCreateResponse"},"CompactJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"stats":{"anyOf":[{"$ref":"#/components/schemas/ParseStats"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["job_id","status"],"title":"CompactJobResponse"},"CompactResponse":{"properties":{"text":{"type":"string","title":"Text"},"stats":{"$ref":"#/components/schemas/ParseStats"},"compact_engine":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compact Engine"},"compact_fallback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compact Fallback"},"compact_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compact Error"}},"type":"object","required":["text","stats"],"title":"CompactResponse"},"ConsoleSessionRequest":{"properties":{"org_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Org Id"},"org_slug":{"anyOf":[{"type":"string","maxLength":64,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}],"title":"Org Slug"}},"type":"object","title":"ConsoleSessionRequest"},"ConsoleSessionResponse":{"properties":{"token":{"type":"string","title":"Token"},"org_id":{"type":"string","title":"Org Id"},"org_slug":{"type":"string","title":"Org Slug"},"expires_at":{"type":"integer","title":"Expires At"}},"type":"object","required":["token","org_id","org_slug","expires_at"],"title":"ConsoleSessionResponse"},"CreateActivationCodeRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Label"},"kind":{"type":"string","pattern":"^(trial|team_monthly_checkout|enterprise_contract|team_annual_deal)$","title":"Kind","default":"trial"},"trial_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Trial Days","default":14},"max_redemptions":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Redemptions","default":1},"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days","default":7},"code":{"anyOf":[{"type":"string","maxLength":64,"minLength":3,"pattern":"^[A-Za-z0-9_-]+$"},{"type":"null"}],"title":"Code"}},"type":"object","title":"CreateActivationCodeRequest"},"CreateInviteRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","pattern":"^(admin|member)$","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"CreateInviteRequest"},"CreateKeyRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"CreateKeyRequest"},"CreateOrgRequest":{"properties":{"slug":{"type":"string","maxLength":64,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*$","title":"Slug"},"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"}},"type":"object","required":["slug","name"],"title":"CreateOrgRequest"},"GoogleAuthRequest":{"properties":{"code":{"type":"string","title":"Code"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"org_invite_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Invite Token"}},"type":"object","required":["code","redirect_uri"],"title":"GoogleAuthRequest"},"GoogleAuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"user":{"$ref":"#/components/schemas/UserOut"},"orgs":{"items":{"$ref":"#/components/schemas/OrgOut"},"type":"array","title":"Orgs"},"is_global_admin":{"type":"boolean","title":"Is Global Admin"},"accepted_invite":{"type":"boolean","title":"Accepted Invite","default":false}},"type":"object","required":["access_token","user","orgs","is_global_admin"],"title":"GoogleAuthResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"model":{"type":"string","title":"Model"},"cache_size":{"type":"integer","title":"Cache Size"}},"type":"object","required":["status","model","cache_size"],"title":"HealthResponse"},"IncidentMemoryGraphResponse":{"properties":{"incident":{"$ref":"#/components/schemas/IncidentMemorySummary"},"capsule":{"additionalProperties":true,"type":"object","title":"Capsule"},"compact_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compact Text"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["incident","capsule"],"title":"IncidentMemoryGraphResponse"},"IncidentMemorySearchRequest":{"properties":{"q":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Q"},"incident_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Incident Id"},"fingerprint":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Fingerprint"},"family_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Family Id"},"service":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Service"},"source":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Source"},"incident_type":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Incident Type"},"severity":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Severity"},"template_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Template Id"},"role":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Role"},"detected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Detected"},"limit":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Limit","default":20}},"type":"object","title":"IncidentMemorySearchRequest"},"IncidentMemorySearchResponse":{"properties":{"incidents":{"items":{"$ref":"#/components/schemas/IncidentMemorySummary"},"type":"array","title":"Incidents"}},"type":"object","required":["incidents"],"title":"IncidentMemorySearchResponse"},"IncidentMemorySummary":{"properties":{"incident_id":{"type":"string","title":"Incident Id"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"},"family_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Family Id"},"fingerprint":{"type":"string","title":"Fingerprint"},"detected":{"type":"boolean","title":"Detected"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"service":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"start_ts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Ts"},"end_ts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Ts"},"line_count_in":{"type":"integer","title":"Line Count In","default":0},"token_count_in":{"type":"integer","title":"Token Count In","default":0},"token_count_out":{"type":"integer","title":"Token Count Out","default":0},"compression_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Compression Ratio"},"created_at":{"title":"Created At"},"affected_services":{"items":{"type":"string"},"type":"array","title":"Affected Services"},"root_cause_hypotheses":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Root Cause Hypotheses"},"evidence_preview":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Evidence Preview"}},"type":"object","required":["incident_id","fingerprint","detected"],"title":"IncidentMemorySummary"},"IncidentRawLogsResponse":{"properties":{"incident_id":{"type":"string","title":"Incident Id"},"available":{"type":"boolean","title":"Available","default":false},"lines":{"items":{"type":"string"},"type":"array","title":"Lines"},"line_count":{"type":"integer","title":"Line Count","default":0},"truncated":{"type":"boolean","title":"Truncated","default":false}},"type":"object","required":["incident_id"],"title":"IncidentRawLogsResponse","description":"Exact original input lines for an incident (admin on-demand viewer)."},"LineRecord":{"properties":{"line_id":{"type":"integer","title":"Line Id"},"message":{"type":"string","maxLength":262144,"title":"Message"},"level":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Level"},"timestamp":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Timestamp"},"service":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Service"}},"type":"object","required":["line_id","message"],"title":"LineRecord","description":"One log record with metadata for capsule construction."},"MeResponse":{"properties":{"user":{"$ref":"#/components/schemas/UserOut"},"orgs":{"items":{"$ref":"#/components/schemas/OrgOut"},"type":"array","title":"Orgs"},"is_global_admin":{"type":"boolean","title":"Is Global Admin"}},"type":"object","required":["user","orgs","is_global_admin"],"title":"MeResponse"},"MetricEvent":{"properties":{"id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.:@+~-]*$","title":"Id"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"session_id":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_.:@+~-]*$","title":"Session Id","default":""},"install_id":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_.:@+~-]*$","title":"Install Id","default":""},"harness":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_.:+-]*$","title":"Harness","default":""},"provider":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_.:+-]*$","title":"Provider","default":""},"model":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_.:+-]*$","title":"Model","default":""},"action_kind":{"type":"string","enum":["unknown","log","test_build_lint","search","file_list","document_read","agent_handoff","query","verbatim"],"title":"Action Kind"},"decision":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.:+-]*$","title":"Decision"},"reason":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_.:+-]*$","title":"Reason","default":""},"original_bytes":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Original Bytes","default":0},"replacement_bytes":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Replacement Bytes","default":0},"provider_input_tokens":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Provider Input Tokens","default":0},"provider_output_tokens":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Provider Output Tokens","default":0},"provider_cache_read_tokens":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Provider Cache Read Tokens","default":0},"provider_cache_write_tokens":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Provider Cache Write Tokens","default":0},"estimated_cost_microusd":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Estimated Cost Microusd","default":0},"reducer_cost_microusd":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Reducer Cost Microusd","default":0},"elapsed_ms":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Elapsed Ms","default":0},"turn_count":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Turn Count","default":0},"retry_count":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Retry Count","default":0},"reread_count":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Reread Count","default":0},"retrieval_count":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Retrieval Count","default":0},"client_version":{"type":"string","maxLength":128,"pattern":"^[A-Za-z0-9_.:+-]*$","title":"Client Version","default":""}},"additionalProperties":false,"type":"object","required":["id","occurred_at","action_kind","decision"],"title":"MetricEvent","description":"Contentless, deduplicated event accepted from the local proxy."},"MetricsBatch":{"properties":{"events":{"items":{"$ref":"#/components/schemas/MetricEvent"},"type":"array","maxItems":1000,"minItems":1,"title":"Events"}},"additionalProperties":false,"type":"object","required":["events"],"title":"MetricsBatch"},"MonthlySwitchRequest":{"properties":{"deal_code":{"type":"string","maxLength":64,"minLength":1,"title":"Deal Code"}},"type":"object","required":["deal_code"],"title":"MonthlySwitchRequest"},"MonthlySwitchResponse":{"properties":{"status":{"type":"string","title":"Status"},"portal_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal Url"}},"type":"object","required":["status"],"title":"MonthlySwitchResponse"},"OrgOut":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","required":["id","slug","name"],"title":"OrgOut"},"ParseRequest":{"properties":{"lines":{"items":{"type":"string","maxLength":262144},"type":"array","maxItems":1000000,"title":"Lines","description":"Raw log lines to template."},"service":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Service","description":"Service name the lines come from (e.g. 'payments-api'). Used for per-service breakdowns."},"source":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Source","description":"Origin tag for the batch (e.g. 'vercel', 'datadog'). Free-form."}},"type":"object","required":["lines"],"title":"ParseRequest"},"ParseResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/TemplateOut"},"type":"array","title":"Templates"},"parsed":{"items":{"$ref":"#/components/schemas/ParsedLineOut"},"type":"array","title":"Parsed"},"stats":{"$ref":"#/components/schemas/ParseStats"}},"type":"object","required":["templates","parsed","stats"],"title":"ParseResponse"},"ParseStats":{"properties":{"llm_calls":{"type":"integer","title":"Llm Calls"},"cache_hits":{"type":"integer","title":"Cache Hits"},"unmatched":{"type":"integer","title":"Unmatched"},"elapsed_ms":{"type":"integer","title":"Elapsed Ms"},"incident_family_hits":{"type":"integer","title":"Incident Family Hits","default":0},"incident_induced_templates":{"type":"integer","title":"Incident Induced Templates","default":0},"global_cache_hits":{"type":"integer","title":"Global Cache Hits","default":0},"global_shadow_hits":{"type":"integer","title":"Global Shadow Hits","default":0},"global_shadow_agreements":{"type":"integer","title":"Global Shadow Agreements","default":0},"global_shadow_disagreements":{"type":"integer","title":"Global Shadow Disagreements","default":0},"total_patterns":{"type":"integer","title":"Total Patterns","default":0},"candidate_patterns":{"type":"integer","title":"Candidate Patterns","default":0},"dropped_patterns":{"type":"integer","title":"Dropped Patterns","default":0},"cache_pattern_hits":{"type":"integer","title":"Cache Pattern Hits","default":0},"global_cache_pattern_hits":{"type":"integer","title":"Global Cache Pattern Hits","default":0}},"type":"object","required":["llm_calls","cache_hits","unmatched","elapsed_ms"],"title":"ParseStats"},"ParsedLineOut":{"properties":{"line":{"type":"string","title":"Line"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"raw_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Template"},"cache_hit":{"type":"boolean","title":"Cache Hit","default":false}},"type":"object","required":["line"],"title":"ParsedLineOut"},"PortalResponse":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"type":"object","required":["portal_url"],"title":"PortalResponse"},"RedeemActivationRequest":{"properties":{"org_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"}},"type":"object","title":"RedeemActivationRequest"},"Selector":{"properties":{"id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.:-]+$","title":"Id"},"label":{"type":"string","maxLength":512,"title":"Label","default":""},"type":{"type":"string","enum":["lines","json_path","group"],"title":"Type"},"start":{"type":"integer","minimum":0.0,"title":"Start","default":0},"end":{"type":"integer","minimum":0.0,"title":"End","default":0},"json_path":{"type":"string","maxLength":1024,"title":"Json Path","default":""},"group":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_.:/+~-]*$","title":"Group","default":""}},"additionalProperties":false,"type":"object","required":["id","type"],"title":"Selector"},"SelfServeCreateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Name"},"slug":{"anyOf":[{"type":"string","maxLength":48,"minLength":2,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},{"type":"null"}],"title":"Slug"}},"type":"object","title":"SelfServeCreateRequest","description":"Optional body for `POST /api/orgs/self-serve`.\n\nWorkspace-email signup (alice@acme.com) can omit the body — the server\ntitle-cases the domain label. Consumer-email signup (michael@gmail.com)\nis rejected (`name_required`) without an explicit body, so the user is\nforced to pick a real name + slug instead of getting \"Gmail\" inflicted\non them. `name` and `slug` must be provided together when given."},"SelfTestResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"reducer_model":{"type":"string","title":"Reducer Model"},"decision":{"type":"string","enum":["passthrough","reduced"],"title":"Decision"},"input_bytes":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Input Bytes"},"output_bytes":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Output Bytes"},"selector_count":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Selector Count"},"elapsed_ms":{"type":"integer","maximum":9.223372036854776e+18,"minimum":0.0,"title":"Elapsed Ms"}},"additionalProperties":false,"type":"object","required":["ok","reducer_model","decision","input_bytes","output_bytes","selector_count","elapsed_ms"],"title":"SelfTestResponse"},"TemplateOut":{"properties":{"template_id":{"type":"string","title":"Template Id"},"raw_template":{"type":"string","title":"Raw Template"}},"type":"object","required":["template_id","raw_template"],"title":"TemplateOut"},"ToolCall":{"properties":{"id":{"type":"string","maxLength":256,"title":"Id","default":""},"name":{"type":"string","maxLength":512,"minLength":1,"title":"Name"},"arguments":{"title":"Arguments"}},"additionalProperties":false,"type":"object","required":["name"],"title":"ToolCall"},"UpdateOrgRequest":{"properties":{"slug":{"anyOf":[{"type":"string","maxLength":64,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*$"},{"type":"null"}],"title":"Slug"},"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Name"},"alerts_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Alerts Enabled"}},"type":"object","title":"UpdateOrgRequest"},"UpdateProfileRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Name"}},"type":"object","title":"UpdateProfileRequest"},"UserOut":{"properties":{"id":{"type":"integer","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["id","email"],"title":"UserOut"},"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"},"WarmRequest":{"properties":{"lines":{"items":{"type":"string","maxLength":262144},"type":"array","maxItems":1000000,"title":"Lines","description":"Raw log lines to template + persist."},"source":{"type":"string","maxLength":256,"title":"Source","description":"Origin tag (vercel, datadog, etc.)","default":"unknown"}},"type":"object","required":["lines"],"title":"WarmRequest","description":"Bulk pre-warm request: ingest historical log lines and persist their\ntemplates to the org's `template_cache` so subsequent /v1/compact calls\nhit the regex cache instead of cold-starting the LLM templater.\n\n`source` is a free-form tag (e.g. \"vercel\", \"datadog\") echoed back in\nthe response and used in server logs for attribution. No semantic\nbehavior is keyed off it."},"WarmResponse":{"properties":{"source":{"type":"string","title":"Source"},"templates_added":{"type":"integer","title":"Templates Added"},"templates_total":{"type":"integer","title":"Templates Total"},"lines_processed":{"type":"integer","title":"Lines Processed"},"llm_calls":{"type":"integer","title":"Llm Calls"},"cache_hits":{"type":"integer","title":"Cache Hits"},"elapsed_ms":{"type":"integer","title":"Elapsed Ms"},"quota_remaining":{"type":"integer","title":"Quota Remaining"}},"type":"object","required":["source","templates_added","templates_total","lines_processed","llm_calls","cache_hits","elapsed_ms","quota_remaining"],"title":"WarmResponse"},"WhoamiResponse":{"properties":{"user_id":{"type":"integer","title":"User Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"org_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"},"org_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Name"},"org_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Slug"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"}},"type":"object","required":["user_id","email"],"title":"WhoamiResponse"},"WorkspacePolicy":{"properties":{"mode":{"type":"string","enum":["disabled","audit","optimize"],"title":"Mode"},"pinned_client_version":{"type":"string","maxLength":128,"title":"Pinned Client Version","default":""},"enabled_actions":{"items":{"type":"string","enum":["unknown","log","test_build_lint","search","file_list","document_read","agent_handoff","query","verbatim"]},"type":"array","maxItems":16,"title":"Enabled Actions"},"required_metrics":{"type":"boolean","title":"Required Metrics","default":true}},"additionalProperties":false,"type":"object","required":["mode"],"title":"WorkspacePolicy"},"WorkspacePolicyWrite":{"properties":{"mode":{"type":"string","enum":["disabled","audit","optimize"],"title":"Mode"},"pinned_client_version":{"type":"string","maxLength":128,"title":"Pinned Client Version","default":""},"enabled_actions":{"items":{"type":"string","enum":["unknown","log","test_build_lint","search","file_list","document_read","agent_handoff","query","verbatim"]},"type":"array","maxItems":16,"title":"Enabled Actions"},"required_metrics":{"type":"boolean","title":"Required Metrics","default":true}},"additionalProperties":false,"type":"object","required":["mode"],"title":"WorkspacePolicyWrite"}}}}