Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions integrations/libraries/claude-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@ title: 'Claude Code'
description: 'Integrate Portkey with Claude Code for enterprise-grade AI coding assistance with observability, reliability, and governance'
---

### Universal provider (any model like gpt5.2, grok, kimi, etc)

You can use Claude Code with any model available through Portkey while keeping the same Anthropic-style `settings.json` structure.

Use the same setup as Anthropic, then swap:

- `x-portkey-provider` in `ANTHROPIC_CUSTOM_HEADERS` to your provider slug (for example, `@openai-prod`, `@xai-prod`, `@moonshot-prod`, etc.)
- `ANTHROPIC_MODEL` to your target model ID

```json
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.portkey.ai",
"ANTHROPIC_AUTH_TOKEN": "YOUR_PORTKEY_API_KEY",
"ANTHROPIC_CUSTOM_HEADERS": "x-portkey-api-key: YOUR_PORTKEY_API_KEY\nx-portkey-provider: @your-provider",
"ANTHROPIC_MODEL": "$YOUR_MODEL"
},
"model": "$YOUR_MODEL"
}
```

<Note>
`codex-5.3` models are currently not supported. Codex models require a Responses endpoint adapter, which is coming soon.
</Note>

[Claude Code](https://code.claude.com/docs/en/overview) is one of the most popular AI coding tools for boosting developer productivity. Platform teams use Portkey to roll out Claude Code across their organization—without handing out raw API keys or losing visibility into usage.

## Why Platform Teams Use Portkey
Expand Down