GET /v1/models
Returns the list of models available from the configured provider. When a provider, virtual key, or config is specified in the request headers, the gateway forwards the request to that provider and returns its model list directly.
If no provider is specified and a Portkey control-plane URL is configured (ALBUS_BASEPATH), the gateway proxies the request to the Portkey platform to retrieve the available models across your configured integrations.
Request
The provider to retrieve models from (e.g.
openai, anthropic, azure-openai). When provided, the gateway forwards the request directly to the provider.Your Portkey API key, or the provider API key if using provider headers directly.
A Portkey virtual key. When set, the gateway routes to the provider associated with that virtual key.
A Portkey config object or config ID. The gateway reads the
provider or virtual_key from the config to determine the target.Response
Always
list.Examples
Routing behavior
ThemodelsHandler determines where to send the request based on the following precedence:
- Provider header present (
x-portkey-provider,x-portkey-virtual-key, orprovider/virtual_keyin config) — forwards the request to that specific provider’s models endpoint. - No provider specified with
ALBUS_BASEPATHconfigured — proxies to the Portkey control plane at/v2/modelsto retrieve the aggregated model list across your integrations. - No provider and no control plane — the request falls through to the next middleware handler.
When using virtual keys, the gateway resolves the underlying provider credentials automatically. You do not need to pass a separate provider API key.