ChatGPT subscription support
ChatGPT subscription support lets you bring your own ChatGPT Go, Plus, Pro, or Enterprise plan to Codex through Unity Gateway. Instead of storing an OpenAI API key, Unity Gateway forwards each caller's own ChatGPT sign-in to OpenAI. Requests are billed against the caller's subscription, while Unity Gateway governs access, routing, and usage.
Requirements
CREATE SERVICEon the schema where you create the model provider service, plusUSE CATALOGandUSE SCHEMAon its catalog and schema.- A ChatGPT Go, Plus, Pro, or Enterprise subscription to sign in with when querying.
Create a model provider service
Register the connection once as a model provider service. Follow the steps in Create and manage providers, and select OpenAI as the provider type and the ChatGPT Go / Plus / Pro / Enterprise plans authentication mode. The service stores no credential. Each caller signs in with their own ChatGPT subscription, and you govern access to the service with Unity Catalog privileges.
Connect a coding agent
After the model provider service exists, each user connects their agent to it and signs in with their own ChatGPT subscription:
- Codex CLI: See Bring your own ChatGPT subscription in Connect Codex. It covers the Unity Gateway CLI (recommended) and manual setup.
- ChatGPT desktop: See Bring your own ChatGPT subscription in Connect ChatGPT desktop.
How ChatGPT subscription support works
When you configure Codex to use Unity Gateway, Codex continues to authenticate with OpenAI. It sends its own ChatGPT credentials in the Authorization and ChatGPT-Account-ID headers, and Unity Gateway forwards them to OpenAI on each request.
Because the Authorization header is reserved for ChatGPT subscription credentials, Unity Gateway uses a separate header, X-Databricks-AI-Gateway-Token, for its own Databricks credentials. This lets both OpenAI and Databricks authentication mechanisms coexist.
The Databricks-Model-Provider-Service header specifies which model provider service Unity Gateway resolves. Because that service is a Unity Catalog securable, you register it once, govern access with Unity Catalog privileges, and query it through Unity Gateway. The only difference from a standard model provider service is how each request is authenticated.
Unity Gateway doesn't store the ChatGPT credentials. It forwards them on every request.
Troubleshooting
ugreportsCodex ChatGPT relay cannot start because enterprise managed settings define ...: Your device's managed Codex settings definemodel_provider, or thebase_urlorauthof the Databricks provider, which would override the settings that send your ChatGPT sign-in. If the Unity Gateway CLI created those settings, runug revertand retry. Otherwise, ask your admin to remove them.
Limitations
- Requests are billed against the caller's ChatGPT subscription and are subject to that subscription's rate limits.
- A model provider service that uses ChatGPT subscription support stores no credential, so it can only serve requests that carry a caller's ChatGPT sign-in.