{"openapi":"3.1.0","info":{"title":"Autark API","description":"Smarter AI. One API.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Public liveness probe — intentionally minimal.\n\nReturns only an overall status plus coarse db/redis reachability so\nuptime monitors keep working. It deliberately does NOT expose the\nenvironment, provider reachability/latency, or circuit-breaker internals,\nwhich reveal infrastructure topology to unauthenticated callers. Detailed\ndiagnostics live behind the authenticated admin surface\n(/admin/routing -> circuit_breakers, provider health).","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/models":{"get":{"tags":["models"],"summary":"List Models","description":"Return the available Autark modes as OpenAI-compatible model entries.\n\nCapability fields are best-effort: `contract_context_length` returns None\nwhen the routing tables have not loaded yet (startup window), in which case\nthe field is omitted and the client keeps its own default rather than being\nhanded a wrong number.","operationId":"list_models_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/chat/completions":{"post":{"tags":["chat"],"summary":"Chat Completions","description":"OpenAI-compatible chat completions endpoint.\n\nRuns the full Autark pipeline:\n1. Credit balance gate (atomic, prevents race)\n2. Classify + optimize the prompt\n3. Route to the best provider tier\n4. Forward with fallback cascade\n5. Meter + deduct credits from balance\n6. Return the response (echoing user's mode choice)","operationId":"chat_completions_v1_chat_completions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys":{"get":{"tags":["keys"],"summary":"List Keys","description":"List API keys for the authenticated user.","operationId":"list_keys_v1_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["keys"],"summary":"Create Key","description":"Create a new API key for the authenticated user. Raw key returned once.","operationId":"create_key_v1_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/keys/{key_id}":{"delete":{"tags":["keys"],"summary":"Revoke Key","description":"Revoke an API key. Only the key's owner can revoke it.","operationId":"revoke_key_v1_keys__key_id__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["keys"],"summary":"Update Key","description":"Update an API key's name or spend cap.","operationId":"update_key_v1_keys__key_id__patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateKeyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me":{"get":{"tags":["me"],"summary":"Get Me","description":"Validate the current API key and return user info + own usage stats.\n\nThis is the endpoint Autark Work and the dashboard overview call to confirm\nthe API key is valid and to fetch the AUTHENTICATED user's identity,\nbalance, and current-month usage. Everything is scoped to auth.user_id, so\nit never exposes another tenant's data (unlike the admin /users route the\ndashboard previously used).","operationId":"get_me_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["me"],"summary":"Update Me","description":"Update the authenticated user's own profile.\n\nScoped to auth.user_id, so a caller can only ever edit their own row. Only\nthe fields present in the request are touched.","operationId":"update_me_v1_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/gateways":{"get":{"tags":["gateways"],"summary":"List Gateways","description":"List all gateways for the authenticated user.","operationId":"list_gateways_v1_gateways_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["gateways"],"summary":"Create Gateway","description":"Create a new gateway for the authenticated user.","operationId":"create_gateway_v1_gateways_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGatewayRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/gateways/{gateway_id}":{"get":{"tags":["gateways"],"summary":"Get Gateway","description":"Get a single gateway by ID. Must belong to the authenticated user.","operationId":"get_gateway_v1_gateways__gateway_id__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["gateways"],"summary":"Delete Gateway","description":"Soft-delete a gateway (sets is_active=False).","operationId":"delete_gateway_v1_gateways__gateway_id__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["gateways"],"summary":"Update Gateway","description":"Update a gateway's mode, spend cap, or name.","operationId":"update_gateway_v1_gateways__gateway_id__patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGatewayRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/deposits/address":{"get":{"tags":["deposits"],"summary":"Get Deposit Address","description":"Return this caller's USDC deposit address, allocating it on first call.\n\nThe address is stable: it is derived from the master seed and this user's\nindex, so it does not change between calls.","operationId":"get_deposit_address_v1_deposits_address_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/register":{"post":{"tags":["auth"],"summary":"Register User","description":"Register a new user or return existing user.\n\nCreates a user record and generates an API key.\nIf the email already exists, returns the existing user\nwithout a new API key (idempotent).\n\nThis endpoint is public — no API key required.","operationId":"register_user_v1_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/register":{"post":{"tags":["agents"],"summary":"Register Agent","description":"Create an agent account. Public, no auth, no email required.\n\nReturns an API key (once — it is not stored in plaintext) and a USDC deposit\naddress. The account starts at zero balance and cannot spend until funded.","operationId":"register_agent_v1_agents_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/claim/{token}":{"get":{"tags":["agents"],"summary":"Claim Status","description":"Preview a claim link. Public: the token is the only thing needed.\n\nReturns enough for the page to say \"you are claiming the account for\n<agent name>, balance $X\" before the human commits. Never returns the API\nkey: the token proves you were given a link, not that you own the account.","operationId":"claim_status_v1_agents_claim__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/claim":{"post":{"tags":["agents"],"summary":"Claim Account","description":"Transfer an agent-created account to the human behind a verified Google identity.\n\nThe claim page runs the Google sign-in and passes the resulting access token.\nThis endpoint verifies that token with Google and derives the email and\nsubject from Google's answer. It never trusts an email from the request body:\na claim URL is a bearer secret that gets sent through chat, so possession of\nthe link must not be enough to take the account.","operationId":"claim_account_v1_agents_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__agent_claim__ClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/agents/guide":{"get":{"tags":["agents"],"summary":"Agent Guide","description":"The full agent lifecycle guide. Public, no auth, markdown.","operationId":"agent_guide_v1_agents_guide_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/invite/verify":{"post":{"tags":["invite"],"summary":"Verify Invite","description":"Check an invite code. 200 when valid, 403 otherwise.\n\nRate-limited because this endpoint is public and unauthenticated, but the\nbudget is deliberately generous. Two reasons:\n\n1. The dashboard calls this SERVER-SIDE, so every end user arrives from the\n   same source IP. A tight per-IP bucket is therefore one global budget: at\n   10/min the 11th signup in a minute is refused with a CORRECT code, and\n   ~10 requests/min from anyone denies the invite step to every user. That\n   is a self-inflicted outage, not a defence.\n2. The secret is 32 chars of token_urlsafe (~192 bits), so online guessing\n   is infeasible with or without a throttle. The throttle is\n   defence-in-depth against scripted abuse, not the thing protecting the\n   code.\n\nSo the limit is high enough that legitimate signup traffic cannot exhaust\nit, while still bounding a scripted flood. A rejection is a 429, never a\n403, so a throttled caller can tell \"slow down\" from \"wrong code\".","operationId":"verify_invite_v1_invite_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyInviteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/routing":{"get":{"tags":["admin"],"summary":"Get Routing Config","operationId":"get_routing_config_admin_routing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/classifier":{"get":{"tags":["admin"],"summary":"Get Classifier Config","operationId":"get_classifier_config_admin_classifier_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["admin"],"summary":"Update Classifier Config","operationId":"update_classifier_config_admin_classifier_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifierConfig"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/bandit/stats":{"get":{"tags":["admin"],"summary":"Bandit Stats","description":"Get bandit learning statistics.\n\nReturns per-provider, per-model posterior means (α/(α+β)),\nobservation counts, and success rates.","operationId":"bandit_stats_admin_bandit_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/routing/health":{"get":{"tags":["admin"],"summary":"Routing Health","description":"Routing observability: the numbers that say whether A-TEM is working.\n\nWorkstream E of routing_accuracy_and_latency_spec.md. Four signals, each of\nwhich was previously computed-and-discarded or not computed at all:\n\n  1. A-TEM staleness — age of the newest COMPLETED sweep that fed the matrix.\n     NOTE: sweeps are NOT meant to run continuously. The matrix is re-swept\n     when new models arrive or new tasks are added — roughly QUARTERLY. So a\n     weeks-old matrix is HEALTHY, not stale. The threshold below is set to\n     catch a genuinely missed quarterly cadence, not a normal gap between\n     sweeps. An alert that fires on healthy state trains people to ignore it.\n\n  2. A-TEM hit rate — share of recent requests whose engine was `atem` vs\n     `bandit`. The single number that says whether the matrix decides\n     anything. Requires usage_logs.engine (added 2026-10-17).\n  3. Latency percentiles — p50/p95 of request latency and classifier latency.\n  4. Classifier fallback — the per-process counters (also at /classifier/health).\n\nAlertable fields: `atem.stale`, `classifier.degraded`, `hit_rate_24h.atem`.","operationId":"routing_health_admin_routing_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/classifier/health":{"get":{"tags":["admin"],"summary":"Classifier Health Stats","description":"Classifier fallback counters.\n\nThe classifier degrades silently — on any failure the request falls back to\nkeyword matching, losing the domain/sub_type that A-TEM routing keys on.\n`fallback_rate` above ~0.01 means routing quality is quietly dropping;\n`subtype_truncated` above 0 means SUB_TYPE_MAX_TOKENS is too small.\nCounters are per-process and reset on restart.","operationId":"classifier_health_stats_admin_classifier_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/docs/bandit":{"get":{"tags":["admin"],"summary":"Bandit Memo","description":"Serve the internal bandit memo as plain text.\n\nThis is the living document for how model selection works.\nRead it before making routing changes.","operationId":"bandit_memo_admin_docs_bandit_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/admin/sub-type-overrides":{"get":{"tags":["admin"],"summary":"Get Sub Type Overrides","description":"Return all per-sub-type overrides grouped by model, plus the model\ncatalogue (with global defaults) and the canonical sub-type list.","operationId":"get_sub_type_overrides_admin_sub_type_overrides_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["admin"],"summary":"Upsert Sub Type Override","description":"Upsert a single (model, sub_type) override. NULL fields = use the\nmodel's global default. Refreshes the router's in-memory cache.","operationId":"upsert_sub_type_override_admin_sub_type_overrides_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubTypeOverrideUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist":{"get":{"tags":["admin"],"summary":"List Waitlist Signups","description":"All waitlist signups from the marketing site, newest first.\n\nEach row carries its invite lifecycle state: when the invite went out, how\nmany days ago that was, and whether the account behind it shows any sign of\nreal use. Once an account is used it is a real user tracked in the Users\nview; this table's job is to show whether the invite worked.\n\n`has_used` is True when the account shows evidence of real use — the SAME\ncriterion the DELETE guard applies, built from the ONE shared definition in\n`_evidence_of_use`: any `usage_logs`, any `api_keys`, any `gateways`, or any\nreal-money credit (a `credit_transactions` row carrying a `stripe_session_id`\n— Stripe checkout or the Solana USDC path). Sharing the definition is what\nstops the table offering a Delete the server would refuse.\n\nIt is deliberately NOT derived from `last_login_at`, which only the legacy\n/v1/oauth/google/callback stamps — never the login path real customers take\n— so it read False for every real, heavily-used account. `last_login_at` is\nstill returned as raw data.","operationId":"list_waitlist_signups_admin_waitlist_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/contact":{"get":{"tags":["admin"],"summary":"List Contact Inquiries","description":"All contact-form inquiries from the marketing site, newest first.","operationId":"list_contact_inquiries_admin_contact_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"Get Users","operationId":"get_users_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/credits":{"post":{"tags":["admin"],"summary":"Assign Credits","description":"Assign credits to a user by email. Returns new balance.","operationId":"assign_credits_admin_credits_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditAssignment"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/usage":{"get":{"tags":["admin"],"summary":"Admin Usage","description":"Admin view of all usage logs across all users.","operationId":"admin_usage_admin_usage_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/live-feed":{"get":{"tags":["admin"],"summary":"Live Feed","description":"Recent requests with classifier output and routing decisions.","operationId":"live_feed_admin_live_feed_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/password-status":{"get":{"tags":["admin"],"summary":"Password Status","operationId":"password_status_admin_password_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/password":{"post":{"tags":["admin"],"summary":"Update Password","description":"Rotate a shared password env var.\n\nDEPRECATED, and the write is now disabled by default.\n\nWHY IT IS NO LONGER WRITABLE\n----------------------------\nTwo problems, one of which is a real bypass:\n\n1. The current-password check was `if current and body.current_password !=\n   current`. An EMPTY `current` (the env var unset) skipped the check\n   entirely, so a caller could set the password without knowing the old one.\n   Demonstrated 2026-11-27 against the live server: POST with\n   current_password=\"\" returned {\"status\":\"ok\"} and rewrote the value in\n   /opt/autark/dashboard/.env.production.\n\n2. It writes a production secret file from an HTTP request. Even with a\n   correct check, an endpoint whose job is rewriting /opt/autark/... is a\n   large blast radius for a small convenience. Rotating a secret belongs in\n   a deploy or a shell, not a POST.\n\nThe shared-password model itself is retired: Google is the only auth method\nfor the users UI (dashboard/src/auth.ts), and the Credentials provider was\nremoved because one shared password let anyone who knew any user's email\nbecome that user. So there is nothing here worth keeping writable.\n\nSet AUTARK_ALLOW_PASSWORD_ROTATION=true to re-enable the write for a\ndeliberate, supervised rotation. It is off unless someone asks for it.","operationId":"update_password_admin_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist/{waitlist_id}/invite":{"post":{"tags":["admin"],"summary":"Invite Waitlist Signup","description":"Turn a waitlist signup into a funded account and send the welcome email.\n\nORDER IS DELIBERATE: credits are granted BEFORE the email is sent. If the\nemail fails, the customer has an account with credit and simply never heard\nabout it, which is recoverable by re-sending. Reversed, a failed grant would\nsend a welcome email promising credit that is not there.\n\nThe email is NOT in the same transaction as the grant: it is a network call\nto a third party and must not hold a DB transaction open. The grant commits\nfirst, then the email is attempted, then the row is marked. A failed email\nmarks the row \"email_failed\" (account and credit are already committed and\nstay), which the admin can tell apart from a row that was never invited.","operationId":"invite_waitlist_signup_admin_waitlist__waitlist_id__invite_post","parameters":[{"name":"waitlist_id","in":"path","required":true,"schema":{"type":"string","title":"Waitlist Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistInviteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist/{waitlist_id}":{"delete":{"tags":["admin"],"summary":"Delete Waitlist Signup","description":"Delete an invite that was never used, with its account and credit.\n\nREFUSES once the account shows ANY evidence of real use (409). At that point\nit is a real user and the invite list is the wrong place to make that\ndecision — it is managed from the Users view. The UI disables the button\ntoo, but the server is the authority: a disabled button is a hint, not a\ncontrol.\n\nTHE GUARD IS EVIDENCE OF USE, NOT LOGIN TRACKING. The account is refused if\nit has any `usage_logs`, any `api_keys`, any `gateways`, or any real-money\ncredit (a `credit_transactions` row with a `stripe_session_id` — Stripe\ncheckout or the Solana USDC path) — all read under the row lock below.\n  * This criterion is defined ONCE, in `_evidence_of_use_checks`, and shared\n    with the list endpoint's `has_used` flag, so the two can never drift into\n    the \"the UI offers a Delete the server refuses\" failure.\n  * The PAID-CREDIT check exists because this delete cascades away the whole\n    credit ledger: an account whose ONLY activity is a real-money purchase,\n    with no key, gateway or request, would otherwise be deletable and its\n    purchased credits destroyed. The discriminator is `stripe_session_id IS\n    NOT NULL`, NOT `type='purchase'` — `add_credits_atomic` writes\n    type=\"purchase\" for the INVITE GRANT too, so a type filter would refuse\n    the one case this feature must delete (a never-used invite whose grant is\n    withdrawn). Only a real payment sets `stripe_session_id`.\n  * This replaced a guard built on `last_login_at` / `google_id`. BOTH\n    columns are written ONLY by the legacy /v1/oauth/google/callback in\n    app/api/oauth.py, which is NOT the login path real customers take\n    (NextAuth -> dashboard proxy -> AuthMiddleware._resolve_or_create_user,\n    which stamps neither column). Every real account therefore read as\n    never-activated and was deletable — in production, every user has\n    `google_id IS NULL`, including accounts with tens of thousands of\n    usage_logs. The old guard protected nothing.\n  * These signals already exist and are already correct. They do NOT depend\n    on any login path, so a future change to how people sign in cannot break\n    the guard again.\n  * They are also safe in the other direction: the invite flow itself\n    creates NO ApiKey, NO Gateway, NO usage, and its credit grant carries NO\n    `stripe_session_id`, so a genuinely untouched invite has none of them and\n    still deletes.\n\nThe direction is deliberately FAIL-SAFE: the guard can only ever refuse too\nmuch, never delete too much. A false refusal is an annoyance; a false delete\ndestroys a real account and its credit ledger.\n\nLocking: the user row is read with FOR UPDATE so a concurrent request cannot\ncommit inside the check-and-delete window (the classic TOCTOU). The whole\nhandler runs in one `async with session.begin()` transaction, so the lock is\nheld until this transaction ends; a write that commits first is observed by\nthe check, and one that arrives after the lock is taken blocks until the row\nis already gone. The waitlist row is locked too, so a concurrent re-invite\ncannot re-point `user_id` at a different account between our read of it and\nour delete.\n\nEMAIL ASSUMPTION: this deletes whatever user `signup.user_id` names. The\nnormal flow sets that pointer from this row's own `signup.email` (see\ninvite_waitlist_signup -> _find_or_create_user), so it names the account for\nthis email. We deliberately do NOT re-check `signup.email == user.email`: a\nlegitimate duplicate-email case (a later invite re-pointing the row) would\nbreak, and the residual risk — a stale pointer to a DIFFERENT account that\nshows no use — is bounded by the fact that only an unused account can be\ndeleted here.\n\nHard delete, deliberately. The account was never used, so there is no real\nhistory to preserve and the credit grant is withdrawn along with it. This is\nthe one place in the system where credit_transactions rows are destroyed\nrather than compensated, which is exactly why it is restricted to accounts\nwith no evidence of use.\n\nORDER MATTERS: waitlist_signups.user_id is a NO ACTION foreign key (verified\nagainst the live database), so the waitlist row must be deleted BEFORE the\nuser. Deleting the user first raises ForeignKeyViolation. Both happen in one\ntransaction so a failure leaves neither half applied.","operationId":"delete_waitlist_signup_admin_waitlist__waitlist_id__delete","parameters":[{"name":"waitlist_id","in":"path","required":true,"schema":{"type":"string","title":"Waitlist Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/quality/rounds":{"get":{"tags":["admin"],"summary":"List Quality Rounds","description":"List all quality evaluation rounds.","operationId":"list_quality_rounds_admin_quality_rounds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/quality/rounds/{round_id}":{"get":{"tags":["admin"],"summary":"Get Quality Round","description":"Get a single round with all runs and summary.","operationId":"get_quality_round_admin_quality_rounds__round_id__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/quality/run":{"post":{"tags":["admin"],"summary":"Trigger Quality Run","description":"Trigger a new quality evaluation run (runs in background subprocess).","operationId":"trigger_quality_run_admin_quality_run_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/quality/rounds/{round_id}/prompts/{prompt_id}":{"get":{"tags":["admin"],"summary":"Get Prompt Comparison","description":"Get full responses for a specific prompt within a round — for the drill-down view.","operationId":"get_prompt_comparison_admin_quality_rounds__round_id__prompts__prompt_id__get","parameters":[{"name":"prompt_id","in":"path","required":true,"schema":{"type":"integer","title":"Prompt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/quality/models":{"get":{"tags":["admin"],"summary":"List Eval Models","description":"List configured comparison models.","operationId":"list_eval_models_admin_quality_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["admin"],"summary":"Add Eval Model","description":"Add a comparison model for quality evals.","operationId":"add_eval_model_admin_quality_models_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddEvalModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/quality/models/{model_id}":{"delete":{"tags":["admin"],"summary":"Remove Eval Model","description":"Deactivate a comparison model.","operationId":"remove_eval_model_admin_quality_models__model_id__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/quality/leaderboard":{"get":{"tags":["admin"],"summary":"Quality Leaderboard","description":"Compute best model per task type from quality evaluation data.","operationId":"quality_leaderboard_admin_quality_leaderboard_get","parameters":[{"name":"round_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Round Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/quality/leaderboard/apply":{"post":{"tags":["admin"],"summary":"Apply Leaderboard","description":"Save current leaderboard winners to DB and refresh routing.","operationId":"apply_leaderboard_admin_quality_leaderboard_apply_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/sweep":{"post":{"tags":["admin"],"summary":"Trigger Eval Sweep","description":"Run a model evaluation sweep. Optionally filter to specific models.","operationId":"trigger_eval_sweep_admin_eval_sweep_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SweepRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/status":{"get":{"tags":["admin"],"summary":"Eval Status","description":"Get the latest eval sweep results (most recent sweep_id).","operationId":"eval_status_admin_eval_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/sweeps":{"get":{"tags":["admin"],"summary":"List Sweeps","description":"List all sweep IDs with timestamps, task counts, avg scores, and duration.","operationId":"list_sweeps_admin_eval_sweeps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/matrix":{"get":{"tags":["admin"],"summary":"Eval Matrix","description":"Return per-task × per-model scores (model matrix view).\n\nIf sweep_id is omitted, uses the latest sweep.","operationId":"eval_matrix_admin_eval_matrix_get","parameters":[{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/prompts":{"get":{"tags":["admin"],"summary":"Get Eval Prompts","description":"Get all eval prompts (task_class → list of prompt strings).","operationId":"get_eval_prompts_admin_eval_prompts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["admin"],"summary":"Update Eval Prompts","description":"Replace all eval prompts. Persists to JSON file.","operationId":"update_eval_prompts_admin_eval_prompts_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalPromptsUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/prompts/{task_class}":{"put":{"tags":["admin"],"summary":"Update Eval Prompt Task","description":"Update prompts for a single task class.","operationId":"update_eval_prompt_task_admin_eval_prompts__task_class__put","parameters":[{"name":"task_class","in":"path","required":true,"schema":{"type":"string","title":"Task Class"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalPromptsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/draco":{"post":{"tags":["admin"],"summary":"Trigger Draco Sweep","description":"Run a DRACO benchmark evaluation sweep.","operationId":"trigger_draco_sweep_admin_eval_draco_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DracoSweepRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem":{"post":{"tags":["admin"],"summary":"Trigger Atem Sweep","description":"Queue an A-TEM knowledge-worker evaluation sweep.\n\nThe sweep runs in the `worker` container, NOT here. It used to be\n`asyncio.create_task(run_atem_sweep(...))`, which lived in this process's\nevent loop — so every `docker compose restart api` killed the in-flight\nsweep. Measured: 5 of the first 12 errored sweeps died exactly this way, and\na sweep takes ~2 hours.\n\nThis endpoint now inserts a `queued` row and returns immediately. Poll\nGET /admin/eval/sweeps (or watch the dashboard) for progress.\n\nROUTING-GRADE PREFLIGHT. Only a `full` sweep with NO model filter writes\n`task_routes` (see `ROUTING_GRADE_TIERS` in app/pipeline/atem_eval.py). Every\nother shape records eval rows and writes nothing, which is correct — a\n2-model field cannot decide a route — but it was previously SILENT: a caller\ncould queue a `full` sweep, get a green \"queued\", and only discover hours\nlater that the leaderboard was untouched. Measured 2026-11-16: `task_routes`\nheld no routing-grade data since 2026-10-26 because every sweep in between\nwas either a lower tier or an explicitly filtered benchmark.\n\nSo the response now states, at queue time, whether this sweep will write\nroutes — and `require_routing_grade=True` turns a silent no-op into a 400.","operationId":"trigger_atem_sweep_admin_eval_atem_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AtemSweepRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/scorecards":{"get":{"tags":["admin"],"summary":"List Scorecards","description":"List per-model score cards (human-readable eval memos), best first.","operationId":"list_scorecards_admin_eval_scorecards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/scorecards/{model_name}":{"get":{"tags":["admin"],"summary":"Get Scorecard","description":"Get one model's score card. `?md=true` includes a markdown memo.","operationId":"get_scorecard_admin_eval_scorecards__model_name__get","parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"md","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Md"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/status":{"get":{"tags":["admin"],"summary":"Get Atem Sweep Status","description":"Live status of the most recent A-TEM sweep.\n\nReturns the latest sweep row (running/completed/errored) so the dashboard can\npoll for progress, see completion, and surface silent crashes. Includes\nelapsed time and a naive ETA based on the current eval rate.","operationId":"get_atem_sweep_status_admin_eval_atem_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/atem/matrix":{"get":{"tags":["admin"],"summary":"Get Atem Matrix","description":"Get the A-TEM routing matrix (domain × tier → best model).","operationId":"get_atem_matrix_admin_eval_atem_matrix_get","parameters":[{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/model-summary":{"get":{"tags":["admin"],"summary":"Get Atem Model Summary","description":"Per-model routing tally: how many task cells each model WINS (best score)\nand how many it is BACKUP for (cheapest within the agent substitution margin).\n\nMirrors the live router: winner = ranking[0], backup = _cheapest_within_margin\nunder CONTRACT_MARGIN[\"agent\"]. Counts the sub-type + domain-fallback cells\nthat the router actually resolves.","operationId":"get_atem_model_summary_admin_eval_atem_model_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/atem/ranking":{"get":{"tags":["admin"],"summary":"Get Atem Ranking","description":"Model × cell score matrix + the routing-value aggregate.\n\nTwo lifts are reported:\n  - cell-level (what the router ships): best model per domain:sub_type cell.\n  - task-level (the true ceiling): best model per individual task, the upper\n    bound routing could reach with finer-grained classification.\n\nThe \"oracle gap\" is the whole thesis in one number: if you had to pick ONE\nmodel for every task you get best_single_score; because Autark routes each\ncell to its best model you get `oracle`. gap = oracle - best_single is the\nlift the router buys over any single-model deployment.","operationId":"get_atem_ranking_admin_eval_atem_ranking_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/atem/router-state":{"get":{"tags":["admin"],"summary":"Get Atem Router State","description":"Get the live A-TEM routing state from the router's memory.\n\nCOUNTS ARE NAMED EXPLICITLY (2026-11-04). This endpoint used to return a\nsingle `atem_domains_loaded` field whose name said \"domains\" while three\ndifferent cards quoted it as a \"cell\" count. Measured live, the same table\nwas being described three ways:\n\n    atem_domains_loaded        70   <- len(ATEM_ROUTES): DOMAIN keys\n    len(routes)                70   <- the same dict\n    tier cells (t1+t2)        124   <- 70 tier-1 + 54 tier-2\n    startup log \"N cells\"      49   <- len(ATEM_RANKINGS): also DOMAIN keys\n\n`len()` on the nested dict returns the OUTER key count, so both the endpoint\nand the loader log were reporting domains while calling them cells. Every\nrouting claim for a week was phrased \"X of 70\" or \"X of 124\" against\ndifferent denominators, which is not auditable and is what produced the\n2026-10-30 \"agent routes flipped to DeepSeek\" false alarm.\n\nThe three counts are now separate named fields so a caller never has to\ninfer. No routing behaviour is touched — this is a reporting fix.\n\nNote 70 = 49 rankings + 21 static overrides, with zero overlap: the static\npins are all in domains the sweep does not rank (reasoning, word-puzzle,\nmath, data-analysis, text-transformation). So the 49-vs-70 difference is\ncomposition, not a hole.","operationId":"get_atem_router_state_admin_eval_atem_router_state_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/atem/export":{"get":{"tags":["admin"],"summary":"Export Atem Sweep","description":"Export a full A-TEM sweep as a downloadable CSV or JSON file.\n\nColumns: task_id, domain, sub_type, tier, model_name, score, latency_ms,\ncontent_length, valid, error, plus each judge criterion flattened into its\nown column (tc-0, qp-1, ...). Uses the latest sweep when sweep_id is omitted.","operationId":"export_atem_sweep_admin_eval_atem_export_get","parameters":[{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"csv or json","default":"csv","title":"Format"},"description":"csv or json"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/benchmarks/catalog":{"get":{"tags":["admin"],"summary":"Benchmark Catalog","description":"List available benchmarks (for the 'Run Benchmark' dropdown).","operationId":"benchmark_catalog_admin_benchmarks_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/benchmarks/run":{"post":{"tags":["admin"],"summary":"Trigger Benchmark Run","description":"Kick off a benchmark run in the background and return its run_id.","operationId":"trigger_benchmark_run_admin_benchmarks_run_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BenchmarkRunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/benchmarks/runs":{"get":{"tags":["admin"],"summary":"List Benchmark Runs","description":"List benchmark runs (most recent first) with headline pass rates.","operationId":"list_benchmark_runs_admin_benchmarks_runs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/benchmarks/livebench-matrix":{"get":{"tags":["admin"],"summary":"Livebench Matrix","description":"Aggregate every completed LiveBench run into a per-(model, subtask) score\nmatrix — the durable \"past tests\" record.\n\nFor each (model, subtask) cell we use the *most recent* run that produced it,\nso re-runs supersede old data instead of being averaged together. Output\npairs each model with its $/1M output price for price/performance analysis.","operationId":"livebench_matrix_admin_benchmarks_livebench_matrix_get","parameters":[{"name":"min_cell_n","in":"query","required":false,"schema":{"type":"integer","description":"Hide cells with fewer than this many tasks","default":5,"title":"Min Cell N"},"description":"Hide cells with fewer than this many tasks"},{"name":"min_model_subtasks","in":"query","required":false,"schema":{"type":"integer","description":"Drop models covering fewer than this many subtasks","default":5,"title":"Min Model Subtasks"},"description":"Drop models covering fewer than this many subtasks"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/benchmarks/runs/{run_id}":{"get":{"tags":["admin"],"summary":"Get Benchmark Run","description":"Full detail for one run: summary + per-task breakdown (incl. responses).","operationId":"get_benchmark_run_admin_benchmarks_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/benchmarks/runs/{run_id}/export":{"get":{"tags":["admin"],"summary":"Export Benchmark Run","description":"Export a benchmark run's per-task results as CSV or JSON.","operationId":"export_benchmark_run_admin_benchmarks_runs__run_id__export_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"csv or json","default":"csv","title":"Format"},"description":"csv or json"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/result/{result_id}":{"get":{"tags":["admin"],"summary":"Get Atem Result","description":"Get a single eval result with full response text + judge verdicts (audit trail).","operationId":"get_atem_result_admin_eval_atem_result__result_id__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/eval/atem/cell-results":{"get":{"tags":["admin"],"summary":"Get Atem Cell Results","description":"List eval results for one matrix cell (domain × tier).\n\nReturns lightweight rows {id, model, score, task} so the dashboard can\nrender a cell's contributing results and drill into any one via\nGET /eval/atem/result/{id}. Uses the latest A-TEM sweep unless sweep_id given.","operationId":"get_atem_cell_results_admin_eval_atem_cell_results_get","parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","description":"Group domain, e.g. 'operations' or 'operations:financial-modeling'","title":"Domain"},"description":"Group domain, e.g. 'operations' or 'operations:financial-modeling'"},{"name":"tier","in":"query","required":true,"schema":{"type":"integer","description":"Tier number, e.g. 1 or 2","title":"Tier"},"description":"Tier number, e.g. 1 or 2"},{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/cell-tasks":{"get":{"tags":["admin"],"summary":"Get Atem Cell Tasks","description":"Task-level drill-down for one sub-type cell.\n\nReturns the individual A-TEM tasks sitting under a sub-type, each with its\nprompt text and the per-model scores from the latest sweep, grouped by tier.\nThis is the data behind the Task Routes tab's \"expand a sub-type to see the\nactual tasks\" view.","operationId":"get_atem_cell_tasks_admin_eval_atem_cell_tasks_get","parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","description":"Sub-type key, e.g. 'marketing:short-copy'","title":"Domain"},"description":"Sub-type key, e.g. 'marketing:short-copy'"},{"name":"tier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tier"}},{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/compare":{"get":{"tags":["admin"],"summary":"Compare Atem Models","description":"Head-to-head comparison of two models on one sub-type × tier.\n\nModels may be passed as eval display names (\"MiniMax M3\") OR router-state\nshort ids (\"minimax-m3\"); both resolve to the eval_results display name.\nPicks the sweep with the most head-to-head tasks for the pair (latest on\nties) unless an explicit sweep_id is provided.","operationId":"compare_atem_models_admin_eval_atem_compare_get","parameters":[{"name":"model_a","in":"query","required":true,"schema":{"type":"string","description":"Model A — display name or router short id","title":"Model A"},"description":"Model A — display name or router short id"},{"name":"model_b","in":"query","required":true,"schema":{"type":"string","description":"Model B — display name or router short id","title":"Model B"},"description":"Model B — display name or router short id"},{"name":"sub_type","in":"query","required":true,"schema":{"type":"string","description":"Sub-type, e.g. 'financial-modeling'","title":"Sub Type"},"description":"Sub-type, e.g. 'financial-modeling'"},{"name":"tier","in":"query","required":true,"schema":{"type":"integer","description":"Tier number (1 or 2)","title":"Tier"},"description":"Tier number (1 or 2)"},{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/compare/suggestions":{"get":{"tags":["admin"],"summary":"Atem Compare Suggestions","description":"Suggest populated head-to-head comparisons (sub_type × tier with the most\nshared tasks for a model pair). Used by the dashboard to recommend comparisons\nwhen the user's selected pair has no data. Models are returned as router short\nids (matching the compare dropdown) plus display labels.","operationId":"atem_compare_suggestions_admin_eval_atem_compare_suggestions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/judge-cost":{"get":{"tags":["admin"],"summary":"Atem Judge Cost","description":"ATEM judge cost, per sweep and per judge model.\n\nWHY THIS ENDPOINT EXISTS: judge calls go DIRECT to the provider via httpx, so\nthey bypass our own API and never reach `usage_logs`. Nothing priced them, so\nATEM spend was invisible to every cost report — including the spend\ninvestigation that surfaced it. This reads the accounting persisted into\n`eval_results.judge_verdicts` by the eval runner.\n\nRows written before 2026-09-30 carry no cost fields (the usage frame was\ndiscarded), so they are reported as `unpriced_cells` rather than as $0 —\n\"not measured\" and \"free\" must not look the same.","operationId":"atem_judge_cost_admin_eval_atem_judge_cost_get","parameters":[{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/eval/atem/panel-analysis":{"get":{"tags":["admin"],"summary":"Atem Panel Analysis","description":"Per-judge behaviour across the panel: generosity, coverage, and pull.\n\nWHY THIS EXISTS: only the AVERAGED score used to be stored, so we could prove\nthe panel disagreed but not which judge drove it. Comparing two independent\n3-judge panels over 138 shared tasks showed they rank the same models\ndifferently (Spearman rho 0.50, 3 of 5 model deltas statistically real), so a\nscore is only meaningful relative to the judges that produced it.\n\nThis reports, per judge model:\n  * `mean_score`   — how generous/harsh it is vs its peers\n  * `coverage_pct` — share of criteria it actually scored (a judge that\n                     skips criteria is not comparable to one that scores all)\n  * `pull`         — mean signed distance from the panel mean. Positive =\n                     systematically generous, negative = systematically harsh.\n                     This is the number that says whether a judge is carrying\n                     the panel or dragging it.\n  * `cost_usd`     — what that judge costs, so pull can be weighed vs price.\n\nCells written before per-judge persistence carry no `judge_scores` and are\nreported as `unattributed_cells`, not silently dropped.","operationId":"atem_panel_analysis_admin_eval_atem_panel_analysis_get","parameters":[{"name":"sweep_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sweep Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/gateways":{"get":{"tags":["admin"],"summary":"Admin List Gateways","description":"List all gateways (admin view — not user-scoped).","operationId":"admin_list_gateways_admin_gateways_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["admin"],"summary":"Admin Create Gateway","description":"Create a gateway (admin). Uses first user in DB as owner.","operationId":"admin_create_gateway_admin_gateways_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/gateways/{gateway_id}":{"get":{"tags":["admin"],"summary":"Admin Get Gateway","description":"Get a single gateway (admin view).","operationId":"admin_get_gateway_admin_gateways__gateway_id__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["admin"],"summary":"Admin Delete Gateway","description":"Soft-delete a gateway (admin).","operationId":"admin_delete_gateway_admin_gateways__gateway_id__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["admin"],"summary":"Admin Update Gateway","description":"Update a gateway (admin).","operationId":"admin_update_gateway_admin_gateways__gateway_id__patch","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/billing/reconcile":{"post":{"tags":["admin"],"summary":"Reconcile Balance Cache","description":"Recompute every user's cached balance_cents from the ledger.\n\nThe credit_transactions ledger is the source of truth; the cached column is\na hot-path optimization (M6). This admin trigger repairs any drift on\ndemand (the same routine also runs on a weekly schedule). Safe to run\nanytime — it only corrects rows whose cache != ledger sum.","operationId":"reconcile_balance_cache_admin_billing_reconcile_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/billing/reconcile-pending":{"post":{"tags":["admin"],"summary":"Reconcile Pending","description":"Re-bill pending dead-letter rows from _bill_request failures (L2).\n\nEach pending row holds the full re-bill payload; this re-runs the\nmeter-and-deduct for each. Idempotent and safe to run anytime. Rows that\nfail MAX_RECONCILE_ATTEMPTS times are marked dead for a human.","operationId":"reconcile_pending_admin_billing_reconcile_pending_post","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/billing/pending":{"get":{"tags":["admin"],"summary":"Pending Bills","description":"Count pending dead-letter bills and list any that are marked dead (L2).","operationId":"pending_bills_admin_billing_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/billing/unit-drift":{"get":{"tags":["admin"],"summary":"Unit Drift","description":"Report users/rows where the cent and millicent columns disagree.\n\nPHASE 2 DIAGNOSTIC for the millicent migration. During dual-write both units\nare written on every path, so `x_millicents` must always equal `x_cents *\n1000`. Any mismatch means a write path was missed — which must be found and\nfixed BEFORE Phase 3 makes the millicent column authoritative, or it becomes\na 1000x billing error.\n\nRead-only. `in_sync: true` is the gate for advancing to Phase 3.","operationId":"unit_drift_admin_billing_unit_drift_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/cost/summary":{"get":{"tags":["admin"],"summary":"Cost Summary","description":"Overall profitability: revenue, estimated costs, margin.\n\nAggregation is pushed into SQL (GROUP BY provider/model/mode) instead of\nloading every usage row into memory. Provider cost is linear in token\ncounts and the rate is constant within a (provider, provider_model) group,\nso summing tokens per group then applying the rate is equivalent.","operationId":"cost_summary_admin_cost_summary_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cost/cashflow":{"get":{"tags":["admin"],"summary":"Cost Cashflow","description":"Actual money movement from the credit ledger.\n\n/cost/summary reports *accrual* revenue (credits consumed by usage_logs).\nThis endpoint reports *cash* movement from credit_transactions: real\ndeposits (type=purchase, e.g. Solana USDC) vs admin-granted credits\n(adjustment), refunds, and credits burned by usage. Amounts are signed in\nthe ledger (positive = added, negative = spent); we surface consumed\ncredits as a positive number for display.","operationId":"cost_cashflow_admin_cost_cashflow_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cost/timeseries":{"get":{"tags":["admin"],"summary":"Cost Timeseries","description":"Daily billed revenue vs estimated provider cost (and margin).\n\nGrouped by (day, provider, provider_model) so the constant per-group rate\ncan be applied to summed tokens, then rolled up per day — same equivalence\nthe summary endpoint relies on.","operationId":"cost_timeseries_admin_cost_timeseries_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cost/user/{user_id}":{"get":{"tags":["admin"],"summary":"Cost User Detail","description":"Deep-dive on a single customer: profitability, deposits, daily trend,\ntop models and mode mix over the period, plus current balance.\n\nPowers the Accounting drill-down so the best (and worst-margin) customers\nare legible at a glance.","operationId":"cost_user_detail_admin_cost_user__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cost/per-user":{"get":{"tags":["admin"],"summary":"Cost Per User","description":"Per-user profitability breakdown.\n\nAggregated in SQL by (user_id, provider, provider_model, mode) rather than\nscanning every usage row in Python.","operationId":"cost_per_user_admin_cost_per_user_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cost/prices":{"get":{"tags":["admin"],"summary":"Get Prices","description":"Current pricing and provider cost rates.","operationId":"get_prices_admin_cost_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["admin"],"summary":"Update Prices","description":"Update a provider or model cost rate.","operationId":"update_prices_admin_cost_prices_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/cost/per-agent":{"get":{"tags":["admin"],"summary":"Cost Per Agent","description":"Aggregate token usage and cost per agent (gateway) over the last N days.\n\nRows with no gateway (NULL gateway_id) are the pre-attribution shared key.","operationId":"cost_per_agent_admin_cost_per_agent_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/usage/by-model":{"get":{"tags":["admin"],"summary":"Usage By Model","operationId":"usage_by_model_admin_usage_by_model_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/vendor/credits":{"get":{"tags":["admin"],"summary":"Vendor Credits","operationId":"vendor_credits_admin_vendor_credits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/users/{user_id}/keys":{"get":{"tags":["admin"],"summary":"List User Keys","description":"Every API key belonging to a user, with this month's spend per key.\n\nAnswers \"which key is burning money / which key do I kill\" without a DB\nsession. Includes revoked keys so the history stays visible.","operationId":"list_user_keys_admin_users__user_id__keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/keys/{key_id}":{"delete":{"tags":["admin"],"summary":"Revoke Key Admin","description":"Revoke any user's API key (soft delete, matching the owner endpoint).","operationId":"revoke_key_admin_admin_keys__key_id__delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["admin"],"summary":"Update Key","description":"Set or clear a key's spend cap, rename it, or revoke/restore it.\n\nAccepts any subset of: name, spend_cap_cents (null clears), spend_cap_is_hard,\nrevoked (bool).","operationId":"update_key_admin_keys__key_id__patch","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/deposits/overview":{"get":{"tags":["admin"],"summary":"Deposits Overview","description":"Wallets, thresholds, and sweep health for the USDC deposit path.","operationId":"deposits_overview_admin_deposits_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/deposits/deposits":{"get":{"tags":["admin"],"summary":"Recent Deposits","description":"Recent USDC deposits, newest first, from the credit ledger.\n\nThe ledger is the source of truth: a deposit that is on-chain but not here\nhas not been credited, and that is exactly the thing worth seeing.","operationId":"recent_deposits_admin_deposits_deposits_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/deposits/addresses":{"get":{"tags":["admin"],"summary":"Deposit Addresses","description":"Per-user deposit addresses with their on-chain USDC and SOL balances.\n\nBounded: only `limit` addresses are queried, and `truncated` says how many\nwere skipped. A page that hangs on 300 RPC calls is worse than one that\nsays what it is showing.","operationId":"deposit_addresses_admin_deposits_addresses_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks":{"get":{"tags":["admin-tasks"],"summary":"List Tasks","description":"List tasks, newest first. `status` accepts several values.","operationId":"list_tasks_admin_tasks_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated statuses","title":"Status"},"description":"Comma-separated statuses"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"stale","in":"query","required":false,"schema":{"type":"boolean","description":"Only open tasks untouched for STALE_AFTER_DAYS","default":false,"title":"Stale"},"description":"Only open tasks untouched for STALE_AFTER_DAYS"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin-tasks"],"summary":"Create Task","description":"Create a task. Used by the UI and by the agent filing ideas mid-conversation.","operationId":"create_task_admin_tasks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks/stats":{"get":{"tags":["admin-tasks"],"summary":"Task Stats","description":"Counts for the filter chips and the stale badge.","operationId":"task_stats_admin_tasks_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/tasks/{task_id}":{"get":{"tags":["admin-tasks"],"summary":"Get Task","operationId":"get_task_admin_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin-tasks"],"summary":"Update Task","operationId":"update_task_admin_tasks__task_id__patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-tasks"],"summary":"Delete Task","description":"Hard delete. Prefer status=dropped, which keeps the decision on record.","operationId":"delete_task_admin_tasks__task_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks/{task_id}/notes":{"get":{"tags":["admin-tasks"],"summary":"List Notes","description":"Notes for a task, oldest first (a log reads forwards).","operationId":"list_notes_admin_tasks__task_id__notes_get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin-tasks"],"summary":"Add Note","description":"Append a note. Bumps the parent task's updated_at — a note is movement,\nso an actively annotated task must not appear in the stale query.","operationId":"add_note_admin_tasks__task_id__notes_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks/{task_id}/notes/{note_id}":{"patch":{"tags":["admin-tasks"],"summary":"Update Note","description":"Edit a note. Drafts get revised; `edited_at` records that it changed.\n\nOnly the body and kind are editable. Author and source are provenance and\nstay as written.","operationId":"update_note_admin_tasks__task_id__notes__note_id__patch","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin-tasks"],"summary":"Delete Note","operationId":"delete_note_admin_tasks__task_id__notes__note_id__delete","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"note_id","in":"path","required":true,"schema":{"type":"string","title":"Note Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tasks/{task_id}/work-on":{"post":{"tags":["admin-tasks"],"summary":"Work On","description":"Return where to open this task and the context to start with.\n\nMarks the task `active` — clicking \"work on this\" is a statement of intent.","operationId":"work_on_admin_tasks__task_id__work_on_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/models":{"get":{"summary":"List Models","description":"List all model configurations.","operationId":"list_models_admin_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Create Model","description":"Add a new model configuration.","operationId":"create_model_admin_models_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelConfigIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/models/{model_id}":{"put":{"summary":"Update Model","description":"Update an existing model configuration.","operationId":"update_model_admin_models__model_id__put","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelConfigIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Model","description":"Delete a model configuration.","operationId":"delete_model_admin_models__model_id__delete","parameters":[{"name":"model_id","in":"path","required":true,"schema":{"type":"string","title":"Model Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/models/test":{"post":{"summary":"Test Model","description":"Send a test prompt to a model and return the response with latency.","operationId":"test_model_admin_models_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/models/seed":{"post":{"summary":"Seed Models","description":"Seed the model configs table with current defaults.","operationId":"seed_models_admin_models_seed_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Authenticate a user with email and password.\n\nReturns user info, their first active API key, and credit balance.","operationId":"login_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/usage":{"get":{"tags":["usage"],"summary":"Get Usage","description":"List usage records for the authenticated user.","operationId":"get_usage_v1_usage_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-05-01","title":"From Date"},"description":"ISO date, e.g. 2026-05-01"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date, e.g. 2026-05-15","title":"To Date"},"description":"ISO date, e.g. 2026-05-15"},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by tier. Accepts the contract names (autark-agent, autark-pro, autark-deep) or the internal mode recorded on historical rows (flash, pro, ultra).","title":"Mode"},"description":"Filter by tier. Accepts the contract names (autark-agent, autark-pro, autark-deep) or the internal mode recorded on historical rows (flash, pro, ultra)."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(success|error|fallback)$"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/daily":{"get":{"tags":["usage"],"summary":"My Daily Usage","description":"Daily token usage for the authenticated user — for charts.","operationId":"my_daily_usage_v1_me_daily_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/me/balance":{"get":{"tags":["usage"],"summary":"My Balance","description":"Current credit balance for the authenticated user.","operationId":"my_balance_v1_me_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/me/transactions":{"get":{"tags":["usage"],"summary":"My Transactions","description":"Credit ledger for the authenticated user, newest first.\n\nThis is what the billing page's transaction history reads. Before it\nexisted the card was hardcoded to \"No transactions yet.\", so a customer who\nhad been granted a welcome credit AND made a USDC deposit still saw an empty\nlist. The ledger had the rows the whole time; nothing exposed them.\n\nReturns the ledger, not a summary: a customer asking \"where did my money go\"\nneeds the individual lines, including the zero-value usage rows, because a\ngap in the sequence is itself the information.\n\n`stripe_session_id` is reused for the on-chain transaction signature on USDC\ndeposits, so it is surfaced as `reference` and the UI can link it to a\nblock explorer. It is null for grants and usage.","operationId":"my_transactions_v1_me_transactions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/upload":{"post":{"tags":["projects"],"summary":"Upload Documents","description":"Upload documents to a project. Converts to markdown and updates the metadata index.","operationId":"upload_documents_v1_projects__project_id__upload_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_documents_v1_projects__project_id__upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UploadResult"},"title":"Response Upload Documents V1 Projects  Project Id  Upload Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/projects/{project_id}/metadata":{"get":{"tags":["projects"],"summary":"Get Project Metadata","description":"Get project metadata including document index.","operationId":"get_project_metadata_v1_projects__project_id__metadata_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectMetadata"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/oauth/google/login":{"get":{"tags":["oauth"],"summary":"Google Login","description":"Redirect to Google consent screen.","operationId":"google_login_v1_oauth_google_login_get","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/oauth/google/callback":{"get":{"tags":["oauth"],"summary":"Google Callback","description":"Handle Google OAuth callback — exchange code, create/link account.","operationId":"google_callback_v1_oauth_google_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","default":"","title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/gmail/inbox":{"get":{"tags":["gmail"],"summary":"List Inbox","operationId":"list_inbox_v1_gmail_inbox_get","parameters":[{"name":"max_results","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Max Results"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/gmail/thread/{thread_id}":{"get":{"tags":["gmail"],"summary":"Get Thread","operationId":"get_thread_v1_gmail_thread__thread_id__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/gmail/draft":{"post":{"tags":["gmail"],"summary":"Create Draft","operationId":"create_draft_v1_gmail_draft_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/gmail/send":{"post":{"tags":["gmail"],"summary":"Send Email","operationId":"send_email_v1_gmail_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/classify":{"post":{"tags":["classify"],"summary":"Classify Emails","description":"Classify a batch of emails using LLM with heuristic fallback.","operationId":"classify_emails_v1_classify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/sync":{"post":{"tags":["email_intelligence"],"summary":"Sync Emails","description":"Fetch new emails since last sync. Stores in SQLite.","operationId":"sync_emails_v1_email_sync_post","parameters":[{"name":"max_results","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":10,"default":50,"title":"Max Results"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/inbox":{"get":{"tags":["email_intelligence"],"summary":"Synced Inbox","description":"Return synced messages from SQLite. Much faster than live Gmail fetch.","operationId":"synced_inbox_v1_email_inbox_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/voice/learn":{"post":{"tags":["email_intelligence"],"summary":"Learn Voice","description":"Kick off the (async) 'Learn my voice' job and return immediately.\n\nLearning ingests 100+ sent emails + a reasoning-model call, which exceeds\nthe web proxy's 30s budget, so we run it in the background and let the client\npoll GET /voice for status.","operationId":"learn_voice_v1_email_voice_learn_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/email/voice":{"get":{"tags":["email_intelligence"],"summary":"Get Voice","description":"Return the user's current voice guide + job status (for polling).","operationId":"get_voice_v1_email_voice_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["email_intelligence"],"summary":"Put Voice","description":"Save the user's edited voice guide.","operationId":"put_voice_v1_email_voice_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/messages/{thread_id}/handled":{"post":{"tags":["email_intelligence"],"summary":"Mark Handled","description":"Mark all messages in a thread as handled so they leave the attention lists.\nIdempotent — safe to call multiple times.","operationId":"mark_handled_v1_email_messages__thread_id__handled_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/recipient-context":{"get":{"tags":["email_intelligence"],"summary":"Recipient Context","description":"Return live recent correspondence with a person + any cached brief/tone.\n\nFast path (3a): `recent` is a live Gmail lookup. `brief`/`tone` come from the\ncached agentic research (3b) if it has been run for this recipient.","operationId":"recipient_context_v1_email_recipient_context_get","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"Recipient email or 'Name <addr>' header","title":"Email"},"description":"Recipient email or 'Name <addr>' header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/recipient-context/research":{"post":{"tags":["email_intelligence"],"summary":"Research Recipient","description":"Kick off the (async) agentic research job for a recipient; poll GET above.","operationId":"research_recipient_v1_email_recipient_context_research_post","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"Recipient email or 'Name <addr>' header","title":"Email"},"description":"Recipient email or 'Name <addr>' header"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/action-items":{"get":{"tags":["email_intelligence"],"summary":"List Action Items","description":"List action items for the user.","operationId":"list_action_items_v1_email_action_items_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"open","title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/email/action-items/{item_id}":{"patch":{"tags":["email_intelligence"],"summary":"Update Action Item","description":"Update action item status.","operationId":"update_action_item_v1_email_action_items__item_id__patch","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionItemUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/onboarding/company-crawl":{"post":{"tags":["onboarding"],"summary":"Company Crawl","description":"Crawl a company website and generate an overview.","operationId":"company_crawl_v1_onboarding_company_crawl_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/onboarding/generate":{"post":{"tags":["onboarding"],"summary":"Generate Profiles","description":"Generate SOUL.md, USER.md, MEMORY.md with company context.","operationId":"generate_profiles_v1_onboarding_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/waitlist":{"post":{"tags":["leads"],"summary":"Submit Waitlist","description":"Persist a waitlist signup. Public — no auth required.","operationId":"submit_waitlist_v1_waitlist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/waitlist/agent":{"post":{"tags":["leads"],"summary":"Submit Agent Waitlist","description":"Register an AI agent on the waitlist. Public — no auth required.\n\nThis is the agent-facing sibling of POST /v1/waitlist. It exists because\nthat endpoint requires an email and an agent cannot produce one.\n\nIt deliberately does NOT mint an API key or grant credit. Recording demand\nis free and reversible; issuing credentials from an unauthenticated\nendpoint is a spend and abuse decision, and a soft launch does not need it.\nWhen instant access is wanted, it layers on here without a schema change.\n\nThe response carries a `claimToken`. An agent that has no identity worth\ntrusting is registered anonymously; the human it works for can attach an\nemail to that row at POST /v1/waitlist/claim, which is what turns an\nanonymous row into something a human can act on.","operationId":"submit_agent_waitlist_v1_waitlist_agent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentWaitlistRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/waitlist/claim":{"post":{"tags":["leads"],"summary":"Claim Agent Waitlist","description":"Attach a human email to an anonymous agent signup. Public.\n\nThis is the conversion step. An agent registers with no identity; the\nperson behind it claims the row, and it becomes an ordinary waitlist\nsignup an admin can invite.\n\nIdempotent on the token: claiming twice with the same email succeeds,\nbecause a retried request is not an error. Claiming an already-claimed\nrow with a DIFFERENT email is refused — that would silently reassign\nsomeone else's signup.","operationId":"claim_agent_waitlist_v1_waitlist_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api__leads__ClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/contact":{"post":{"tags":["leads"],"summary":"Submit Contact","description":"Persist a contact inquiry. Public — no auth required.","operationId":"submit_contact_v1_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/trial":{"post":{"tags":["trial"],"summary":"Create Trial","description":"Issue a trial account: user + $5 credit + API key. One per email.","operationId":"create_trial_v1_trial_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ActionItemUpdate":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"ActionItemUpdate"},"AddEvalModelRequest":{"properties":{"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"api_key":{"type":"string","title":"Api Key"},"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url"}},"type":"object","required":["provider","model","api_key"],"title":"AddEvalModelRequest"},"AgentRegisterRequest":{"properties":{"name":{"type":"string","title":"Name","default":""},"operator":{"type":"string","title":"Operator","default":""},"model":{"type":"string","title":"Model","default":""},"contact_email":{"type":"string","title":"Contact Email","default":""}},"type":"object","title":"AgentRegisterRequest","description":"Everything is optional: an agent with no identity can still register."},"AgentRegisterResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"account_id":{"type":"string","title":"Account Id"},"api_key":{"type":"string","title":"Api Key"},"api_key_id":{"type":"string","title":"Api Key Id"},"deposit_address":{"type":"string","title":"Deposit Address"},"balance_cents":{"type":"integer","title":"Balance Cents"},"claim_url":{"type":"string","title":"Claim Url"},"claim_expires_at":{"type":"string","title":"Claim Expires At"},"next_steps":{"items":{"type":"string"},"type":"array","title":"Next Steps"}},"type":"object","required":["user_id","account_id","api_key","api_key_id","deposit_address","balance_cents","claim_url","claim_expires_at","next_steps"],"title":"AgentRegisterResponse"},"AgentWaitlistRequest":{"properties":{"agentName":{"type":"string","title":"Agentname","default":""},"agentOperator":{"type":"string","title":"Agentoperator","default":""},"agentModel":{"type":"string","title":"Agentmodel","default":""},"aiUseCases":{"items":{"type":"string"},"type":"array","title":"Aiusecases","default":[]},"monthlyTokens":{"type":"string","title":"Monthlytokens","default":""},"source":{"type":"string","title":"Source","default":"agents"}},"type":"object","title":"AgentWaitlistRequest","description":"A machine signup. No email: an agent has no mailbox.\n\nEvery field is optional so a bare `POST {}` succeeds. An agent that\narrives cold from a docs page may know nothing about itself worth\nreporting, and refusing it for that would defeat the purpose."},"AtemSweepRequest":{"properties":{"tier":{"type":"string","title":"Tier","default":"tier1"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"},"include_inactive":{"type":"boolean","title":"Include Inactive","default":false},"model_names":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Model Names"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"cost_tier":{"type":"string","title":"Cost Tier","default":"core"},"require_routing_grade":{"type":"boolean","title":"Require Routing Grade","default":false}},"type":"object","title":"AtemSweepRequest"},"BenchmarkRunRequest":{"properties":{"benchmark":{"type":"string","title":"Benchmark","default":"kwbench"},"task_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Task Limit","default":20},"force_models":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Force Models"},"categories":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Categories"},"grader":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grader"},"use_sandbox":{"type":"boolean","title":"Use Sandbox","default":false},"prompt_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Profile"},"task_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Task Ids"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","title":"BenchmarkRunRequest"},"Body_upload_documents_v1_projects__project_id__upload_post":{"properties":{"project_name":{"type":"string","title":"Project Name","default":"Untitled Project"},"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_upload_documents_v1_projects__project_id__upload_post"},"ChatCompletionRequest":{"properties":{"model":{"type":"string","title":"Model","default":"auto"},"messages":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","title":"Messages"},"stream":{"type":"boolean","title":"Stream","default":false},"max_tokens":{"type":"integer","maximum":131072.0,"minimum":1.0,"title":"Max Tokens","default":8192},"temperature":{"type":"number","maximum":2.0,"minimum":0.0,"title":"Temperature","default":0.7},"top_p":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Top P","default":1.0},"n":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"N","default":1},"stop":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop"},"user":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User"},"tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/Tool"},"type":"array"},{"type":"null"}],"title":"Tools"},"tool_choice":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/ToolChoiceFunction"},{"type":"null"}],"title":"Tool Choice"},"parallel_tool_calls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Parallel Tool Calls"},"response_format":{"anyOf":[{"$ref":"#/components/schemas/ResponseFormat"},{"type":"null"}]}},"type":"object","required":["messages"],"title":"ChatCompletionRequest"},"ClaimResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"account_id":{"type":"string","title":"Account Id"},"email":{"type":"string","title":"Email"},"message":{"type":"string","title":"Message"}},"type":"object","required":["ok","account_id","email","message"],"title":"ClaimResponse"},"ClaimStatusResponse":{"properties":{"claimable":{"type":"boolean","title":"Claimable"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"deposit_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deposit Address"},"balance_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance Cents"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["claimable"],"title":"ClaimStatusResponse","description":"What the claim page shows before the human signs in."},"ClassifierConfig":{"properties":{"model":{"type":"string","title":"Model"},"provider":{"type":"string","title":"Provider"},"system_prompt":{"type":"string","title":"System Prompt"}},"type":"object","required":["model","provider","system_prompt"],"title":"ClassifierConfig"},"ClassifyRequest":{"properties":{"emails":{"items":{"type":"object"},"type":"array","title":"Emails"}},"type":"object","required":["emails"],"title":"ClassifyRequest"},"ContactRequest":{"properties":{"topic":{"type":"string","title":"Topic","default":""},"fullName":{"type":"string","title":"Fullname","default":""},"email":{"type":"string","title":"Email","default":""},"company":{"type":"string","title":"Company","default":""},"message":{"type":"string","title":"Message","default":""}},"type":"object","title":"ContactRequest"},"CrawlRequest":{"properties":{"domain":{"type":"string","title":"Domain"},"email":{"type":"string","title":"Email","default":""}},"type":"object","required":["domain"],"title":"CrawlRequest"},"CreateGatewayRequest":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name","default":"Default Gateway"},"default_mode":{"type":"string","pattern":"^(autark-agent|autark-pro|autark-deep)$","title":"Default Mode","default":"autark-agent"},"spend_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spend Cap Cents"},"spend_cap_is_hard":{"type":"boolean","title":"Spend Cap Is Hard","default":false}},"type":"object","title":"CreateGatewayRequest"},"CreateKeyRequest":{"properties":{"name":{"type":"string","title":"Name","default":"Default"},"spend_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spend Cap Cents"},"spend_cap_is_hard":{"type":"boolean","title":"Spend Cap Is Hard","default":false}},"type":"object","title":"CreateKeyRequest"},"CreditAssignment":{"properties":{"email":{"type":"string","title":"Email"},"amount_cents":{"type":"integer","title":"Amount Cents"},"description":{"type":"string","title":"Description","default":"Admin credit assignment"}},"type":"object","required":["email","amount_cents"],"title":"CreditAssignment"},"DracoSweepRequest":{"properties":{"tier":{"type":"string","title":"Tier","default":"light"},"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"}},"type":"object","title":"DracoSweepRequest"},"DraftRequest":{"properties":{"thread_id":{"type":"string","title":"Thread Id","default":""},"to":{"type":"string","title":"To","default":""},"subject":{"type":"string","title":"Subject","default":""},"body":{"type":"string","title":"Body","default":""},"message_id":{"type":"string","title":"Message Id","default":""}},"type":"object","title":"DraftRequest"},"EvalPromptsUpdate":{"properties":{"prompts":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Prompts"}},"type":"object","required":["prompts"],"title":"EvalPromptsUpdate"},"FunctionDef":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"parameters":{"type":"object","title":"Parameters"}},"type":"object","required":["name"],"title":"FunctionDef"},"GenerateRequest":{"properties":{"name":{"type":"string","title":"Name","default":""},"role":{"type":"string","title":"Role","default":""},"company":{"type":"string","title":"Company","default":""},"domain":{"type":"string","title":"Domain","default":""},"style":{"type":"string","title":"Style","default":""},"help_with":{"type":"string","title":"Help With","default":""},"industry":{"type":"string","title":"Industry","default":""},"tools":{"type":"string","title":"Tools","default":""},"extra":{"type":"string","title":"Extra","default":""}},"type":"object","title":"GenerateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"LoginResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"api_key":{"type":"string","title":"Api Key"},"balance_cents":{"type":"integer","title":"Balance Cents"},"balance_display":{"type":"string","title":"Balance Display"}},"type":"object","required":["user_id","email","api_key","balance_cents","balance_display"],"title":"LoginResponse"},"Message":{"properties":{"role":{"type":"string","title":"Role"},"content":{"anyOf":[{"type":"string"},{"items":{"type":"object"},"type":"array"},{"type":"null"}],"title":"Content"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls"},"tool_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Call Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["role"],"title":"Message"},"ModelConfigIn":{"properties":{"provider":{"type":"string","title":"Provider"},"model_name":{"type":"string","title":"Model Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"tier":{"type":"integer","title":"Tier","default":2},"family":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Family"},"checkpoint":{"type":"string","title":"Checkpoint","default":"base"},"role":{"type":"string","title":"Role","default":"routed"},"context_length":{"type":"integer","title":"Context Length","default":131072},"supports_thinking":{"type":"boolean","title":"Supports Thinking","default":false},"supports_tools":{"type":"boolean","title":"Supports Tools","default":true},"supports_vision":{"type":"boolean","title":"Supports Vision","default":false},"supports_streaming":{"type":"boolean","title":"Supports Streaming","default":true},"temperature":{"type":"number","title":"Temperature","default":0.7},"top_p":{"type":"number","title":"Top P","default":1.0},"top_k":{"type":"integer","title":"Top K","default":0},"max_tokens_default":{"type":"integer","title":"Max Tokens Default","default":16384},"thinking_budget":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Thinking Budget"},"input_price_per_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Input Price Per M"},"cached_price_per_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cached Price Per M"},"output_price_per_m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Output Price Per M"},"priority":{"type":"integer","title":"Priority","default":0},"is_active":{"type":"boolean","title":"Is Active","default":true},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["provider","model_name"],"title":"ModelConfigIn"},"ModelTestRequest":{"properties":{"model_id":{"type":"string","title":"Model Id"},"prompt":{"type":"string","title":"Prompt","default":"Say hello in one sentence."},"max_tokens":{"type":"integer","title":"Max Tokens","default":50}},"type":"object","required":["model_id"],"title":"ModelTestRequest"},"NoteCreate":{"properties":{"body":{"type":"string","maxLength":20000,"minLength":1,"title":"Body"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["body"],"title":"NoteCreate"},"NoteUpdate":{"properties":{"body":{"anyOf":[{"type":"string","maxLength":20000,"minLength":1},{"type":"null"}],"title":"Body"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},"type":"object","title":"NoteUpdate"},"PasswordUpdate":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"},"type":{"type":"string","title":"Type","default":"admin"}},"type":"object","required":["current_password","new_password"],"title":"PasswordUpdate"},"PriceUpdate":{"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rate"},"input_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Input Rate"},"output_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Output Rate"},"cache_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Rate"}},"type":"object","title":"PriceUpdate"},"ProjectMetadata":{"properties":{"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"files":{"items":{"type":"object"},"type":"array","title":"Files"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["project_id","name","files","updated_at"],"title":"ProjectMetadata"},"RegisterRequest":{"properties":{"email":{"type":"string","title":"Email"},"invite_code":{"type":"string","title":"Invite Code","default":""},"name":{"type":"string","title":"Name","default":""},"password":{"type":"string","title":"Password","default":""}},"type":"object","required":["email"],"title":"RegisterRequest"},"RegisterResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"type":"string","title":"Email"},"is_new":{"type":"boolean","title":"Is New"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"}},"type":"object","required":["user_id","email","is_new"],"title":"RegisterResponse"},"ResponseFormat":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"json_schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Json Schema"}},"type":"object","title":"ResponseFormat"},"SubTypeOverrideUpdate":{"properties":{"model_config_id":{"type":"string","title":"Model Config Id"},"sub_type":{"type":"string","title":"Sub Type"},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"thinking_budget":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Thinking Budget"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens"}},"type":"object","required":["model_config_id","sub_type"],"title":"SubTypeOverrideUpdate"},"SweepRequest":{"properties":{"model_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Name"}},"type":"object","title":"SweepRequest"},"TaskCreate":{"properties":{"title":{"type":"string","maxLength":500,"minLength":1,"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"due_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due On"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"source_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Session Id"},"source_message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Message Id"},"source_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Agent"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["title"],"title":"TaskCreate"},"TaskUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"due_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due On"},"snoozed_until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Snoozed Until"}},"type":"object","title":"TaskUpdate"},"Tool":{"properties":{"type":{"type":"string","title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/FunctionDef"}},"type":"object","required":["function"],"title":"Tool"},"ToolCall":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type","default":"function"},"function":{"$ref":"#/components/schemas/ToolCallFunction"}},"type":"object","required":["id","function"],"title":"ToolCall"},"ToolCallFunction":{"properties":{"name":{"type":"string","title":"Name"},"arguments":{"type":"string","title":"Arguments"}},"type":"object","required":["name","arguments"],"title":"ToolCallFunction"},"ToolChoiceFunction":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"ToolChoiceFunction"},"TrialRequest":{"properties":{"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name","default":""},"company":{"type":"string","title":"Company","default":""},"source":{"type":"string","title":"Source","default":"tryitout"}},"type":"object","required":["email"],"title":"TrialRequest"},"UpdateGatewayRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Name"},"default_mode":{"anyOf":[{"type":"string","pattern":"^(autark-agent|autark-pro|autark-deep)$"},{"type":"null"}],"title":"Default Mode"},"spend_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spend Cap Cents"},"spend_cap_is_hard":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Spend Cap Is Hard"}},"type":"object","title":"UpdateGatewayRequest"},"UpdateKeyRequest":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"spend_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Spend Cap Cents"},"spend_cap_is_hard":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Spend Cap Is Hard"}},"type":"object","title":"UpdateKeyRequest"},"UpdateMeRequest":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"},"default_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Mode"}},"type":"object","title":"UpdateMeRequest","description":"Self-serve profile update.\n\nEmail is NOT editable: it is the Google identity the account is keyed on, so\nchanging it here would desynchronise the row from the login.\n\n`default_mode` is the contract used when a request sends model=\"auto\". It is\nvalidated against the LIVE contract surface, so a retired name cannot be\nstored and then 400 the user on every auto request."},"UploadResult":{"properties":{"file_id":{"type":"string","title":"File Id"},"filename":{"type":"string","title":"Filename"},"markdown_path":{"type":"string","title":"Markdown Path"},"summary":{"type":"string","title":"Summary"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"}},"type":"object","required":["file_id","filename","markdown_path","summary"],"title":"UploadResult"},"UsageEntry":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"mode":{"type":"string","title":"Mode"},"tier_used":{"type":"integer","title":"Tier Used"},"provider":{"type":"string","title":"Provider"},"provider_model":{"type":"string","title":"Provider Model"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cost_cents":{"type":"integer","title":"Cost Cents"},"latency_ms":{"type":"integer","title":"Latency Ms"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","created_at","mode","tier_used","provider","provider_model","input_tokens","output_tokens","cost_cents","latency_ms","status"],"title":"UsageEntry"},"UsageResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/UsageEntry"},"type":"array","title":"Data"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["data","total","limit","offset"],"title":"UsageResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyInviteRequest":{"properties":{"code":{"type":"string","title":"Code","default":""}},"type":"object","title":"VerifyInviteRequest"},"VerifyInviteResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"}},"type":"object","required":["valid"],"title":"VerifyInviteResponse"},"VoiceUpdate":{"properties":{"guide":{"type":"string","title":"Guide"}},"type":"object","required":["guide"],"title":"VoiceUpdate"},"WaitlistInviteRequest":{"properties":{"credits_cents":{"type":"integer","title":"Credits Cents","default":500},"description":{"type":"string","title":"Description","default":"Welcome credit"},"dry_run":{"type":"boolean","title":"Dry Run","default":false}},"type":"object","title":"WaitlistInviteRequest","description":"Body for POST /admin/waitlist/{id}/invite.\n\n`credits_cents` is CENTS (real currency), matching add_credits_atomic.\n`dry_run` performs the account creation and the grant but skips the email,\nso the flow is usable and testable before the sending domain verifies."},"WaitlistRequest":{"properties":{"email":{"type":"string","title":"Email"},"companyName":{"type":"string","title":"Companyname","default":""},"contactName":{"type":"string","title":"Contactname","default":""},"industry":{"type":"string","title":"Industry","default":""},"companySize":{"type":"string","title":"Companysize","default":""},"seatCount":{"type":"string","title":"Seatcount","default":""},"monthlyTokens":{"type":"string","title":"Monthlytokens","default":""},"aiUseCases":{"items":{"type":"string"},"type":"array","title":"Aiusecases","default":[]},"source":{"type":"string","title":"Source","default":"landing"}},"type":"object","required":["email"],"title":"WaitlistRequest"},"app__api__agent_claim__ClaimRequest":{"properties":{"claimToken":{"type":"string","title":"Claimtoken"},"googleAccessToken":{"type":"string","title":"Googleaccesstoken"}},"type":"object","required":["claimToken","googleAccessToken"],"title":"ClaimRequest"},"app__api__leads__ClaimRequest":{"properties":{"claimToken":{"type":"string","title":"Claimtoken"},"email":{"type":"string","title":"Email"},"contactName":{"type":"string","title":"Contactname","default":""},"companyName":{"type":"string","title":"Companyname","default":""}},"type":"object","required":["claimToken","email"],"title":"ClaimRequest"}}}}