Skip to content
EN

Use your ChatGPT subscription with Mandri from the terminal

Connect your ChatGPT account through the Mandri CLI, then launch Codex with a model from that account. You need ChatGPT access to Codex. Your plan’s access and usage limits apply; API billing is separate. See the OpenAI authentication guide.

Terminal window
mandri provider add chatgpt --kind chatgpt

Mandri opens your browser and displays an authorization link in the terminal. Sign in and authorize the connection, then return to the terminal. No API key is required. Mandri creates its own session without changing an existing Codex CLI or IDE sign-in.

If the browser cannot open automatically, open the displayed link yourself. If the automatic return fails, the CLI lets you paste the complete redirect URL into its interactive prompt. Keep that address within your active sign-in flow.

The command reports chatgpt chatgpt verified when registration completes. For another account, use a different provider name with --kind chatgpt.

Terminal window
mandri provider models chatgpt

Copy a model ID from the catalog. Replace <model-id> below, then run from your project folder:

Terminal window
mandri run --model "chatgpt/<model-id>" codex

Codex is included with Mandri. Enter your request when its terminal interface opens and respond to its approval prompts. Review its file changes before keeping them.

The sign-in link expires: run the add command again to start a new sign-in.

The provider name is already used: choose another name for the connection. Use that name in both the model-list command and the model reference.

The model request is refused: check your account’s access and usage limits. The catalog lists models; it does not verify access to every request.

For the graphical interface, see Use your ChatGPT subscription in the app.