| 1 | from __future__ import annotations |
| 2 | |
| 3 | from copy import deepcopy |
| 4 | from typing import Any |
| 5 | |
| 6 | CODEX_PROVIDER_ID = "codex_oauth" |
| 7 | GITHUB_COPILOT_PROVIDER_ID = "github_copilot_oauth" |
| 8 | GEMINI_API_PROVIDER_ID = "gemini_api_oauth" |
| 9 | XAI_GROK_PROVIDER_ID = "xai_grok_oauth" |
| 10 | |
| 11 | |
| 12 | USAGE_PLAN_CATALOG: dict[str, dict[str, Any]] = { |
| 13 | CODEX_PROVIDER_ID: { |
| 14 | "provider_id": CODEX_PROVIDER_ID, |
| 15 | "display_name": "OpenAI Codex", |
| 16 | "implemented": True, |
| 17 | "plans": [ |
| 18 | {"id": "free", "label": "Free", "billing": "$0/month", "usage": "Quick coding tasks with plan-specific limits."}, |
| 19 | {"id": "go", "label": "Go", "billing": "$8/month", "usage": "Lightweight coding tasks."}, |
| 20 | {"id": "plus", "label": "Plus", "billing": "$20/month", "usage": "Focused coding sessions, latest Codex models, and credit extension."}, |
| 21 | {"id": "pro", "label": "Pro", "billing": "From $100/month", "usage": "Higher Codex limits than Plus, including Pro tiers."}, |
| 22 | {"id": "business", "label": "Business", "billing": "Pay as you go", "usage": "Standard or usage-based Codex seats, credits, admin controls, and no training by default."}, |
| 23 | {"id": "enterprise_edu", "label": "Enterprise / Edu", "billing": "Contact sales", "usage": "Enterprise controls, priority processing, audit and usage monitoring."}, |
| 24 | {"id": "api_key", "label": "API Key", "billing": "Token-based API pricing", "usage": "CLI, SDK, or IDE automation without ChatGPT cloud features."}, |
| 25 | ], |
| 26 | "notes": [ |
| 27 | "Codex is included across ChatGPT Free, Go, Plus, Pro, Business, Edu, and Enterprise plans.", |
| 28 | "The Pro 2x/boost promotion ended on 2026-05-31.", |
| 29 | "API-key usage is separate from ChatGPT subscription usage and may receive delayed access to some new Codex models.", |
| 30 | ], |
| 31 | "sources": [ |
| 32 | {"label": "OpenAI Codex pricing", "url": "https://developers.openai.com/codex/pricing"}, |
| 33 | {"label": "Using Codex with your ChatGPT plan", "url": "https://help.openai.com/en/articles/11369540"}, |
| 34 | ], |
| 35 | }, |
| 36 | GITHUB_COPILOT_PROVIDER_ID: { |
| 37 | "provider_id": GITHUB_COPILOT_PROVIDER_ID, |
| 38 | "display_name": "GitHub Copilot", |
| 39 | "implemented": True, |
| 40 | "plans": [ |
| 41 | {"id": "free", "label": "Copilot Free", "billing": "Free", "usage": "Entry Copilot access with monthly completion limits."}, |
| 42 | {"id": "student", "label": "Copilot Student", "billing": "Free for eligible users", "usage": "Student-entitled Copilot access."}, |
| 43 | {"id": "pro", "label": "Copilot Pro", "billing": "$10/month", "usage": "Individual Copilot access with paid entitlements."}, |
| 44 | {"id": "pro_plus", "label": "Copilot Pro+", "billing": "$39/month", "usage": "Larger individual AI-credit pool."}, |
| 45 | {"id": "max", "label": "Copilot Max", "billing": "$100/month", "usage": "Highest individual monthly AI-credit allowance and priority model access."}, |
| 46 | {"id": "business", "label": "Copilot Business", "billing": "$19/seat/month", "usage": "Team and organization plan with centralized management."}, |
| 47 | {"id": "enterprise", "label": "Copilot Enterprise", "billing": "$39/seat/month", "usage": "Enterprise Cloud plan with larger AI-credit pool and enterprise controls."}, |
| 48 | ], |
| 49 | "notes": [ |
| 50 | "AI-credit availability and model access can differ by seat and organization policy.", |
| 51 | "GitHub docs list new signup pauses for several Copilot plans beginning in April 2026.", |
| 52 | "Beginning 2026-06-01, GitHub docs describe Copilot Max as upgrade-only for users with existing Copilot plans.", |
| 53 | ], |
| 54 | "sources": [ |
| 55 | {"label": "GitHub Copilot plans", "url": "https://docs.github.com/en/copilot/get-started/plans"}, |
| 56 | ], |
| 57 | }, |
| 58 | GEMINI_API_PROVIDER_ID: { |
| 59 | "provider_id": GEMINI_API_PROVIDER_ID, |
| 60 | "display_name": "Google Cloud Gemini", |
| 61 | "implemented": True, |
| 62 | "plans": [ |
| 63 | {"id": "oauth_cloud_project", "label": "Google Cloud project", "billing": "Google Cloud project", "usage": "Official OAuth access using a user-provided Google Cloud OAuth client."}, |
| 64 | {"id": "api_key", "label": "API key", "billing": "Gemini API pricing", "usage": "Standard Gemini API key access through Google AI Studio or Google Cloud."}, |
| 65 | {"id": "vertex_ai", "label": "Vertex AI", "billing": "Google Cloud", "usage": "Enterprise Gemini API access through Vertex AI projects and IAM."}, |
| 66 | ], |
| 67 | "notes": [ |
| 68 | "Gemini API OAuth requires the Google Generative Language API to be enabled on the user's Cloud project.", |
| 69 | "OAuth Gemini API usage is separate from Antigravity, Gemini Code Assist, Gemini CLI, Google AI Pro, and Google AI Ultra subscription quotas.", |
| 70 | "A quota project may be required so Google can attribute billing and quota to the correct Cloud project.", |
| 71 | ], |
| 72 | "sources": [ |
| 73 | {"label": "Gemini API OAuth", "url": "https://ai.google.dev/gemini-api/docs/oauth"}, |
| 74 | {"label": "Gemini OpenAI compatibility", "url": "https://ai.google.dev/gemini-api/docs/openai"}, |
| 75 | {"label": "Gemini API billing", "url": "https://ai.google.dev/gemini-api/docs/billing"}, |
| 76 | ], |
| 77 | }, |
| 78 | XAI_GROK_PROVIDER_ID: { |
| 79 | "provider_id": XAI_GROK_PROVIDER_ID, |
| 80 | "display_name": "xAI Grok", |
| 81 | "implemented": True, |
| 82 | "plans": [ |
| 83 | {"id": "free", "label": "Free", "billing": "$0/month", "usage": "Grok app access with free limits."}, |
| 84 | {"id": "supergrok_lite", "label": "SuperGrok Lite", "billing": "Subscription", "usage": "Intermediate Grok app limits."}, |
| 85 | {"id": "supergrok", "label": "SuperGrok", "billing": "$30/month", "usage": "Higher app limits, Grok 4 model, connectors, image and video generation."}, |
| 86 | {"id": "supergrok_heavy", "label": "SuperGrok Heavy", "billing": "Subscription", "usage": "Highest individual Grok app tier."}, |
| 87 | {"id": "business", "label": "Business", "billing": "Team plan", "usage": "Team seats, billing, role-based access, and admin controls."}, |
| 88 | {"id": "enterprise", "label": "Enterprise", "billing": "Contact sales", "usage": "Custom rate limits, SSO, SCIM, data residency, and volume pricing."}, |
| 89 | {"id": "api_credits", "label": "API credits", "billing": "Prepaid/usage credits", "usage": "xAI API access after account setup and credit loading."}, |
| 90 | ], |
| 91 | "notes": [ |
| 92 | "xAI API billing is separate from Grok app subscriptions unless xAI explicitly entitles the account.", |
| 93 | "The API quickstart uses API keys from the xAI console and requires loading credits.", |
| 94 | ], |
| 95 | "sources": [ |
| 96 | {"label": "xAI pricing", "url": "https://x.ai/pricing"}, |
| 97 | {"label": "xAI API quickstart", "url": "https://docs.x.ai/developers/quickstart"}, |
| 98 | ], |
| 99 | }, |
| 100 | } |
| 101 | |
| 102 | |
| 103 | def usage_plan_catalog() -> dict[str, dict[str, Any]]: |
| 104 | return deepcopy(USAGE_PLAN_CATALOG) |