This guide takes you from a fresh Claude Desktop install to a fully-routed connection through Portkey in about five minutes. After setup, every conversation flows through your organization’s gateway with approved model routing, policy enforcement, and cost tracking.Documentation Index
Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
What you need before starting
Get these three values from your platform admin. If you’re a solo builder, follow the Platform Admin Guide first to create them yourself.Gateway URL
https://api.portkey.ai for Portkey SaaS, or your custom URL if your org self-hosts. Confirm with your admin.Portkey API Key
Metadata Template
x-portkey-metadata headerConnect Claude Desktop to Portkey
Enable Developer mode

Set the Gateway connection
| Field | Value |
|---|---|
| Gateway base URL | https://api.portkey.ai |
| Gateway API key | Your Portkey API key |
| Gateway auth scheme | bearer |

Add the metadata header
| Field | Value |
|---|---|
| Header name | x-portkey-metadata |
| Header value | (your metadata JSON) |

Verify it works
Send any prompt in Claude Desktop, then run through these two checks.Confirm the request reached Portkey

Troubleshooting
Why am I getting a 401 or 403 error?
Why am I getting a 401 or 403 error?
Why aren't my requests appearing in Logs?
Why aren't my requests appearing in Logs?
- Base URL is correct:
https://api.portkey.aifor Portkey SaaS, or your org’s self-hosted gateway URL. No trailing slash, no/v1. - Auth scheme is set to
bearer. - You fully quit and relaunched Claude Desktop after applying settings (not just closed the window).
Why isn't my policy applying?
Why isn't my policy applying?
Why is the wrong model responding?
Why is the wrong model responding?
Why doesn't Configure third-party inference appear in my menu?
Why doesn't Configure third-party inference appear in my menu?
FAQ
Does this work on both macOS and Windows?
Does this work on both macOS and Windows?
Can I still use Claude Cowork while routed through Portkey?
Can I still use Claude Cowork while routed through Portkey?
Will routing through Portkey slow down responses?
Will routing through Portkey slow down responses?
What happens if Portkey is unreachable?
What happens if Portkey is unreachable?
Can I use this with a personal Claude account?
Can I use this with a personal Claude account?
Does Claude Desktop store my Portkey API key securely?
Does Claude Desktop store my Portkey API key securely?
My org runs Portkey on-prem. What URL do I use?
My org runs Portkey on-prem. What URL do I use?
api.portkey.ai. Everything else in this guide stays the same: same auth scheme, same metadata header, same setup flow.


