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
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?"While you're here, why not give us a star on GitHub? It helps us a lot!
SDK Integration
npm install @openai/codex-sdkInitialize 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.
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
AI Gateway Overview
Learn more about CoreValue's AI Gateway and its features
Responses API Support
Use the OpenAI Responses API format through CoreValue AI Gateway
Provider Routing
Configure automatic routing and fallbacks for reliability
Custom Properties
Add metadata to your requests for better tracking and organization