Base URL
When running locally with
npx @portkey-ai/gateway, the gateway listens on http://localhost:8787/v1. The console UI is available at http://localhost:8787/public/.Request requirements
Every request must include either:x-portkey-provider— to route directly to a single provider, orx-portkey-config— to use a routing config (fallback, load balancing, guardrails, etc.)
Endpoints
OpenAI compatibility
The gateway is a drop-in replacement for the OpenAI API base URL. To migrate an existing OpenAI integration:- Change the base URL to
http://localhost:8787/v1(local) or your deployed gateway URL. - Add the
x-portkey-providerheader to specify which provider to route to. - Add an
Authorizationheader with the provider API key.
Provider passthrough
For endpoints not explicitly handled by the gateway, requests to/v1/* are forwarded directly to the configured provider. This enables access to provider-specific endpoints beyond the standard OpenAI surface.