All skills
Skillintermediate

ChatGPT Subscription

Use ChatGPT Pro/Max subscription models through LiteLLM with OAuth device flow authentication.

Claude Code Knowledge Pack7/10/2026

Overview

ChatGPT Subscription

Use ChatGPT Pro/Max subscription models through LiteLLM with OAuth device flow authentication.

PropertyDetails
DescriptionChatGPT subscription access (Codex + GPT-5.3/5.4 family) via ChatGPT backend API
Provider Route on LiteLLMchatgpt/
Supported Endpoints/responses, /chat/completions (bridged to Responses for supported models)
API Referencehttps://chatgpt.com

ChatGPT subscription access is native to the Responses API. Chat Completions requests are bridged to Responses for supported models (for example chatgpt/gpt-5.4).

Notes:

  • The ChatGPT subscription backend rejects token limit fields (max_tokens, max_output_tokens, max_completion_tokens) and metadata. LiteLLM strips these fields for this provider.
  • /v1/chat/completions honors stream. When stream is false (default), LiteLLM aggregates the Responses stream into a single JSON response.

Authentication

ChatGPT subscription access uses an OAuth device code flow:

  1. LiteLLM prints a device code and verification URL
  2. Open the URL, sign in, and enter the code
  3. Tokens are stored locally for reuse

Usage - LiteLLM Python SDK

Responses (recommended for Codex models)


response = litellm.responses(
    model="chatgpt/gpt-5.3-codex",
    input="Write a Python hello world"
)

print(response)

Chat Completions (bridged to Responses)


response = litellm.completion(
    model="chatgpt/gpt-5.4",
    messages=[{"role": "user", "content": "Write a Python hello world"}]
)

print(response)

Usage - LiteLLM Proxy

model_list:
  - model_name: chatgpt/gpt-5.4
    model_info:
      mode: responses
    litellm_params:
      model: chatgpt/gpt-5.4
  - model_name: chatgpt/gpt-5.4-pro
    model_info:
      mode: responses
    litellm_params:
      model: chatgpt/gpt-5.4-pro
  - model_name: chatgpt/gpt-5.3-codex
    model_info:
      mode: responses
    litellm_params:
      model: chatgpt/gpt-5.3-codex
  - model_name: chatgpt/gpt-5.3-codex-spark
    model_info:
      mode: responses
    litellm_params:
      model: chatgpt/gpt-5.3-codex-spark
  - model_name: chatgpt/gpt-5.3-instant
    model_info:
      mode: responses
    litellm_params:
      model: chatgpt/gpt-5.3-instant
  - model_name: chatgpt/gpt-5.3-chat-latest
    model_info:
      mode: responses
    litellm_params:
      model: chatgpt/gpt-5.3-chat-latest
litellm --config config.yaml

Configuration

Environment Variables

  • CHATGPT_TOKEN_DIR: Custom token storage directory
  • CHATGPT_AUTH_FILE: Auth file name (default: auth.json)
  • CHATGPT_API_BASE: Override API base (default: https://chatgpt.com/backend-api/codex)
  • OPENAI_CHATGPT_API_BASE: Alias for CHATGPT_API_BASE
  • CHATGPT_ORIGINATOR: Override the originator header value
  • CHATGPT_USER_AGENT: Override the User-Agent header value
  • CHATGPT_USER_AGENT_SUFFIX: Optional suffix appended to the User-Agent header