Route Claude Code through Portkey for logging, caching, and guardrails.
npx portkey setupThat's it! The wizard will:
- Ask for your Portkey API key
- Let you pick a provider from your Model Catalog
- Write the config to your shell
Then run source ~/.zshrc (or open a new terminal) and start using Claude Code.
npx portkey setup # Configure Claude Code → Portkey
npx portkey discover # See where config is set
npx portkey verify # Test the connection
npx portkey uninstall # Remove Portkey configFor CI or scripting:
npx portkey setup --portkey-key pk-xxx --provider ant --yes| Flag | Description |
|---|---|
--portkey-key |
Portkey API key |
--provider |
Provider slug from Model Catalog (e.g., ant) |
--config |
Use a Portkey Config instead of provider |
--gateway |
Custom gateway URL |
--location |
Where to save: env, global, project-local, project-shared |
--advanced |
Show all options (model, location, gateway) |
--yes |
Skip confirmations |
For Bedrock or Vertex providers, the wizard will ask you to select model names since they differ from Anthropic's naming.
- Node.js >= 18
- Portkey account