OpenAI Integration
Connect OpenAI to give Codex agents an API key when they run on a cloud computer. Every cloud run that uses Codex is billed to this connection's OpenAI account. On your laptop, Codex uses your own sign-in instead; Autoheal never stores a ChatGPT sign-in.
What it is used for
| Use | Description |
|---|---|
| Codex agents | An agent with a codex: section runs Codex on a cloud computer with this key |
| Coding agent checks | Project settings → Coding agents → Check runs Codex once to confirm the key works |
The connection belongs to a project. A Codex run uses the connection of the project it runs in.
Prerequisites
- Computers turned on for your organization
- An OpenAI API key
Setup
- Create an API key
- Sign in to the OpenAI platform
- Go to API keys and click Create new secret key
- Copy the key (
sk-...)
- Add Integration in Autoheal
- Go to Integrations in the project whose agents use Codex
- Click OpenAI
- Enter a name (e.g., "Codex billing")
- Configure Credentials
Enter the following:
- API Key: your OpenAI API key
- Save and check
Save the integration, then open Project settings → Coding agents, select Codex and click Check.
Use it in an agent
Add a codex: section to the agent's agent.yaml:
YAML
model: openai:gpt-6-sol
codex:
mode: auto
version: "0.166"
modeis the session's permission mode:autoworks in the workspace without asking;read-onlyasks before any change. Left out, the adapter's default applies.versionpins the coding agent's version, as a prefix. Leave it out to run the version installed on the computer: a pinned version is refused once the computer image moves past it.integrationnames the OpenAI connection whose key it uses. Only needed when the project has several.
A project admin can turn Codex off in Project settings → Coding agents; its runs are then refused.