OpenAI lives under Connections in the AI providers category. The official third-party path is an API key from the OpenAI Platform. OpenAI does not offer OAuth for API access.
When you create a workspace you pick this connection. The platform writes the key into the workspace environment, configures Codex, and starts the AI agent. MainPath rules and skills are always installed, whether or not you select a key.
You may choose only one OpenAI account per workspace; you can combine it with accounts from other providers (Anthropic, Gemini, Mistral, Cursor).
Store an API key
- Create a key in the OpenAI Platform under API keys.
- Open Connections → Add connection → OpenAI.
- Enter Name, Slug, and the API key.
The platform checks the key for free against GET https://api.openai.com/v1/models. Invalid keys are rejected.
Use it in a workspace
- When creating a workspace, select the OpenAI connection under AI credentials.
- After provisioning,
OPENAI_API_KEYand the Codex configuration are ready in the workspace; code-server restarts with that environment.