Passthrough vs standard providers
| Feature | Regular Providers | Passthrough Provider |
|---|---|---|
| Parameter validation | Strict - only base signature parameters allowed | None - all parameters forwarded as-is |
| Request transformation | Portkey maps parameters to unified format | No transformation - request sent unchanged |
| Response transformation | Response is transformed to unified format | No transformation - response sent unchanged |
| Provider-specific params | May be rejected or ignored | Fully supported |
| Unified routes | Parameters normalized across providers | Original request body preserved |
| Header forwarding | Portkey manages headers | All non-x-portkey-* headers forwarded to endpoint |
| Target endpoint | Configured per provider | Set via x-portkey-custom-host header |
| Error handling | Standardized error responses | Raw provider errors returned |
| Use case | Cross-provider compatibility | Direct provider access with full control |
With standard providers like Anthropic or OpenAI, Portkey validates and transforms your request to match the expected API signature. With Passthrough, your request body is forwarded directly to the target endpoint without any modifications.
When to use Passthrough
- Provider-specific parameters: When you need to use parameters that aren’t in Portkey’s standard API signatures
- Direct API access: When you want to interact with a provider’s API exactly as documented
- Custom integrations: When working with endpoints or features not yet mapped by Portkey
- Debugging: When you need to see exactly what the provider receives
Quick start
cURL
Required headers
| Header | Description |
|---|---|
x-portkey-api-key | Your Portkey API key |
x-portkey-provider | Set to passthrough |
x-portkey-custom-host | The base URL of your target endpoint (e.g., https://my.vllm.com/v1) |
Header forwarding
All headers except those starting withx-portkey- are forwarded to the target endpoint. This includes:
authorization- Your target provider’s API keyContent-Type- Request content type- Any custom headers your endpoint requires
Configuration
Passthrough requires you to specify the target endpoint using thex-portkey-custom-host header. This tells Portkey where to forward your requests.
/chat/completions) is appended to this base URL.
How it works
When you use the Passthrough provider with any unified route (like/v1/chat/completions or /v1/messages), Portkey:
- Receives your request as-is without validating against standard parameter signatures
- Forwards the entire request body directly to the configured backend
- Returns the response from the provider without transformation
Example: Standard vs Passthrough
Standard provider (Anthropic):Header behavior
When you send a request through Passthrough:| Header type | Behavior |
|---|---|
x-portkey-* headers | Used by Portkey, not forwarded |
authorization | Forwarded to target endpoint |
Content-Type | Forwarded to target endpoint |
| Custom headers | Forwarded to target endpoint |
Supported routes
Passthrough works with all unified routes:/v1/chat/completions- Chat completions/v1/messages- Anthropic-style messages/v1/completions- Text completions/v1/embeddings- Embeddings- Any other supported endpoint
Use cases
Provider-specific features
Use parameters that are unique to a specific provider:Self-hosted vLLM or custom endpoints
Connect to your own vLLM deployment or any OpenAI-compatible endpoint:cURL
Gateway features
Passthrough requests still benefit from Portkey’s gateway features:- Observability: Full logging and monitoring of requests/responses
- Caching: Response caching works as expected
- Rate limiting: Budget and rate controls apply
- Retries: Automatic retry logic on failures
- Fallbacks: Configure fallback providers in your config

