Authorization header holds your gateway API key, and the model field is prefixed with the slug of the integration to use. @openai-prod/gpt-4o reads as the gpt-4o model, through the integration called openai-prod.
The base URL is
https://aigw.portkey.ai/v1. MCP Gateway serves /m and Agent Gateway serves /agent.Two ways in
An OpenAI-compatible SDK
Change the base URL and the API key on a client you already have. This is also how Langchain, LlamaIndex and most agent frameworks connect.
REST
Call the endpoints directly. Everything the SDKs do is available over plain HTTP.
Through an OpenAI SDK
Install the official client, then override two fields:default_headers / defaultHeaders.
Start here
Authentication
API keys, and JWT as an alternative
Headers
Every gateway header, and what each one changes
Config object
Routing, fallbacks, retries and caching as a single object
Supported providers
What can sit behind the gateway
Response schema
What comes back, and where the gateway adds to it
Error codes
Failures on the inference path

