> ## Documentation Index
> Fetch the complete documentation index at: https://heygen-1fa696a7.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> Use HeyGen in the Codex app with the HeyGen plugin, or in Codex CLI with HeyGen's MCP server, and make AI avatar videos from a plain-language prompt.

Make HeyGen videos from Codex with a plain-language prompt. Pick the tab for the Codex you use.

> [tab] Codex app
>
> Install the HeyGen plugin. It's the same plugin as in [ChatGPT](https://heygen-1fa696a7.mintlify.site/mcp/open-ai.md), and it shows videos and voices as interactive cards in the chat.
>
> **1. Install the HeyGen plugin**
>
> Open the **Plugins** tab, find **HeyGen**, and select the plus button.
>
> **2. Connect your HeyGen account**
>
> Start a new chat. When Codex asks, sign in to HeyGen in your browser and approve access. New to HeyGen? You can create an account during this step.
>
> **3. Ask for a video**
>
> ```text theme={null}
> Make a 60-second HeyGen explainer about our new API endpoints.
> ```
>
> Codex writes the script, picks the avatar, and renders the video. Finished videos also appear in **Projects** in HeyGen.
>
> > [accordion] Can't install the plugin? Add the MCP server instead
> >
> > Plugin availability can depend on your plan, workspace settings, and region. To connect HeyGen's MCP server directly:
> >
> > 1. Open **Settings**, then select **MCP servers**.
> > 2. Select **Add server**.
> > 3. Name it `HeyGen`, choose **Streamable HTTP**, and enter `https://mcp.heygen.com/mcp/v1`.
> > 4. Save the server, then select **Restart**.

> [tab] Codex CLI
>
> Add HeyGen's MCP server. Sign-in uses your HeyGen account, and usage draws on your plan's credits. Results show as text and links.
>
> **1. Add the server**
>
> Run this in your terminal:
>
> ```bash theme={null}
> codex mcp add heygen --url https://mcp.heygen.com/mcp/v1
> ```
>
> Keep `--url` and leave off the trailing slash: Codex needs both to find HeyGen's sign-in.
>
> **2. Connect your HeyGen account**
>
> Codex opens HeyGen in your browser. Approve access and you're set. To sign in again later, run `codex mcp login heygen`.
>
> **3. Ask for a video**
>
> ```text theme={null}
> Make a 60-second HeyGen explainer about our new API endpoints.
> ```
>
> Codex writes the script, picks the avatar, and renders the video. Finished videos also appear in **Projects** in HeyGen.
>
> > [accordion] Prefer the HeyGen CLI?
> >
> > Codex can run the [HeyGen CLI](https://heygen-1fa696a7.mintlify.site/cli.md) in your terminal instead. Install it and sign in:
> >
> > ```bash theme={null}
> > curl -fsSL https://static.heygen.ai/cli/install.sh | bash
> > heygen auth login
> > ```
> >
> > `heygen auth login` asks for an [API key](https://platform.heygen.com/api-keys), which uses API billing. To use your HeyGen plan instead, run `heygen auth login --oauth`. Then ask Codex to make a video and it calls `heygen` for you.

> [!NOTE]
>
> The Codex app and Codex CLI share MCP settings, so a server you add in one also appears in the other.

> [!TIP]
>
> If you set HeyGen up without the plugin, add [HeyGen Skills](https://heygen-1fa696a7.mintlify.site/skills/install.md) to Codex for sharper scripts and scene structure. The plugin already includes them.

> [accordion] Troubleshooting
>
> * **HeyGen tools missing after installing the plugin**: start a new chat. Plugins load when a chat starts.
> * **`No authorization support detected`**: the URL has a trailing slash. Run `codex mcp remove heygen`, then add it again with the command above.
> * **`OAuth login is only supported for streamable HTTP servers`**: the server was added without `--url`. Remove it and add it again with the command above.
> * **Tools missing after sign-in in Codex CLI**: restart Codex CLI.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.