Skip to main content
The Portkey CLI sets up AI coding agent integrations from your terminal.
Or install globally:
Requirements: Node.js 18+ · Portkey account with at least one provider in Model Catalog

Source & full changelog

github.com/Portkey-AI/cli

What gets configured

Running npx portkey (or npx portkey setup) opens an interactive wizard. Choose which agent to configure:
  • Claude Code — sets ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_CUSTOM_HEADERS in ~/.claude/settings.json
  • Codex — writes base_url, PORTKEY_API_KEY, and wire_api into .codex/config.toml
  • Cursor (skills only) — syncs team skills to .cursor/skills/

Gateway routing

Every request appears in Portkey Logs with cost, latency, and full trace detail.
Claude Code and Codex requests logged in Portkey with cost and latency

MCP servers

Fetches your workspace’s MCP integrations and writes them to each agent’s config — your Portkey API key included in headers automatically.
  • Claude Code — written to ~/.claude.json / .mcp.json
  • Codex — written as [mcp_servers.*] blocks in .codex/config.toml
MCP integrations requiring upstream OAuth (e.g. Linear, Slack) are flagged during setup. For Claude Code, run /mcp to complete the OAuth flow. For Codex, run codex mcp login <server-name>.

Team skills

Syncs Prompt Partials from Portkey as SKILL.md files to the agent’s skills directory. Every developer runs one command and gets the same instructions.
Team skills stored as versioned prompt partials in Portkey

Commands


Non-interactive setup (CI / scripts)

Pass --yes to skip all prompts and use flags directly:
Available flags:

Refresh skills in CI


Next steps

Model Catalog

Configure providers and model access in Portkey

Portkey Configs

Fallbacks, load balancing, and routing strategies

Agent Skills

Create and sync team skills to every developer’s machine

MCP Gateway

Centralized auth and observability for MCP tool access
Last modified on April 21, 2026