AI GatewayIntegrations

OpenAI Codex

Use OpenAI Codex CLI and SDK with CoreValue AI Gateway to log your coding agent interactions.

This integration uses the AI Gateway, which provides a unified API for multiple LLM providers. The AI Gateway is currently in beta.

CLI Integration

Log into CoreValue or create an account. Once you have an account, you can generate an API key here.

Update your $CODEX_HOME/.codex/config.toml file to include the CoreValue provider configuration:

$CODEX_HOME is typically ~/.codex on Mac or Linux.

model_provider = "corevalue"

[model_providers.corevalue]
name = "CoreValue"
base_url = "https://gateway.corevalue.dev/v1"
env_key = "COVA_API_KEY"
wire_api = "chat"

Set the COVA_API_KEY environment variable:

export COVA_API_KEY=<your-corevalue-api-key>

Use Codex as normal. Your requests will automatically be logged to CoreValue:

# If you set model_provider in config.toml
codex "What files are in the current directory?"

# Or specify the provider explicitly
codex -c model_provider="corevalue" "What files are in the current directory?"
With the above setup, any calls to Codex CLI will automatically be logged and monitored by CoreValue. Review them in your CoreValue dashboard.

While you're here, why not give us a star on GitHub? It helps us a lot!

SDK Integration

Log into CoreValue or create an account. Once you have an account, you can generate an API key here.
npm install @openai/codex-sdk

Initialize the Codex SDK with the AI Gateway base URL:

import { Codex } from "@openai/codex-sdk";

const codex = new Codex({
  baseUrl: "https://gateway.corevalue.dev/v1",
  apiKey: process.env.COVA_API_KEY,
});

const thread = codex.startThread({
  model: "gpt-5" // many models supported
});
const turn = await thread.run("What files are in the current directory?");

console.log(turn.finalResponse);
console.log(turn.items);

The Codex SDK doesn't currently support specifying the wire API, so it will use the Responses API by default. This works with the AI Gateway with limited model and provider support. See the Responses API documentation for more details.

With the above setup, any calls to Codex SDK will automatically be logged and monitored by CoreValue. Review them in your CoreValue dashboard.

Additional Features

Once integrated with CoreValue AI Gateway, you can take advantage of:

  • Unified Observability: Monitor all your Codex usage alongside other LLM providers
  • Cost Tracking: Track costs across different models and providers
  • Custom Properties: Add metadata to your requests for better organization
  • Rate Limiting: Control usage and prevent abuse

Request a CoreValue Integration

Looking for a framework or tool not listed here? Request it here!

Related Guides

On this page