Skip to main content
Codex is an AI coding tool that runs in your terminal. You can connect Codex to Novita’s OpenAI-compatible LLM API endpoint and use Novita models for code understanding, generation, refactoring, and debugging tasks.
Codex currently supports the Responses API only. Configure wire_api = "responses" as shown below, and do not switch this integration to Chat Completions mode.
Prefer one command? Novita Connect starts Codex on Novita models with novi codex, without editing config.toml.

Prerequisites

Before you begin, prepare the following values:
  • API key: Create or copy an API key from Key Management.
  • Base URL: https://api.novita.ai/openai/v1
  • Model ID: Copy the model ID you want to use from the Model Hub, such as deepseek/deepseek-v4.1-flash.
Keep your API key private. Use it only in your local Codex configuration and never commit it to a Git repository.

Install Codex

Before installing Codex, make sure Node.js 18 or higher is installed on your machine. On macOS, if you use Homebrew, you can install Node.js with:
Check your Node.js and npm versions:
Install the Codex CLI:
Check the Codex version:

Configure your API key

Open your shell configuration file, for example ~/.zshrc:
Add the following environment variable:
Reload your shell configuration and confirm the variable is available:

Configure Codex

Open the Codex configuration file:
Add the following configuration, and replace model with the Novita model ID you want to use:

Start Codex

Go to your project directory and start Codex:
You can now enter a coding task, for example:
If Codex returns an authentication or model error, check that:
  • NOVITA_API_KEY is available in the current terminal session.
  • model exactly matches the Model ID in Novita’s Model Hub.
  • base_url is set to https://api.novita.ai/openai/v1.
Last modified on October 15, 2026