Add usage tracking, cost controls, and security guardrails to your Codex CLI deployment
Create Virtual Key
Create Default Config
Configure Portkey API Key
Step 2
~/.codex/config.json
:Note: This command sets the key only for your current terminal session. You can add theexport
line to your shell’s configuration file (e.g.,~/.zshrc
) for persistence, or place it in a.env
file at the root of your project.
Step 1: Implement Budget Controls & Rate Limits
Step 2: Define Model Access Rules
Step 3: Implement Access Controls
Step 4: Deploy & Monitor
virtual_key
in your default config
object.
How do I update my Virtual Key limits after creation?
Can I use multiple LLM providers with the same API key?
How do I track costs for different teams?
What happens if a team exceeds their budget limit?
Can I use Portkey with the open source version of Codex CLI?