Skip to main content

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​

UseDescription
Codex agentsAn agent with a codex: section runs Codex on a cloud computer with this key
Coding agent checksProject 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​

Setup​

  1. Create an API key
    1. Sign in to the OpenAI platform
    2. Go to API keys and click Create new secret key
    3. Copy the key (sk-...)
  2. Add Integration in Autoheal
    1. Go to Integrations in the project whose agents use Codex
    2. Click OpenAI
    3. Enter a name (e.g., "Codex billing")
  3. Configure Credentials

    Enter the following:

    • API Key: your OpenAI API key
  4. 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"
  • mode is the session's permission mode: auto works in the workspace without asking; read-only asks before any change. Left out, the adapter's default applies.
  • version pins 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.
  • integration names 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.