{"openapi":"3.1.0","info":{"title":"GateYourWay API Gateway","version":"1.0.0"},"paths":{"/auth/register":{"post":{"summary":"Register","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"summary":"Me","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}}}}},"/auth/logout":{"post":{"summary":"Logout","operationId":"logout_auth_logout_post","responses":{"204":{"description":"Successful Response"}}}},"/auth/verify-email":{"post":{"summary":"Verify Email","operationId":"verify_email_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/resend-verification":{"post":{"summary":"Resend Verification","operationId":"resend_verification_auth_resend_verification_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/summary":{"get":{"summary":"Account Summary","operationId":"account_summary_auth_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountSummaryOut"}}}}}}},"/auth/transactions":{"get":{"summary":"List Transactions","operationId":"list_transactions_auth_transactions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransactionOut"},"title":"Response List Transactions Auth Transactions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/links":{"get":{"summary":"Links","operationId":"links_auth_links_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLinkAccountOut"}}}}}}},"/auth/email/link/start":{"post":{"summary":"Start Email Link","operationId":"start_email_link_auth_email_link_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailLinkStartRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailLinkStartOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/email/link/confirm":{"post":{"summary":"Confirm Email Link","operationId":"confirm_email_link_auth_email_link_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailLinkConfirmRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailLinkConfirmOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/telegram/link/start":{"post":{"summary":"Start Telegram Link","operationId":"start_telegram_link_auth_telegram_link_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLinkStartOut"}}}}}}},"/auth/telegram/link/status":{"get":{"summary":"Telegram Link Status","operationId":"telegram_link_status_auth_telegram_link_status_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":32,"maxLength":256,"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLinkStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/telegram/link/confirm":{"post":{"summary":"Confirm Telegram Link","operationId":"confirm_telegram_link_auth_telegram_link_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLinkTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramLinkConfirmOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/telegram/link":{"delete":{"summary":"Delete Telegram Link","operationId":"delete_telegram_link_auth_telegram_link_delete","responses":{"204":{"description":"Successful Response"}}}},"/auth/telegram/start":{"get":{"summary":"Telegram Start","operationId":"telegram_start_auth_telegram_start_get","parameters":[{"name":"link_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/telegram/callback":{"get":{"summary":"Telegram Callback","operationId":"telegram_callback_auth_telegram_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/keys":{"get":{"summary":"List Keys","operationId":"list_keys_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/KeyOut"},"type":"array","title":"Response List Keys Keys Get"}}}}}},"post":{"summary":"Create Key","operationId":"create_key_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/gateway__routers__keys__CreateKeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/keys/{key_id}":{"delete":{"summary":"Revoke Key","operationId":"revoke_key_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leaderboard/daily":{"get":{"summary":"Daily Leaderboard","operationId":"daily_leaderboard_leaderboard_daily_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyLeaderboardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage":{"get":{"summary":"List Usage","operationId":"list_usage_usage_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"group","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"}},{"name":"provider_family","in":"query","required":false,"schema":{"anyOf":[{"enum":["openai","anthropic","xai","glm"],"type":"string"},{"type":"null"}],"title":"Provider Family"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage/summary":{"get":{"summary":"Usage Summary","operationId":"usage_summary_usage_summary_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage/timeseries":{"get":{"summary":"Usage Timeseries","operationId":"usage_timeseries_usage_timeseries_get","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"To"}},{"name":"bucket","in":"query","required":false,"schema":{"enum":["minute","hour","day"],"type":"string","default":"hour","title":"Bucket"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"group","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group"}},{"name":"provider_family","in":"query","required":false,"schema":{"anyOf":[{"enum":["openai","anthropic","xai","glm"],"type":"string"},{"type":"null"}],"title":"Provider Family"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageTimeseriesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/usage/{request_id}":{"get":{"summary":"Get Usage Event","operationId":"get_usage_event_usage__request_id__get","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEventOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/catalog/models":{"get":{"summary":"List Models","operationId":"list_models_catalog_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Models Catalog Models Get"}}}}}}},"/catalog/models/me":{"get":{"summary":"List Models For User","operationId":"list_models_for_user_catalog_models_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Models For User Catalog Models Me Get"}}}}}}},"/catalog/status":{"get":{"summary":"Service Status","operationId":"service_status_catalog_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceStatusOut"}}}}}}},"/payments/config":{"get":{"summary":"Payment Config","operationId":"payment_config_payments_config_get","parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"ru","title":"Language"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payments/agreements/accept":{"post":{"summary":"Accept Agreement","operationId":"accept_agreement_payments_agreements_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptAgreementRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptAgreementResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payments/invoices":{"get":{"summary":"List Invoices","operationId":"list_invoices_payments_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Invoice","operationId":"create_invoice_payments_invoices_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payments/invoices/{invoice_id}":{"get":{"summary":"Get Invoice","operationId":"get_invoice_payments_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/announcements":{"get":{"summary":"List Announcements","operationId":"list_announcements_announcements_get","parameters":[{"name":"language","in":"query","required":false,"schema":{"enum":["ru","en"],"type":"string","default":"ru","title":"Language"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Announcements Announcements Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/announcements/{announcement_id}/read":{"post":{"summary":"Mark Announcement Read","operationId":"mark_announcement_read_announcements__announcement_id__read_post","parameters":[{"name":"announcement_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Announcement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mark Announcement Read Announcements  Announcement Id  Read Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/announcements/read-all":{"post":{"summary":"Mark All Announcements Read","operationId":"mark_all_announcements_read_announcements_read_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Mark All Announcements Read Announcements Read All Post"}}}}}}},"/status":{"get":{"summary":"Health","operationId":"health_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Status Get"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/live":{"get":{"summary":"Live","operationId":"live_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Live Live Get"}}}}}}},"/ready":{"get":{"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Ready Ready Get"}}}}}}}},"components":{"schemas":{"AcceptAgreementRequest":{"properties":{"language":{"type":"string","title":"Language","default":"ru"},"surface":{"type":"string","title":"Surface","default":"cabinet"}},"type":"object","title":"AcceptAgreementRequest"},"AcceptAgreementResponse":{"properties":{"accepted":{"type":"boolean","title":"Accepted"},"terms_version":{"type":"string","title":"Terms Version"},"privacy_version":{"type":"string","title":"Privacy Version"}},"type":"object","required":["accepted","terms_version","privacy_version"],"title":"AcceptAgreementResponse"},"AccountOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified"},"balance_usd":{"type":"string","title":"Balance Usd"},"is_admin":{"type":"boolean","title":"Is Admin","default":false}},"type":"object","required":["user_id","username","email","email_verified","balance_usd"],"title":"AccountOut"},"AccountSummaryOut":{"properties":{"user_id":{"type":"string","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"balance_usd":{"type":"string","title":"Balance Usd"},"active_keys":{"type":"integer","title":"Active Keys"},"usage_usd":{"type":"string","title":"Usage Usd"},"topup_usd":{"type":"string","title":"Topup Usd"}},"type":"object","required":["user_id","email","balance_usd","active_keys","usage_usd","topup_usd"],"title":"AccountSummaryOut"},"AgreementContent":{"properties":{"terms_version":{"type":"string","title":"Terms Version"},"privacy_version":{"type":"string","title":"Privacy Version"},"title":{"type":"string","title":"Title"},"intro":{"type":"string","title":"Intro"},"sections":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Sections"}},"type":"object","required":["terms_version","privacy_version","title","intro","sections"],"title":"AgreementContent"},"CreateInvoiceRequest":{"properties":{"amount_usd":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount Usd"},"method":{"type":"string","title":"Method"}},"type":"object","required":["amount_usd","method"],"title":"CreateInvoiceRequest"},"DailyLeaderboardOut":{"properties":{"date":{"type":"string","title":"Date"},"timezone":{"type":"string","title":"Timezone"},"prize":{"type":"string","title":"Prize"},"total_tokens":{"type":"integer","title":"Total Tokens"},"total_saved_usd":{"type":"string","title":"Total Saved Usd"},"items":{"items":{"$ref":"#/components/schemas/LeaderboardEntryOut"},"type":"array","title":"Items"},"me":{"anyOf":[{"$ref":"#/components/schemas/LeaderboardEntryOut"},{"type":"null"}]}},"type":"object","required":["date","timezone","prize","total_tokens","total_saved_usd","items"],"title":"DailyLeaderboardOut"},"EmailLinkConfirmOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"email":{"type":"string","title":"Email"}},"type":"object","required":["ok","email"],"title":"EmailLinkConfirmOut"},"EmailLinkConfirmRequest":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","code","password"],"title":"EmailLinkConfirmRequest"},"EmailLinkStartOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["ok","expires_at"],"title":"EmailLinkStartOut"},"EmailLinkStartRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"EmailLinkStartRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceOut"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"InvoiceListOut"},"InvoiceOut":{"properties":{"id":{"type":"string","title":"Id"},"method":{"type":"string","title":"Method"},"amount_requested":{"type":"string","title":"Amount Requested"},"currency":{"type":"string","title":"Currency"},"usd_credit":{"type":"string","title":"Usd Credit"},"bonus_rate":{"type":"string","title":"Bonus Rate"},"bonus_usd":{"type":"string","title":"Bonus Usd"},"status":{"type":"string","title":"Status"},"payment_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Url"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At"}},"type":"object","required":["id","method","amount_requested","currency","usd_credit","bonus_rate","bonus_usd","status","payment_url","created_at","updated_at","paid_at"],"title":"InvoiceOut"},"KeyCreated":{"properties":{"id":{"type":"string","title":"Id"},"key":{"type":"string","title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"provider_family":{"type":"string","title":"Provider Family"},"route_group":{"type":"string","title":"Route Group"},"pricing_plan":{"type":"string","title":"Pricing Plan"},"monthly_spend_cap":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Monthly Spend Cap"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","key","label","provider_family","route_group","pricing_plan","monthly_spend_cap","created_at"],"title":"KeyCreated"},"KeyOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"provider_family":{"type":"string","title":"Provider Family"},"route_group":{"type":"string","title":"Route Group"},"pricing_plan":{"type":"string","title":"Pricing Plan"},"monthly_spend_cap":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Monthly Spend Cap"},"last_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","label","provider_family","route_group","pricing_plan","monthly_spend_cap","last_used","created_at"],"title":"KeyOut"},"LeaderboardEntryOut":{"properties":{"rank":{"type":"integer","title":"Rank"},"user":{"type":"string","title":"User"},"tokens":{"type":"integer","title":"Tokens"},"saved_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Saved Usd"},"is_me":{"type":"boolean","title":"Is Me","default":false}},"type":"object","required":["rank","user","tokens"],"title":"LeaderboardEntryOut"},"LoginRequest":{"properties":{"login":{"type":"string","title":"Login"},"password":{"type":"string","title":"Password"}},"type":"object","required":["login","password"],"title":"LoginRequest"},"PaymentConfigOut":{"properties":{"payments_enabled":{"type":"boolean","title":"Payments Enabled"},"rub_per_usd":{"type":"string","title":"Rub Per Usd"},"methods":{"items":{"$ref":"#/components/schemas/PaymentMethodOut"},"type":"array","title":"Methods"},"agreement":{"$ref":"#/components/schemas/AgreementContent"},"agreement_accepted":{"type":"boolean","title":"Agreement Accepted"},"paid_balance_usd":{"type":"string","title":"Paid Balance Usd"},"bonus_balance_usd":{"type":"string","title":"Bonus Balance Usd"},"next_bonus_expiry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Bonus Expiry"},"bonus_enabled":{"type":"boolean","title":"Bonus Enabled"},"bonus_expiry_days":{"type":"integer","title":"Bonus Expiry Days"},"bonus_tiers":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Bonus Tiers"},"trusted_partner_enabled":{"type":"boolean","title":"Trusted Partner Enabled"},"trusted_partner_active":{"type":"boolean","title":"Trusted Partner Active"},"trusted_partner_valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trusted Partner Valid Until"}},"type":"object","required":["payments_enabled","rub_per_usd","methods","agreement","agreement_accepted","paid_balance_usd","bonus_balance_usd","next_bonus_expiry","bonus_enabled","bonus_expiry_days","bonus_tiers","trusted_partner_enabled","trusted_partner_active","trusted_partner_valid_until"],"title":"PaymentConfigOut"},"PaymentMethodOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"currency":{"type":"string","title":"Currency"},"min_usd":{"type":"string","title":"Min Usd"},"max_usd":{"type":"string","title":"Max Usd"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["id","label","currency","min_usd","max_usd","enabled"],"title":"PaymentMethodOut"},"RegisterRequest":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","email","password"],"title":"RegisterRequest"},"ResendVerificationRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ResendVerificationRequest"},"ResendVerificationResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["ok"],"title":"ResendVerificationResponse"},"ServiceGroupStatusOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"status":{"type":"string","enum":["active","unavailable"],"title":"Status"},"uptime":{"$ref":"#/components/schemas/ServiceUptimeOut"},"models":{"items":{"$ref":"#/components/schemas/ServiceModelStatusOut"},"type":"array","title":"Models"}},"type":"object","required":["id","label","status","uptime"],"title":"ServiceGroupStatusOut"},"ServiceModelHistoryPointOut":{"properties":{"observed_at":{"type":"string","title":"Observed At"},"status":{"type":"string","enum":["active","unavailable"],"title":"Status"}},"type":"object","required":["observed_at","status"],"title":"ServiceModelHistoryPointOut"},"ServiceModelStatusOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"status":{"type":"string","enum":["active","unavailable","checking"],"title":"Status"},"checked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checked At"},"history":{"items":{"$ref":"#/components/schemas/ServiceModelHistoryPointOut"},"type":"array","title":"History"}},"type":"object","required":["id","label","status","checked_at","history"],"title":"ServiceModelStatusOut"},"ServiceStatusOut":{"properties":{"generated_at":{"type":"string","title":"Generated At"},"groups":{"items":{"$ref":"#/components/schemas/ServiceGroupStatusOut"},"type":"array","title":"Groups"}},"type":"object","required":["generated_at","groups"],"title":"ServiceStatusOut"},"ServiceUptimeOut":{"properties":{"all_time":{"type":"string","title":"All Time"},"last_24h":{"type":"string","title":"Last 24H"},"last_7d":{"type":"string","title":"Last 7D"},"last_30d":{"type":"string","title":"Last 30D"}},"type":"object","required":["all_time","last_24h","last_7d","last_30d"],"title":"ServiceUptimeOut"},"TelegramLinkAccountOut":{"properties":{"linked":{"type":"boolean","title":"Linked"},"telegram_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Telegram Label"},"has_password":{"type":"boolean","title":"Has Password","default":false},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified","default":false}},"type":"object","required":["linked"],"title":"TelegramLinkAccountOut"},"TelegramLinkConfirmOut":{"properties":{"status":{"type":"string","title":"Status"},"user_id":{"type":"string","title":"User Id"}},"type":"object","required":["status","user_id"],"title":"TelegramLinkConfirmOut"},"TelegramLinkStartOut":{"properties":{"token":{"type":"string","title":"Token"},"bot_url":{"type":"string","title":"Bot Url"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["token","bot_url","expires_at"],"title":"TelegramLinkStartOut"},"TelegramLinkStatusOut":{"properties":{"linked":{"type":"boolean","title":"Linked"},"telegram_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Telegram Label"},"has_password":{"type":"boolean","title":"Has Password","default":false},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"email_verified":{"type":"boolean","title":"Email Verified","default":false},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"initiated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initiated By"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"bot_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bot Url"}},"type":"object","required":["linked"],"title":"TelegramLinkStatusOut"},"TelegramLinkTokenRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"TelegramLinkTokenRequest"},"TimeseriesPoint":{"properties":{"ts":{"type":"string","title":"Ts"},"requests":{"type":"integer","title":"Requests"},"spend_usd":{"type":"string","title":"Spend Usd"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens"}},"type":"object","required":["ts","requests","spend_usd","input_tokens","output_tokens","cache_read_tokens","cache_write_tokens"],"title":"TimeseriesPoint"},"TransactionOut":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"amount_usd":{"type":"string","title":"Amount Usd"},"kind":{"type":"string","title":"Kind"},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"prompt_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prompt Tokens"},"completion_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completion Tokens"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","user_id","amount_usd","kind","api_key_id","provider","model","prompt_tokens","completion_tokens","created_at"],"title":"TransactionOut"},"UsageEventOut":{"properties":{"id":{"type":"string","title":"Id"},"request_id":{"type":"string","title":"Request Id"},"client_surface":{"type":"string","title":"Client Surface"},"created_at":{"type":"string","title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"provider_family":{"type":"string","title":"Provider Family"},"route_group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route Group"},"route_group_label":{"type":"string","title":"Route Group Label"},"endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint"},"model":{"type":"string","title":"Model"},"status":{"type":"string","title":"Status"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"},"prompt_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prompt Tokens"},"completion_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Completion Tokens"},"cache_read_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Read Tokens"},"cache_write_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cache Write Tokens"},"total_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Tokens"},"cache_hit_ratio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cache Hit Ratio"},"public_input_usd_per_1m":{"type":"string","title":"Public Input Usd Per 1M"},"public_output_usd_per_1m":{"type":"string","title":"Public Output Usd Per 1M"},"public_cache_read_usd_per_1m":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Cache Read Usd Per 1M"},"public_cache_write_usd_per_1m":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Cache Write Usd Per 1M"},"public_request_usd_per_generation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Request Usd Per Generation"},"amount_usd":{"type":"string","title":"Amount Usd"},"official_cost_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Official Cost Usd"},"saved_usd":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Saved Usd"}},"type":"object","required":["id","request_id","client_surface","created_at","completed_at","provider_family","route_group","route_group_label","endpoint","model","status","error_code","latency_ms","prompt_tokens","completion_tokens","cache_read_tokens","cache_write_tokens","total_tokens","cache_hit_ratio","public_input_usd_per_1m","public_output_usd_per_1m","public_cache_read_usd_per_1m","public_cache_write_usd_per_1m","public_request_usd_per_generation","amount_usd","official_cost_usd","saved_usd"],"title":"UsageEventOut"},"UsageListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UsageEventOut"},"type":"array","title":"Items"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","limit"],"title":"UsageListOut"},"UsageSummaryOut":{"properties":{"total_spend_usd":{"type":"string","title":"Total Spend Usd"},"total_requests":{"type":"integer","title":"Total Requests"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_cache_read_tokens":{"type":"integer","title":"Total Cache Read Tokens"},"total_cache_write_tokens":{"type":"integer","title":"Total Cache Write Tokens"},"avg_cost_per_request_usd":{"type":"string","title":"Avg Cost Per Request Usd"},"savings_gateway_cost_usd":{"type":"string","title":"Savings Gateway Cost Usd"},"savings_official_cost_usd":{"type":"string","title":"Savings Official Cost Usd"},"savings_saved_usd":{"type":"string","title":"Savings Saved Usd"},"savings_saved_percent":{"type":"string","title":"Savings Saved Percent"},"savings_comparable_requests":{"type":"integer","title":"Savings Comparable Requests"},"by_model":{"additionalProperties":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"object"},"type":"object","title":"By Model"},"by_group":{"additionalProperties":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"object"},"type":"object","title":"By Group"}},"type":"object","required":["total_spend_usd","total_requests","total_input_tokens","total_output_tokens","total_cache_read_tokens","total_cache_write_tokens","avg_cost_per_request_usd","savings_gateway_cost_usd","savings_official_cost_usd","savings_saved_usd","savings_saved_percent","savings_comparable_requests","by_model","by_group"],"title":"UsageSummaryOut"},"UsageTimeseriesOut":{"properties":{"bucket":{"type":"string","title":"Bucket"},"from_":{"type":"string","title":"From"},"to":{"type":"string","title":"To"},"points":{"items":{"$ref":"#/components/schemas/TimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["bucket","from_","to","points"],"title":"UsageTimeseriesOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerifyEmailRequest":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"}},"type":"object","required":["email","code"],"title":"VerifyEmailRequest"},"gateway__routers__keys__CreateKeyRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Label"},"provider_family":{"type":"string","title":"Provider Family","default":"openai"},"route_group":{"type":"string","title":"Route Group","default":"cheap"},"pricing_plan":{"type":"string","title":"Pricing Plan","default":"siberia"},"monthly_spend_cap":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Monthly Spend Cap"}},"type":"object","title":"CreateKeyRequest"}}}}