{"openapi":"3.1.0","info":{"title":"summarize-vid","description":"YouTube video transcript summarizer (Claude Haiku).","version":"0.6.0"},"paths":{"/admin/email":{"get":{"summary":"Dashboard","operationId":"dashboard_admin_email_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"summary":"Draft","operationId":"draft_admin_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/email/{campaign_id}/send":{"post":{"summary":"Send","operationId":"send_admin_email__campaign_id__send_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/email/unsubscribe/{token}":{"get":{"summary":"Unsubscribe Page","operationId":"unsubscribe_page_email_unsubscribe__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Unsubscribe","operationId":"unsubscribe_email_unsubscribe__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/email/preferences":{"get":{"summary":"Preferences","operationId":"preferences_email_preferences_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"locale","in":"query","required":false,"schema":{"enum":["en","es","fr","de","pt","ja"],"type":"string","default":"en","title":"Locale"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Preferences","operationId":"update_preferences_email_preferences_put","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feedback":{"post":{"summary":"Submit","operationId":"submit_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/summarize/quote":{"post":{"tags":["summarize"],"summary":"Quote Summary","description":"Quote known videos without creating work or spending credits.\n\nFor an unseen video, duration and required_credits are null. A submission\ncan authorize a maximum; the worker never exceeds it. Duration is currently\nestimated from the final caption, not verified against the player runtime.","operationId":"quote_summary_summarize_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditQuoteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/summarize":{"post":{"tags":["summarize"],"summary":"Summarize Video","description":"Request a summary using prepaid credits; cached summaries are free.\n\n`max_credits` is the caller's authorized spending ceiling (default 1).\nA known video above that ceiling returns 409 with its required credit cost.\nFor a new video the worker discovers duration. If the cost exceeds the\nreservation it fails with credit_confirmation_required and releases the\ncredits; re-submit with an explicitly confirmed higher limit. No model\ncall runs on that failed attempt. Poll GET /jobs/{job_id} for the result.","operationId":"summarize_video_summarize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/videos/{youtube_video_id}/translations":{"post":{"tags":["videos"],"summary":"Request Translation","description":"Request a translated summary using credits, with the same max_credits\nspending ceiling as POST /summarize. Existing translations are free.\nOmitted language uses the account preference. Poll the returned job id.","operationId":"request_translation_videos__youtube_video_id__translations_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"youtube_video_id","in":"path","required":true,"schema":{"type":"string","title":"Youtube Video Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslationRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trial/summarize":{"post":{"tags":["trial"],"summary":"Trial Summarize","description":"Anonymous trial: one real summary per IP per day via the normal job\npipeline, attributed to `TRIAL_USER_ID`. No auth dependency by design.\n\nChecks run cheapest first: cache hit -> policy -> known-duration cap ->\natomic personal reservation / global capacity / enqueue. Failed jobs free\npersonal allowance; the global daily attempt budget remains bounded.","operationId":"trial_summarize_trial_summarize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialSummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialSummarizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trial/status/{video_id}":{"get":{"tags":["trial"],"summary":"Trial Status","description":"Latest trial-job status for a video, keyed by video id (not job id):\nthe result is public data (it becomes a /v page), so there's no opaque\ntoken to protect, and the frontend never has to hold trial state.\n\nThe `user_id = TRIAL_USER_ID` filter happens in SQL\n(get_latest_job_by_video_for_user), not in Python, so this endpoint is\nstructurally incapable of reflecting any authenticated user's job for\nthe same video id.","operationId":"trial_status_trial_status__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trial/config":{"get":{"tags":["trial"],"summary":"Trial Config","description":"Public limits for the daily anonymous trial.","operationId":"trial_config_trial_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialConfigResponse"}}}}}}},"/languages":{"get":{"tags":["summarize"],"summary":"List Languages","description":"The languages POST /summarize accepts (code + English display name) — the\nuniverse YouTube can caption or auto-translate into. Static and the same for\nevery video, so the frontend fetches this once to build its language picker\nand sends a chosen `code` back as the request's `language`. Public, no auth;\ncached hard since the set rarely changes.","operationId":"list_languages_languages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesResponse"}}}}}}},"/.well-known/x402.json":{"get":{"tags":["agent"],"summary":"X402 Discovery","description":"x402 discovery manifest. Advertises the pay-per-call `/v1` endpoints\n(price, network, USDC asset, receiving address), each marked `discoverable`,\nso agents browsing an x402 directory / the Bazaar can find and pay for them\nautomatically — no human onboarding. Generated from the live payment config,\nso it can't drift from the actual 402 responses. Returns 503 when payments\nare disabled (`X402_PAY_TO` unset), matching the `/v1` routes.","operationId":"x402_discovery__well_known_x402_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/summarize":{"post":{"tags":["agent"],"summary":"Agent Summarize","description":"Summarize a YouTube video and return it inline. Pay-per-call via x402\n(no account/key). Runs synchronously: transcript fetch (if new) + Claude\nHaiku, answered from the shared cache when possible. Payment settles only on\nsuccess — a bad URL, missing captions, or model error returns an error and\nis never charged.","operationId":"agent_summarize_v1_summarize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/transcript":{"post":{"tags":["agent"],"summary":"Agent Transcript","description":"Return a video's raw transcript inline (the cheaper SKU — no model run).\nPay-per-call via x402. The transcript is fetched once and cached, so repeat\ncalls for the same video don't re-hit YouTube. Charged only on success.","operationId":"agent_transcript_v1_transcript_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummarizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTranscriptResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/channel/new":{"post":{"tags":["agent"],"summary":"Agent Channel New","description":"New videos on a YouTube channel since the caller's cursor. Pay-per-call\nvia x402 (no account/key). Stateless: we hold no per-caller watch state —\nthe agent supplies its own cursor (a video id or timestamp) and we answer\nfrom YouTube's public channel feed (`youtube_feed`). No jobs-ledger row (a\npoll has no video to attach one to), but it does write an x402_payments\nrow (see below) so this SKU isn't invisible in Postgres; wallet-level\nreconciliation also logs payer/amount via `_register_reconciliation_hooks`.\nCharged only on success — an unresolvable channel or a malformed cursor is\nnever charged.","operationId":"agent_channel_new_v1_channel_new_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentChannelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentChannelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/json/format":{"post":{"tags":["agent"],"summary":"Agent Json Format","description":"Validate raw JSON and return it pretty-printed or minified. Pay-per-call\nvia x402 (no account/key). No jobs-ledger row — there is no video to attach\none to — but a successful call writes an x402_payments row. Invalid JSON\n(400, with line and column) and an input over 1 MB (413) are never charged.","operationId":"agent_json_format_v1_json_format_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonFormatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonFormatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs":{"get":{"summary":"My History","description":"A page of my job history, newest first (default 50, max 200). For the\nnext page, pass the last row's job_id as `before_id`. A short page (fewer\nthan `limit` rows) means you've reached the end. `summary_excerpt` (first\n300 chars) is always included; the full `summary` text is included by\ndefault (existing clients keep working) — pass `?include_summary=false`\nto omit it and keep the page payload small.","operationId":"my_history_jobs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before Id"}},{"name":"include_summary","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Summary"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HistoryRecord"},"title":"Response My History Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me":{"get":{"tags":["account"],"summary":"Me","description":"Verify the caller's identity. GET /billing/me returns the credit balance.","operationId":"me_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/me/preferences":{"get":{"tags":["account"],"summary":"Get Preferences","description":"The account's saved defaults. `summary_language` is the language\nPOST /summarize writes in when the request omits `language` (null =\nEnglish), shared by every client of this account.","operationId":"get_preferences_me_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["account"],"summary":"Put Preferences","description":"Set the account's default summary language (a code from GET /languages;\nnull clears it back to English). 400 on a malformed code.","operationId":"put_preferences_me_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/jobs/events":{"get":{"summary":"Job Events","description":"Server-Sent Events stream of the caller's job-status transitions, so\nthe frontend can stop polling GET /jobs every 1.5s. Declared ABOVE\nGET /jobs/{job_id} so the literal `events` path segment isn't captured by\n`{job_id}` (which would 422 on int coercion). Push-based: the connection\nsubscribes a per-connection queue that the shared Postgres LISTEN/NOTIFY\nlistener (started in `lifespan`) feeds directly, so transitions arrive as\nsoon as the DB trigger fires rather than on a polling cadence. Emits one\n`snapshot` event on connect, then a `job` event per status transition. A\nslow reconcile pass (`_EVENTS_RECONCILE_SECONDS`) re-checks the DB\nperiodically as a safety net for any notification the listener missed\n(e.g. during a reconnect). Closes the stream once every job seen so far\n(snapshot ∪ pushed events) is terminal, on client disconnect, or after\n`_EVENTS_MAX_SECONDS` — whichever comes first. Never public: this is\nper-user data behind normal header auth (EventSource itself can't set\nheaders, but the browser never calls this endpoint directly — the\nNext.js proxy does).","operationId":"job_events_jobs_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/jobs/{job_id}":{"get":{"summary":"Get Job Status","description":"Poll a single job. Returns 404 if it doesn't exist or belongs to someone else.","operationId":"get_job_status_jobs__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/events":{"post":{"tags":["events"],"summary":"Track Event","description":"First-party funnel analytics. Unauthenticated, on purpose — anonymous\nvisitors are the point, so there's no `get_current_user_id` dependency.\n\nAccepted risk: there is no rate limiting anywhere in this backend, so\nthis endpoint is spammable. Inserts are cheap and the table is\noperator-read-only, so poisoning is an annoyance, not a breach — rate\nlimiting is future backend work, not part of this change.\n\nAlways 204: an unknown/non-allowlisted `name` is silently dropped rather\nthan erroring (a 4xx here would be console noise on every page load), and\na DB failure is logged, not raised, so analytics never surfaces an error\nto a visitor. Malformed JSON bodies still 422 via FastAPI's normal\nrequest validation, which is unchanged.","operationId":"track_event_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackEventRequest"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/events/funnel":{"get":{"tags":["events"],"summary":"Get Funnel","description":"Operator-only aggregate funnel readout by name over a time window.\nAdmin-gated the same way as /queue: ADMIN_USER_IDS via require_admin —\nno separate token/env mechanism needed.\n\nNote the default is \"30d\" here, not None/all-time like the /stats/*\nendpoints — this preserves the feature's original 30-day default lookback.","operationId":"get_funnel_events_funnel_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunnelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/videos/ids":{"get":{"tags":["public-videos"],"summary":"List Video Ids","description":"Enumerate summarized-video ids with last-summarized timestamps, for the\nfrontend sitemap. Public, unauthenticated. Declared ABOVE\n`/videos/{video_id}` — Starlette matches routes in declaration order, so\nthe literal `ids` path segment must be matched here first, otherwise it\nwould be captured by `{video_id}` and auth-gated.","operationId":"list_video_ids_videos_ids_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":1000,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoIdsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/videos/recent":{"get":{"tags":["public-videos"],"summary":"List Recent Videos","description":"Recent summarized videos with titles, for the frontend to build\nhuman-readable link hubs (`/videos/ids` returns bare ids, useless for\nlink text). Public, unauthenticated. `channel` (exact name) backs the\nfrontend's channel pages and same-channel links; `tag` (a summary's\ncategory tag, case-insensitive) backs the library's tag filter. `lang` is the reader's language:\ntitles come from the summary in that language when one exists (else\nEnglish, else YouTube's). Reads never generate translations. Declared ABOVE `/videos/{video_id}`\n— same Starlette route-ordering requirement as `/videos/ids`: the\nliteral `recent` path segment must be matched here first, otherwise it\nwould be captured by `{video_id}` and auth-gated.","operationId":"list_recent_videos_videos_recent_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"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"}},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecentVideosResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/videos/tags":{"get":{"tags":["public-videos"],"summary":"List Video Tags","description":"The most common summary tags in the reader's language (English when\nthat language has none yet), for the frontend's browse-by-tag chips. Each\nlinks to `/videos/recent?tag=`, which matches the tag in any language.\nPublic; cached like the stats. Declared ABOVE `/videos/{video_id}`.","operationId":"list_video_tags_videos_tags_get","parameters":[{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopTagsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/channels/uploads":{"get":{"tags":["public-videos"],"summary":"List Channel Uploads","description":"A known channel's ~15 latest YouTube uploads (its public RSS feed),\neach flagged with the languages we already have a summary in. Backs the\nfrontend's /c/<channel> \"Latest uploads\". Public; never enqueues work.\nOnly channels with at least one video in our DB resolve (404 otherwise),\nso callers can't make us fetch arbitrary channels. The feed is cached\n30 min per channel; summary flags are read fresh every call.","operationId":"list_channel_uploads_channels_uploads_get","parameters":[{"name":"channel","in":"query","required":true,"schema":{"type":"string","title":"Channel"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelUploadsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/videos/{video_id}/summary":{"get":{"tags":["public-videos"],"summary":"Get Public Video Summary Endpoint","description":"Read an available summary without generating work.\n\nPass the reader's preference as `lang` (default English). Prefer that\nlanguage, then English, then the newest available summary. The response\nreports fallback and translation availability, without private job ids.\nPoll this read after requesting a translation; it always reflects the DB.","operationId":"get_public_video_summary_endpoint_videos__video_id__summary_get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicVideoSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/videos/{video_id}/summary":{"get":{"tags":["videos"],"summary":"Get Preferred Video Summary","description":"Read in the account's saved language; an explicit `lang` overrides it.","operationId":"get_preferred_video_summary_me_videos__video_id__summary_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicVideoSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/videos/{video_id}":{"get":{"summary":"Get Video","description":"All summaries (across providers/models) for a given YouTube video ID.\nThis is the global cache view — useful for showing 'others summarized this with…'.","operationId":"get_video_videos__video_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SummaryRecord"},"title":"Response Get Video Videos  Video Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/queue":{"get":{"tags":["queue"],"summary":"Get Queue Status","description":"Global view of all in-flight jobs (pending + running) across users, in\nworker-processing order, each annotated with its queue position, video size\n(transcript length + duration), and an estimated time to completion.\n\nAdmin-only: it exposes every user's submissions (URLs, ids), so it's gated\nbehind the ADMIN_USER_IDS allowlist.","operationId":"get_queue_status_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueueResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/comps":{"get":{"tags":["admin"],"summary":"List Comps","description":"All comp grants, newest first (expired ones included for visibility).","operationId":"list_comps_admin_comps_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CompGrant"},"type":"array","title":"Response List Comps Admin Comps Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["admin"],"summary":"Grant Comp","description":"Grant (or update) comped paid access. Pass an `email` (looked up in the\nfrontend's Better Auth user table — the user must have signed up already)\nor a `user_id` (JWT sub) directly. The grant is a tier floor on top of\nStripe: revoking it (or expiry) reverts the user to their Stripe tier.","operationId":"grant_comp_admin_comps_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompGrantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompGrant"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/comps/{user_id}":{"delete":{"tags":["admin"],"summary":"Revoke Comp","description":"Revoke a comp grant. The user falls back to their Stripe tier.","operationId":"revoke_comp_admin_comps__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"Admin Users","description":"One row per Better Auth signup, with subscription state and lifetime\nusage. Single query (see db.admin_list_users) -- no total-user count is\nreturned, so the frontend pages until it gets a short page back.","operationId":"admin_users_admin_users_get","security":[{"HTTPBearer":[]}],"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":{"$ref":"#/components/schemas/AdminUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/stats":{"get":{"tags":["admin"],"summary":"Admin Users Stats","description":"Tier + lifetime request count for a batch of user ids, one entry per\nrequested id in the order requested -- ids we've never seen come back as\ntier \"free\" / job_count 0 rather than being dropped, so the caller can\ntell \"idle user\" from \"unknown id\" without guessing. Over the cap is a\n400, never a silent truncation.","operationId":"admin_users_stats_admin_users_stats_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","title":"Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/jobs":{"get":{"tags":["admin"],"summary":"Admin User Jobs","description":"Which videos a user requested, newest first. No summary text -- the\nfrontend links to the public /v/<youtube_video_id> page for completed\njobs. An unknown user_id is a 200 with an empty page, not a 404: the\ncaller owns the user list, so a 404 would read as a routing bug.","operationId":"admin_user_jobs_admin_users__user_id__jobs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"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":{"$ref":"#/components/schemas/AdminUserJobsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}":{"get":{"tags":["admin"],"summary":"Admin User Stat","description":"Single-user form of /admin/users/stats, so the detail page makes one\ncall instead of a one-element batch. Same query, same semantics.","operationId":"admin_user_stat_admin_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserStat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/credits":{"post":{"tags":["admin"],"summary":"Admin Grant Credits","description":"Gift credits to a real account. Admin-only via the same ADMIN_USER_IDS\nallowlist as every other /admin route; the ledger row records which admin\ngranted it. Returns the user's refreshed readout.","operationId":"admin_grant_credits_admin_users__user_id__credits_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCreditGrant"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserStat"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/insights":{"get":{"tags":["admin"],"summary":"Admin Insights Route","description":"Languages requested (today/7d/30d/all, fixed buckets), top channels by\nrequests, and credit economics. `window` scopes channels and credits.","operationId":"admin_insights_route_admin_insights_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Window"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminInsightsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/revenue":{"get":{"tags":["admin"],"summary":"Admin Revenue","description":"Revenue snapshot: x402 agent payments per SKU (windowed) plus\nsubscriber counts by status/price (current state, from user_billing --\nno Stripe API call, see db.admin_revenue_summary). Default window is\n\"30d\", matching /events/funnel rather than the /stats/* all-time default.","operationId":"admin_revenue_admin_revenue_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"window","in":"query","required":false,"schema":{"type":"string","default":"30d","title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminRevenueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/jobs":{"get":{"tags":["admin"],"summary":"Admin Jobs","description":"Latest human jobs, newest first: who asked, what, when, the outcome\n(error included) and the requester's current credit balance.","operationId":"admin_jobs_admin_jobs_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","running","complete","failed"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminJobsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/jobs/{job_id}/retry":{"post":{"tags":["admin"],"summary":"Admin Retry","description":"Queue a fresh copy of a failed job for the same user, free of charge.","operationId":"admin_retry_admin_jobs__job_id__retry_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","title":"Job Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobAcceptedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/customers":{"get":{"tags":["admin"],"summary":"Admin Customers Route","description":"Signed-in users who have made a request, most active days first, with\nstreaks (consecutive UTC days with a request) and credit standing.","operationId":"admin_customers_route_admin_customers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/x402/payments":{"get":{"tags":["admin"],"summary":"Admin X402 Payments Endpoint","description":"The per-payment x402 ledger, joined to job/video metadata -- answers\n\"which video did transaction 0x... buy\". Rows with no matching job (the\nchannel SKU) still appear, with null video fields.","operationId":"admin_x402_payments_endpoint_admin_x402_payments_get","security":[{"HTTPBearer":[]}],"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"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminX402PaymentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/x402/wallets":{"get":{"tags":["admin"],"summary":"Admin X402 Wallets","description":"Per-wallet revenue rollup -- which agent wallets paid the most.","operationId":"admin_x402_wallets_admin_x402_wallets_get","security":[{"HTTPBearer":[]}],"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":{"$ref":"#/components/schemas/AdminWalletsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats/overview":{"get":{"tags":["statistics"],"summary":"Stats Overview Endpoint","description":"Aggregate usage counters over the window (default all-time): unique\nvideos, total requests, unique users, and cache-hit rate. Counts completed\njobs only (failures excluded).","operationId":"stats_overview_endpoint_stats_overview_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsOverview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats/top-videos":{"get":{"tags":["statistics"],"summary":"Stats Top Videos Endpoint","description":"Most-requested videos over the window, ranked by request count (with the\ndistinct-user count and display metadata alongside). `lang` is the\nreader's language: titles come from the summary in that language when one\nexists (else English, else YouTube's). Reads never generate translations.","operationId":"stats_top_videos_endpoint_stats_top_videos_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopVideosResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats/activity":{"get":{"tags":["statistics"],"summary":"Stats Activity Endpoint","description":"Completed-request volume over time, bucketed in UTC. bucket='day' gives\na date series; bucket='hour' gives hour-of-day (0-23) totals.","operationId":"stats_activity_endpoint_stats_activity_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window"}},{"name":"bucket","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Bucket"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats/queue":{"get":{"tags":["statistics"],"summary":"Stats Queue Endpoint","description":"Public-safe preview of the live in-flight queue for the /statistics page.\n\nReturns the top `limit` jobs in worker-processing order (running first, then\npending FIFO), each with its position, size, ETA, and display metadata —\nbut **none** of the identifying fields the admin `/queue` exposes (no\nuser_id, raw URL, or job_id). `count` is the full queue length so the UI can\nshow \"+ N more\". Cached ~10s, so it's near-live without hammering Postgres.","operationId":"stats_queue_endpoint_stats_queue_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueuePreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/stats/settlements":{"get":{"tags":["statistics"],"summary":"Stats Settlements Endpoint","description":"Public settlements feed for the frontend `/settlements` page: recent\nsettled x402 payments (sanitized), plus all-time totals and a 30-day\ndaily series. Reads `x402_payments` directly (settled rows only), unlike\nthe job-ledger-derived aggregates above. Cached ~10s, near-live.","operationId":"stats_settlements_endpoint_stats_settlements_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicSettlementsFeed"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["health"],"summary":"Health Check","description":"Liveness + dependency health.\n\nProbes every dependency the API relies on (Postgres, Anthropic key, the\nJWKS endpoint) concurrently and reports each under `deps`. The top-level\n`status` is \"ok\" when all are healthy, else \"degraded\". This always returns\nHTTP 200 (process liveness) — a degraded dependency shouldn't trigger a\ncontainer restart, since jobs simply queue until the dependency recovers.\nStripe is intentionally excluded: it's an external, billing-only dependency.\nResults are cached ~15s in-process.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/billing/packs":{"get":{"summary":"Billing Plans","description":"One-time credit packs. No subscription or automatic renewal.","operationId":"billing_plans_billing_packs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPacksResponse"}}}}}}},"/billing/plans":{"get":{"summary":"Billing Plans","description":"One-time credit packs. No subscription or automatic renewal.","operationId":"billing_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPacksResponse"}}}}},"deprecated":true}},"/billing/checkout":{"post":{"summary":"Billing Checkout","description":"Buy a credit pack with a one-time Stripe Checkout payment.","operationId":"billing_checkout_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/portal":{"post":{"summary":"Billing Portal","description":"Subscriptions have been replaced with one-time credit purchases.","operationId":"billing_portal_billing_portal_post","responses":{"410":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/usage":{"get":{"summary":"Billing Me","description":"Spendable credits and credits currently reserved by unfinished jobs.","operationId":"billing_me_billing_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/me":{"get":{"summary":"Billing Me","description":"Spendable credits and credits currently reserved by unfinished jobs.","operationId":"billing_me_billing_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/billing/launch-notice/ack":{"post":{"summary":"Ack Launch Notice","description":"Dismiss the launch-gift notice for good; it never reappears on any device.","operationId":"ack_launch_notice_billing_launch_notice_ack_post","responses":{"204":{"description":"Successful Response"}},"security":[{"HTTPBearer":[]}]}},"/billing/history":{"get":{"summary":"Billing History","description":"The caller's credit purchases, gifts, reservations, settlements, and refunds.","operationId":"billing_history_billing_history_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"before_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Before Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditLedgerEntry"},"title":"Response Billing History Billing History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/sync-session":{"post":{"summary":"Billing Sync Session","description":"Reconcile the caller's paid checkout; safe alongside concurrent webhooks.","operationId":"billing_sync_session_billing_sync_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"ActivityBucket":{"properties":{"bucket":{"type":"string","title":"Bucket"},"requests":{"type":"integer","title":"Requests"}},"type":"object","required":["bucket","requests"],"title":"ActivityBucket"},"ActivityResponse":{"properties":{"window":{"type":"string","title":"Window"},"bucket":{"type":"string","title":"Bucket"},"series":{"items":{"$ref":"#/components/schemas/ActivityBucket"},"type":"array","title":"Series"}},"type":"object","required":["window","bucket","series"],"title":"ActivityResponse"},"AdminChannelRow":{"properties":{"channel":{"type":"string","title":"Channel"},"videos":{"type":"integer","title":"Videos"},"requests":{"type":"integer","title":"Requests"},"unique_users":{"type":"integer","title":"Unique Users"},"completed":{"type":"integer","title":"Completed"},"last_requested_at":{"type":"string","format":"date-time","title":"Last Requested At"}},"type":"object","required":["channel","videos","requests","unique_users","completed","last_requested_at"],"title":"AdminChannelRow"},"AdminCreditEconomics":{"properties":{"paid_orders":{"type":"integer","title":"Paid Orders"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"orders_started":{"type":"integer","title":"Orders Started"},"sessions_created":{"type":"integer","title":"Sessions Created","default":0},"creation_failed":{"type":"integer","title":"Creation Failed","default":0},"revenue_by_currency":{"items":{"$ref":"#/components/schemas/CreditRevenueCurrency"},"type":"array","title":"Revenue By Currency"},"credits_gifted":{"type":"integer","title":"Credits Gifted"},"credits_spent":{"type":"integer","title":"Credits Spent"},"model_runs":{"type":"integer","title":"Model Runs"}},"type":"object","required":["paid_orders","revenue_cents","orders_started","credits_gifted","credits_spent","model_runs"],"title":"AdminCreditEconomics"},"AdminCreditGrant":{"properties":{"amount":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Amount"},"request_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Request Id"}},"type":"object","required":["amount"],"title":"AdminCreditGrant"},"AdminCustomerRow":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"joined_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Joined At"},"active_days":{"type":"integer","title":"Active Days"},"longest_streak":{"type":"integer","title":"Longest Streak"},"current_streak":{"type":"integer","title":"Current Streak"},"requests":{"type":"integer","title":"Requests"},"completed":{"type":"integer","title":"Completed"},"first_at":{"type":"string","format":"date-time","title":"First At"},"last_at":{"type":"string","format":"date-time","title":"Last At"},"balance":{"type":"integer","title":"Balance"},"purchased":{"type":"integer","title":"Purchased"}},"type":"object","required":["user_id","active_days","longest_streak","current_streak","requests","completed","first_at","last_at","balance","purchased"],"title":"AdminCustomerRow"},"AdminCustomersResponse":{"properties":{"active_users":{"type":"integer","title":"Active Users"},"returning_users":{"type":"integer","title":"Returning Users"},"consecutive_day_users":{"type":"integer","title":"Consecutive Day Users"},"paying_users":{"type":"integer","title":"Paying Users"},"customers":{"items":{"$ref":"#/components/schemas/AdminCustomerRow"},"type":"array","title":"Customers"}},"type":"object","required":["active_users","returning_users","consecutive_day_users","paying_users","customers"],"title":"AdminCustomersResponse"},"AdminInsightsResponse":{"properties":{"window":{"type":"string","title":"Window"},"languages":{"items":{"$ref":"#/components/schemas/AdminLanguageCount"},"type":"array","title":"Languages"},"top_channels":{"items":{"$ref":"#/components/schemas/AdminChannelRow"},"type":"array","title":"Top Channels"},"credits":{"$ref":"#/components/schemas/AdminCreditEconomics"},"trial":{"$ref":"#/components/schemas/AdminTrialStats"}},"type":"object","required":["window","languages","top_channels","credits","trial"],"title":"AdminInsightsResponse"},"AdminJobRow":{"properties":{"job_id":{"type":"integer","title":"Job Id"},"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"youtube_video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Youtube Video Id"},"language_code":{"type":"string","title":"Language Code"},"status":{"type":"string","title":"Status"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"served_from_cache":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Served From Cache"},"credit_charge":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Charge"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"attempts":{"type":"integer","title":"Attempts"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance"},"resolved":{"type":"boolean","title":"Resolved"}},"type":"object","required":["job_id","user_id","language_code","status","attempts","created_at","resolved"],"title":"AdminJobRow"},"AdminJobsResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/AdminJobRow"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"AdminJobsResponse"},"AdminLanguageCount":{"properties":{"language_code":{"type":"string","title":"Language Code"},"today":{"type":"integer","title":"Today"},"last_7d":{"type":"integer","title":"Last 7D"},"last_30d":{"type":"integer","title":"Last 30D"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["language_code","today","last_7d","last_30d","total"],"title":"AdminLanguageCount"},"AdminRevenueResponse":{"properties":{"window":{"type":"string","title":"Window"},"x402":{"items":{"$ref":"#/components/schemas/AdminRevenueSkuBreakdown"},"type":"array","title":"X402"},"subscriptions":{"items":{"$ref":"#/components/schemas/AdminSubscriptionBreakdown"},"type":"array","title":"Subscriptions"},"active_by_tier":{"additionalProperties":{"type":"integer"},"type":"object","title":"Active By Tier"}},"type":"object","required":["window","x402","subscriptions","active_by_tier"],"title":"AdminRevenueResponse"},"AdminRevenueSkuBreakdown":{"properties":{"sku":{"type":"string","title":"Sku"},"payments":{"type":"integer","title":"Payments"},"settled":{"type":"integer","title":"Settled"},"declined":{"type":"integer","title":"Declined"},"errored":{"type":"integer","title":"Errored"},"authorized":{"type":"integer","title":"Authorized"},"total_settled_atomic":{"type":"string","title":"Total Settled Atomic"}},"type":"object","required":["sku","payments","settled","declined","errored","authorized","total_settled_atomic"],"title":"AdminRevenueSkuBreakdown"},"AdminSubscriptionBreakdown":{"properties":{"subscription_status":{"type":"string","title":"Subscription Status"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"plan_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Key"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["subscription_status","count"],"title":"AdminSubscriptionBreakdown"},"AdminTrialStats":{"properties":{"started":{"type":"integer","title":"Started"},"completed_views":{"type":"integer","title":"Completed Views"},"limit_gates":{"type":"integer","title":"Limit Gates"},"jobs":{"type":"integer","title":"Jobs"},"jobs_completed":{"type":"integer","title":"Jobs Completed"},"model_runs":{"type":"integer","title":"Model Runs"},"jobs_failed":{"type":"integer","title":"Jobs Failed"},"too_long":{"type":"integer","title":"Too Long"},"visitors_today":{"type":"integer","title":"Visitors Today"},"visitors_blocked_today":{"type":"integer","title":"Visitors Blocked Today"}},"type":"object","required":["started","completed_views","limit_gates","jobs","jobs_completed","model_runs","jobs_failed","too_long","visitors_today","visitors_blocked_today"],"title":"AdminTrialStats"},"AdminUserJobRow":{"properties":{"language_code":{"type":"string","title":"Language Code"},"job_id":{"type":"integer","title":"Job Id"},"youtube_video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Youtube Video Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"status":{"type":"string","title":"Status"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["language_code","job_id","status","created_at"],"title":"AdminUserJobRow"},"AdminUserJobsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminUserJobRow"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AdminUserJobsResponse"},"AdminUserRow":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"email_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Verified"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancel At Period End"},"comp_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comp Tier"},"metered_jobs":{"type":"integer","title":"Metered Jobs"}},"type":"object","required":["user_id","metered_jobs"],"title":"AdminUserRow"},"AdminUserStat":{"properties":{"user_id":{"type":"string","title":"User Id"},"tier":{"type":"string","title":"Tier"},"job_count":{"type":"integer","title":"Job Count"},"last_job_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Job At"},"credits":{"type":"integer","title":"Credits","default":0}},"type":"object","required":["user_id","tier","job_count"],"title":"AdminUserStat"},"AdminUserStatsResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/AdminUserStat"},"type":"array","title":"Users"}},"type":"object","required":["users"],"title":"AdminUserStatsResponse"},"AdminUsersResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/AdminUserRow"},"type":"array","title":"Users"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["users","limit","offset"],"title":"AdminUsersResponse"},"AdminWalletRow":{"properties":{"payer":{"type":"string","title":"Payer"},"payments":{"type":"integer","title":"Payments"},"settled_count":{"type":"integer","title":"Settled Count"},"total_settled_atomic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Settled Atomic"},"distinct_videos":{"type":"integer","title":"Distinct Videos"},"first_seen":{"type":"string","format":"date-time","title":"First Seen"},"last_seen":{"type":"string","format":"date-time","title":"Last Seen"}},"type":"object","required":["payer","payments","settled_count","distinct_videos","first_seen","last_seen"],"title":"AdminWalletRow"},"AdminWalletsResponse":{"properties":{"wallets":{"items":{"$ref":"#/components/schemas/AdminWalletRow"},"type":"array","title":"Wallets"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["wallets","limit","offset"],"title":"AdminWalletsResponse"},"AdminX402PaymentRow":{"properties":{"id":{"type":"integer","title":"Id"},"nonce":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nonce"},"payer":{"type":"string","title":"Payer"},"pay_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pay To"},"network":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Network"},"asset":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset"},"sku":{"type":"string","title":"Sku"},"surface":{"type":"string","title":"Surface"},"status":{"type":"string","title":"Status"},"amount_authorized_atomic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Authorized Atomic"},"amount_settled_atomic":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Amount Settled Atomic"},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tx Hash"},"error_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Reason"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"job_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Job Id"},"source":{"type":"string","title":"Source"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"youtube_video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Youtube Video Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"served_from_cache":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Served From Cache"}},"type":"object","required":["id","payer","sku","surface","status","source","created_at","updated_at"],"title":"AdminX402PaymentRow"},"AdminX402PaymentsResponse":{"properties":{"payments":{"items":{"$ref":"#/components/schemas/AdminX402PaymentRow"},"type":"array","title":"Payments"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["payments","limit","offset"],"title":"AdminX402PaymentsResponse"},"AgentChannelRequest":{"properties":{"channel":{"type":"string","title":"Channel"},"since_video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since Video Id"},"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"}},"type":"object","required":["channel"],"title":"AgentChannelRequest"},"AgentChannelResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"channel_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Title"},"videos":{"items":{"$ref":"#/components/schemas/ChannelVideo"},"type":"array","title":"Videos"},"newest_video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Newest Video Id"},"cursor_found":{"type":"boolean","title":"Cursor Found"}},"type":"object","required":["channel_id","videos","cursor_found"],"title":"AgentChannelResponse"},"AgentSummaryResponse":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"summary":{"type":"string","title":"Summary"},"model":{"type":"string","title":"Model"},"cached":{"type":"boolean","title":"Cached"},"language_code":{"type":"string","title":"Language Code","default":"en"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["youtube_video_id","summary","model","cached"],"title":"AgentSummaryResponse"},"AgentTranscriptResponse":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"transcript":{"type":"string","title":"Transcript"},"language_code":{"type":"string","title":"Language Code","default":"en"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["youtube_video_id","transcript"],"title":"AgentTranscriptResponse"},"ChannelUpload":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"title":{"type":"string","title":"Title"},"published_at":{"type":"string","format":"date-time","title":"Published At"},"summary_languages":{"items":{"type":"string"},"type":"array","title":"Summary Languages"}},"type":"object","required":["youtube_video_id","title","published_at","summary_languages"],"title":"ChannelUpload"},"ChannelUploadsResponse":{"properties":{"channel":{"type":"string","title":"Channel"},"channel_id":{"type":"string","title":"Channel Id"},"uploads":{"items":{"$ref":"#/components/schemas/ChannelUpload"},"type":"array","title":"Uploads"}},"type":"object","required":["channel","channel_id","uploads"],"title":"ChannelUploadsResponse"},"ChannelVideo":{"properties":{"video_id":{"type":"string","title":"Video Id"},"url":{"type":"string","title":"Url"},"title":{"type":"string","title":"Title"},"published_at":{"type":"string","format":"date-time","title":"Published At"}},"type":"object","required":["video_id","url","title","published_at"],"title":"ChannelVideo"},"CheckoutContinuation":{"properties":{"video_id":{"type":"string","pattern":"^[A-Za-z0-9_-]{11}$","title":"Video Id"},"language":{"type":"string","maxLength":35,"pattern":"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$","title":"Language"},"action":{"type":"string","enum":["summarize","translate"],"title":"Action"}},"type":"object","required":["video_id","language","action"],"title":"CheckoutContinuation"},"CheckoutRequest":{"properties":{"pack":{"type":"string","title":"Pack"},"currency":{"type":"string","enum":["usd","mxn","brl"],"title":"Currency","default":"usd"},"request_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Request Id"},"continuation":{"anyOf":[{"$ref":"#/components/schemas/CheckoutContinuation"},{"type":"null"}]}},"type":"object","required":["pack"],"title":"CheckoutRequest"},"CheckoutResponse":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"CheckoutResponse"},"CompGrant":{"properties":{"user_id":{"type":"string","title":"User Id"},"tier":{"type":"string","title":"Tier"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["user_id","tier","created_at","updated_at"],"title":"CompGrant"},"CompGrantRequest":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"tier":{"type":"string","enum":["pro","max"],"title":"Tier","default":"pro"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","title":"CompGrantRequest"},"ConsentUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"locale":{"type":"string","enum":["en","es","fr","de","pt","ja"],"title":"Locale"},"wording_version":{"type":"string","const":"marketing-v1","title":"Wording Version"},"source":{"type":"string","enum":["account_settings","signup_prompt"],"title":"Source","default":"account_settings"}},"type":"object","required":["enabled","locale","wording_version"],"title":"ConsentUpdate"},"CreditBalanceResponse":{"properties":{"billing_model":{"type":"string","const":"credits","title":"Billing Model","default":"credits"},"balance":{"type":"integer","title":"Balance"},"reserved":{"type":"integer","title":"Reserved"},"launch_notice":{"type":"boolean","title":"Launch Notice","default":false}},"type":"object","required":["balance","reserved"],"title":"CreditBalanceResponse"},"CreditCheckoutResponse":{"properties":{"billing_model":{"type":"string","const":"credits","title":"Billing Model","default":"credits"},"balance":{"type":"integer","title":"Balance"},"reserved":{"type":"integer","title":"Reserved"},"launch_notice":{"type":"boolean","title":"Launch Notice","default":false},"payment_status":{"type":"string","enum":["paid","pending","failed","expired","refunded","unknown"],"title":"Payment Status"}},"type":"object","required":["balance","reserved","payment_status"],"title":"CreditCheckoutResponse"},"CreditLedgerEntry":{"properties":{"id":{"type":"integer","title":"Id"},"kind":{"type":"string","title":"Kind"},"delta":{"type":"integer","title":"Delta"},"reserved_delta":{"type":"integer","title":"Reserved Delta"},"job_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Job Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","delta","reserved_delta","created_at"],"title":"CreditLedgerEntry"},"CreditPackResponse":{"properties":{"key":{"type":"string","title":"Key"},"credits":{"type":"integer","title":"Credits"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["key","credits","amount_cents","currency"],"title":"CreditPackResponse"},"CreditPacksResponse":{"properties":{"billing_model":{"type":"string","const":"credits","title":"Billing Model","default":"credits"},"packs":{"items":{"$ref":"#/components/schemas/CreditPackResponse"},"type":"array","title":"Packs"}},"type":"object","required":["packs"],"title":"CreditPacksResponse"},"CreditQuoteResponse":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"language":{"type":"string","title":"Language"},"cached":{"type":"boolean","title":"Cached"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"required_credits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Required Credits"},"duration_basis":{"type":"string","const":"caption_end","title":"Duration Basis","default":"caption_end"}},"type":"object","required":["youtube_video_id","language","cached"],"title":"CreditQuoteResponse"},"CreditRevenueCurrency":{"properties":{"currency":{"type":"string","title":"Currency"},"paid_orders":{"type":"integer","title":"Paid Orders"},"gross_amount_cents":{"type":"integer","title":"Gross Amount Cents"},"refunded_amount_cents":{"type":"integer","title":"Refunded Amount Cents"},"refund_amount_unknown_orders":{"type":"integer","title":"Refund Amount Unknown Orders"},"net_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Net Amount Cents"}},"type":"object","required":["currency","paid_orders","gross_amount_cents","refunded_amount_cents","refund_amount_unknown_orders","net_amount_cents"],"title":"CreditRevenueCurrency"},"DepStatus":{"properties":{"status":{"type":"string","title":"Status"},"latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Ms"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["status"],"title":"DepStatus"},"Draft":{"properties":{"subject":{"type":"string","maxLength":200,"minLength":1,"title":"Subject"},"body":{"type":"string","maxLength":30000,"minLength":1,"title":"Body"},"user_ids":{"items":{"type":"string"},"type":"array","maxItems":5000,"minItems":1,"title":"User Ids"},"launch_only":{"type":"boolean","title":"Launch Only","default":false}},"type":"object","required":["subject","body","user_ids"],"title":"Draft"},"Feedback":{"properties":{"kind":{"type":"string","enum":["question","problem","feature_request"],"title":"Kind"},"message":{"type":"string","maxLength":4000,"title":"Message","default":""},"heard_from":{"anyOf":[{"type":"string","enum":["search","youtube","social","friend","ai_assistant","other"]},{"type":"null"}],"title":"Heard From"}},"type":"object","required":["kind"],"title":"Feedback"},"FunnelResponse":{"properties":{"window":{"type":"string","title":"Window"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["window","counts"],"title":"FunnelResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"anthropic":{"type":"string","title":"Anthropic"},"deps":{"additionalProperties":{"$ref":"#/components/schemas/DepStatus"},"type":"object","title":"Deps"}},"type":"object","required":["status","anthropic","deps"],"title":"HealthResponse"},"HistoryRecord":{"properties":{"job_id":{"type":"integer","title":"Job Id"},"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"video_url":{"type":"string","title":"Video Url"},"status":{"type":"string","title":"Status"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"summary_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Excerpt"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"prompt_version":{"type":"string","title":"Prompt Version"},"language_code":{"type":"string","title":"Language Code","default":"en"},"served_language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Served Language Code"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["job_id","youtube_video_id","video_url","status","provider","model","prompt_version","created_at"],"title":"HistoryRecord"},"JobAcceptedResponse":{"properties":{"job_id":{"type":"integer","title":"Job Id"},"status":{"type":"string","title":"Status"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"}},"type":"object","required":["job_id","status"],"title":"JobAcceptedResponse"},"JobStatusResponse":{"properties":{"id":{"type":"integer","title":"Id"},"status":{"type":"string","title":"Status"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"video_url":{"type":"string","title":"Video Url"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"prompt_version":{"type":"string","title":"Prompt Version"},"language_code":{"type":"string","title":"Language Code","default":"en"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["id","status","youtube_video_id","video_url","provider","model","prompt_version","created_at"],"title":"JobStatusResponse"},"JsonFormatRequest":{"properties":{"text":{"type":"string","title":"Text"},"pretty":{"type":"boolean","title":"Pretty","default":true},"sort_keys":{"type":"boolean","title":"Sort Keys","default":false}},"type":"object","required":["text"],"title":"JsonFormatRequest"},"JsonFormatResponse":{"properties":{"text":{"type":"string","title":"Text"},"pretty":{"type":"boolean","title":"Pretty"},"sort_keys":{"type":"boolean","title":"Sort Keys"}},"type":"object","required":["text","pretty","sort_keys"],"title":"JsonFormatResponse"},"Language":{"properties":{"code":{"type":"string","title":"Code"},"name":{"type":"string","title":"Name"}},"type":"object","required":["code","name"],"title":"Language"},"LanguagesResponse":{"properties":{"languages":{"items":{"$ref":"#/components/schemas/Language"},"type":"array","title":"Languages"}},"type":"object","required":["languages"],"title":"LanguagesResponse"},"MeResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"billing_model":{"type":"string","const":"credits","title":"Billing Model","default":"credits"}},"type":"object","required":["user_id"],"title":"MeResponse"},"PreferencesResponse":{"properties":{"summary_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Language"}},"type":"object","title":"PreferencesResponse"},"PreferencesUpdate":{"properties":{"summary_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Language"}},"type":"object","title":"PreferencesUpdate"},"PublicSettlementDailyPoint":{"properties":{"day":{"type":"string","format":"date","title":"Day"},"settled_count":{"type":"integer","title":"Settled Count"},"settled_amount_atomic":{"type":"string","title":"Settled Amount Atomic"}},"type":"object","required":["day","settled_count","settled_amount_atomic"],"title":"PublicSettlementDailyPoint"},"PublicSettlementRow":{"properties":{"id":{"type":"integer","title":"Id"},"sku":{"type":"string","title":"Sku"},"surface":{"type":"string","title":"Surface"},"network":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Network"},"amount_atomic":{"type":"string","title":"Amount Atomic"},"payer_short":{"type":"string","title":"Payer Short"},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tx Hash"},"settled_at":{"type":"string","format":"date-time","title":"Settled At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"youtube_video_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Youtube Video Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"served_from_cache":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Served From Cache"}},"type":"object","required":["id","sku","surface","amount_atomic","payer_short","settled_at","created_at"],"title":"PublicSettlementRow"},"PublicSettlementTotals":{"properties":{"settled_count":{"type":"integer","title":"Settled Count"},"settled_amount_atomic":{"type":"string","title":"Settled Amount Atomic"},"distinct_payers":{"type":"integer","title":"Distinct Payers"},"settled_last_24h":{"type":"integer","title":"Settled Last 24H"},"last_settled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Settled At"}},"type":"object","required":["settled_count","settled_amount_atomic","distinct_payers","settled_last_24h"],"title":"PublicSettlementTotals"},"PublicSettlementsFeed":{"properties":{"totals":{"$ref":"#/components/schemas/PublicSettlementTotals"},"settlements":{"items":{"$ref":"#/components/schemas/PublicSettlementRow"},"type":"array","title":"Settlements"},"daily":{"items":{"$ref":"#/components/schemas/PublicSettlementDailyPoint"},"type":"array","title":"Daily"}},"type":"object","required":["totals","settlements","daily"],"title":"PublicSettlementsFeed"},"PublicVideoSummary":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"video_url":{"type":"string","title":"Video Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"original_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"first_transcribed_at":{"type":"string","format":"date-time","title":"First Transcribed At"},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Published At"},"summary":{"type":"string","title":"Summary"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"summarized_at":{"type":"string","format":"date-time","title":"Summarized At"},"language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Code"},"requested_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested Language"},"available_languages":{"items":{"type":"string"},"type":"array","title":"Available Languages","default":[]},"translation_status":{"type":"string","enum":["available","missing","in_progress"],"title":"Translation Status","default":"available"},"is_fallback":{"type":"boolean","title":"Is Fallback","default":false},"request_count":{"type":"integer","title":"Request Count"}},"type":"object","required":["youtube_video_id","video_url","first_transcribed_at","summary","provider","model","summarized_at","request_count"],"title":"PublicVideoSummary"},"QueueItem":{"properties":{"job_id":{"type":"integer","title":"Job Id"},"user_id":{"type":"string","title":"User Id"},"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"video_url":{"type":"string","title":"Video Url"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"status":{"type":"string","title":"Status"},"position":{"type":"integer","title":"Position"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"transcript_chars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transcript Chars"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"eta_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eta Seconds"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"}},"type":"object","required":["job_id","user_id","youtube_video_id","video_url","provider","model","status","position","created_at"],"title":"QueueItem"},"QueuePreviewItem":{"properties":{"position":{"type":"integer","title":"Position"},"status":{"type":"string","title":"Status"},"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"transcript_chars":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transcript Chars"},"eta_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eta Seconds"}},"type":"object","required":["position","status","youtube_video_id"],"title":"QueuePreviewItem"},"QueuePreviewResponse":{"properties":{"count":{"type":"integer","title":"Count"},"queue":{"items":{"$ref":"#/components/schemas/QueuePreviewItem"},"type":"array","title":"Queue"}},"type":"object","required":["count","queue"],"title":"QueuePreviewResponse"},"QueueResponse":{"properties":{"count":{"type":"integer","title":"Count"},"sec_per_char":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sec Per Char"},"queue":{"items":{"$ref":"#/components/schemas/QueueItem"},"type":"array","title":"Queue"}},"type":"object","required":["count","queue"],"title":"QueueResponse"},"RecentVideoEntry":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"original_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Code"},"last_summarized_at":{"type":"string","format":"date-time","title":"Last Summarized At"}},"type":"object","required":["youtube_video_id","last_summarized_at"],"title":"RecentVideoEntry"},"RecentVideosResponse":{"properties":{"requested_language":{"type":"string","title":"Requested Language","default":"en"},"items":{"items":{"$ref":"#/components/schemas/RecentVideoEntry"},"type":"array","title":"Items"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","limit","offset"],"title":"RecentVideosResponse"},"StatsOverview":{"properties":{"window":{"type":"string","title":"Window"},"unique_videos":{"type":"integer","title":"Unique Videos"},"total_requests":{"type":"integer","title":"Total Requests"},"unique_users":{"type":"integer","title":"Unique Users"},"cache_hits":{"type":"integer","title":"Cache Hits"},"cache_hit_rate":{"type":"number","title":"Cache Hit Rate"}},"type":"object","required":["window","unique_videos","total_requests","unique_users","cache_hits","cache_hit_rate"],"title":"StatsOverview"},"SummarizeRequest":{"properties":{"url":{"type":"string","title":"Url"},"max_credits":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Max Credits","default":1},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["url"],"title":"SummarizeRequest"},"SummaryRecord":{"properties":{"id":{"type":"integer","title":"Id"},"video_id":{"type":"string","title":"Video Id"},"video_url":{"type":"string","title":"Video Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"summary":{"type":"string","title":"Summary"},"provider":{"type":"string","title":"Provider"},"model":{"type":"string","title":"Model"},"prompt_version":{"type":"string","title":"Prompt Version"},"language_code":{"type":"string","title":"Language Code","default":"en"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","video_id","video_url","summary","provider","model","prompt_version","created_at"],"title":"SummaryRecord"},"SyncSessionRequest":{"properties":{"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["session_id"],"title":"SyncSessionRequest"},"TagCount":{"properties":{"tag":{"type":"string","title":"Tag"},"videos":{"type":"integer","title":"Videos"}},"type":"object","required":["tag","videos"],"title":"TagCount"},"TopTagsResponse":{"properties":{"language_code":{"type":"string","title":"Language Code"},"tags":{"items":{"$ref":"#/components/schemas/TagCount"},"type":"array","title":"Tags"}},"type":"object","required":["language_code","tags"],"title":"TopTagsResponse"},"TopVideo":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"video_url":{"type":"string","title":"Video Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"original_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Title"},"language_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Code"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"first_transcribed_at":{"type":"string","format":"date-time","title":"First Transcribed At"},"requests":{"type":"integer","title":"Requests"},"unique_users":{"type":"integer","title":"Unique Users"}},"type":"object","required":["youtube_video_id","video_url","first_transcribed_at","requests","unique_users"],"title":"TopVideo"},"TopVideosResponse":{"properties":{"requested_language":{"type":"string","title":"Requested Language","default":"en"},"window":{"type":"string","title":"Window"},"videos":{"items":{"$ref":"#/components/schemas/TopVideo"},"type":"array","title":"Videos"}},"type":"object","required":["window","videos"],"title":"TopVideosResponse"},"TrackEventRequest":{"properties":{"name":{"type":"string","title":"Name"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale"}},"type":"object","required":["name"],"title":"TrackEventRequest"},"TranslationRequest":{"properties":{"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"max_credits":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Max Credits","default":1}},"type":"object","title":"TranslationRequest"},"TrialConfigResponse":{"properties":{"generation_enabled":{"type":"boolean","title":"Generation Enabled","default":true},"policy":{"type":"string","title":"Policy","default":"legacy_daily"},"starter_credits":{"type":"integer","title":"Starter Credits","default":5},"max_video_seconds":{"type":"integer","title":"Max Video Seconds"},"per_ip_per_day":{"type":"integer","title":"Per Ip Per Day"}},"type":"object","required":["max_video_seconds","per_ip_per_day"],"title":"TrialConfigResponse","description":"Public, non-sensitive limits of the anonymous trial. Exists so the\nlanding page can state them up front (\"one video a day, under 30\nminutes\") instead of only after a visitor waits out a doomed job."},"TrialStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"max_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Seconds"}},"type":"object","required":["status"],"title":"TrialStatusResponse"},"TrialSummarizeRequest":{"properties":{"url":{"type":"string","title":"Url"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["url"],"title":"TrialSummarizeRequest"},"TrialSummarizeResponse":{"properties":{"status":{"type":"string","title":"Status"},"youtube_video_id":{"type":"string","title":"Youtube Video Id"}},"type":"object","required":["status","youtube_video_id"],"title":"TrialSummarizeResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoIdEntry":{"properties":{"youtube_video_id":{"type":"string","title":"Youtube Video Id"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"last_summarized_at":{"type":"string","format":"date-time","title":"Last Summarized At"},"languages":{"items":{"type":"string"},"type":"array","title":"Languages","default":[]}},"type":"object","required":["youtube_video_id","last_summarized_at"],"title":"VideoIdEntry"},"VideoIdsResponse":{"properties":{"videos":{"items":{"$ref":"#/components/schemas/VideoIdEntry"},"type":"array","title":"Videos"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["videos","count"],"title":"VideoIdsResponse"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"summarize","description":"Enqueue and poll summarization jobs."},{"name":"trial","description":"Anonymous, capped trial: one real summary per IP per day, no account required. Cache hits are free."},{"name":"agent","description":"Pay-per-call, synchronous endpoints for autonomous agents. No account or API key — payment is via the x402 protocol (HTTP 402 + USDC on Base). The summary/transcript is returned inline; a failed request is never charged."},{"name":"videos","description":"Global summary cache, per-video."},{"name":"queue","description":"Admin view of in-flight jobs."},{"name":"statistics","description":"Public, aggregate usage stats. Served internal-only (not routed publicly via Caddy) and cached ~1h in-process; the frontend fetches these server-side with hourly ISR for the /statistics page."},{"name":"billing","description":"Stripe checkout, portal, and webhooks."},{"name":"health","description":"Liveness / dependency checks."}]}