OpenAI
first_party
Getting credentials
api-key
api_key via header (header Authorization: Bearer)
Key prefix: sk-
Environment: OPENAI_API_KEY
platform.openai.com → API Keys. Project keys (sk-proj-) scope to a project; send OpenAI-Organization / OpenAI-Project when a key spans orgs/projects.
chatgpt-oauth
oauth via header (header Authorization: Bearer)
Flow: authorization_code_pkce or device code at auth.openai.com (public client; first-party clients only)
Scopes: openid profile email offline_access
codex login (or --device-auth). Tokens persist in ~/.codex/auth.json (or OS keyring); refresh tokens rotate and are effectively single-use. Billed against ChatGPT Plus/Pro/Business plans (5-hour + weekly windows), not API credits.
Endpoints
| ID | URL | Protocol | Auth |
|---|---|---|---|
| v1-chat-completions | https://api.openai.com/v1/chat/completions | openai-chat | any |
| v1-responses | https://api.openai.com/v1/responses | openai-responses | any |
| codex-backend | https://chatgpt.com/backend-api/codex/responses | openai-responses | chatgpt-oauth |
API surfaces
textstreamingembeddingsfilesbatchfine_tuningrealtimeimage_genaudio
Quirks
- Assistants API sunsets 2026-08-26; migrate to Responses. Reasoning models require max_completion_tokens (chat) instead of max_tokens. (docs)
- ChatGPT-plan requests go to chatgpt.com/backend-api/codex (not api.openai.com) with Bearer tokens plus ChatGPT-Account-ID and originator headers; OpenAI allow-lists first-party originators server-side — third-party clients mimicking Codex work but are officially unsupported (ban reports exist). Enterprise access tokens (CODEX_ACCESS_TOKEN) are the supported programmatic path. (docs)
- Subscription quotas: rolling 5-hour windows shared by local messages and cloud tasks plus weekly caps (Plus/Business: gpt-5.6-luna 50-280 local messages/5h; Pro 5x-20x that; flexible-pricing enterprises scale with credits — credits per 1M tokens: Sol 125/750 in/out, Terra 50/300, Luna 5/30). GPT-5.4/5.4-mini retire from ChatGPT-plan access 2026-08-31. (docs)
Models offered
| Model | Wire ID | Endpoint | Status | Reasoning |
|---|---|---|---|---|
| openai/gpt-5 | gpt-5 | v1-chat-completions | ga | effort · default on · mandatory · returns hidden |
| openai/gpt-5 | gpt-5 | v1-responses | ga | effort · default on · mandatory · returns hidden · round-trips encrypted_content |
| openai/gpt-5-1 | gpt-5.1 | v1-chat-completions | ga | effort · default off · returns hidden |
| openai/gpt-5-1 | gpt-5.1 | v1-responses | ga | effort · default off · returns reasoning_summary · round-trips encrypted_content |
| openai/gpt-5-5 | gpt-5.5 | v1-chat-completions | ga | effort · default on · returns hidden |
| openai/gpt-5-5 | gpt-5.5 | v1-responses | ga | effort · default on · returns reasoning_summary · round-trips encrypted_content |
| openai/gpt-5-6 | gpt-5.6 | v1-chat-completions | ga | effort · default on · returns hidden |
| openai/gpt-5-6 | gpt-5.6-luna | codex-backend | ga | effort · default on · returns reasoning_summary · round-trips encrypted_content |
| openai/gpt-5-6 | gpt-5.6 | v1-responses | ga | effort · default on · returns reasoning_summary · round-trips encrypted_content |
| openai/gpt-5-6 | gpt-5.6-sol | codex-backend | ga | effort · default on · returns reasoning_summary · round-trips encrypted_content |
| openai/gpt-5-6 | gpt-5.6-terra | codex-backend | ga | effort · default on · returns reasoning_summary · round-trips encrypted_content |
| openai/o3 | o3 | v1-chat-completions | ga | effort · default on · mandatory · returns hidden |
| openai/o3 | o3 | v1-responses | ga | effort · default on · mandatory · returns hidden · round-trips encrypted_content |