from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a new integration
integration = portkey.integrations.create(
name="openai-production",
ai_provider_id="openai",
key="sk-..."
)
print(integration){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>"
}Create Integration
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a new integration
integration = portkey.integrations.create(
name="openai-production",
ai_provider_id="openai",
key="sk-..."
)
print(integration){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>"
}Portkey is now PRISMA AIRS AI Gateway. See it in action.
Model provisioning (beta)
Control how models are provisioned on a new Integration at creation time by opting into a beta feature with thex-portkey-beta header:
x-portkey-beta: model-provisioning-2026-09-02
| Field | Type | Default | Description |
|---|---|---|---|
enable_all_current_models | boolean | false | Enables every model the provider currently offers at creation. When false, those models are attached to the Integration but left disabled, so you can enable only the ones you need. |
auto_enable_new_models | boolean | false | Determines whether models the provider adds later are automatically enabled on this Integration. |
Example
curl -X POST "https://api.portkey.ai/v1/integrations" \
-H "Content-Type: application/json" \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-beta: model-provisioning-2026-09-02" \
-d '{
"name": "OpenAI Production",
"slug": "openai-prod",
"ai_provider_id": "openai",
"enable_all_current_models": true,
"auto_enable_new_models": false
}'
Authorizations
Body
Human-readable name for the integration
"Production OpenAI"
ID of the base AI provider
"openai"
URL-friendly identifier (auto-generated if not provided)
^[a-zA-Z0-9_-]+$"production-openai"
API key for the provider (if required)
"sk-..."
Optional description of the integration
"Production OpenAI integration for customer-facing applications"
Workspace ID (for workspace-scoped integrations)
"ws-my-team-1234"
Configuration for OpenAI integrations. Supports three authentication modes
selected via provider_auth_type:
- apiKey (default) – standard API-key auth; no extra fields required.
- oauthClientCredentials – Portkey obtains an access token from your IdP using the OAuth 2.0 client-credentials grant and forwards it to OpenAI.
- wif (Workload Identity Federation) – Portkey mints a subject JWT via your configured IdP and exchanges it at OpenAI's WIF token endpoint.
- OpenAI
- Anthropic
- Azure OpenAI
- AWS Bedrock
- Vertex AI
- Azure AI
- Workers AI
- AWS Sagemaker
- Hugginface
- Cortex
- Custom Base URL
Show child attributes
Show child attributes
Key-value tags to associate with the integration.
Show child attributes
Show child attributes
Whether to automatically create a default provider when creating a workspace-scoped integration. Defaults to true.
Custom slug for the auto-created default provider. Only applicable for workspace-scoped integrations. If the slug already exists in the workspace, the request will fail with a validation error.
255^[a-zA-Z0-9_-]+$Dynamically resolve secrets from secret references at runtime. Valid target_field values are "key" or "configurations." (e.g. "configurations.aws_secret_access_key", "configurations.azure_entra_client_secret"). Each target_field must be unique. When "key" is mapped, the key body field can be omitted.
Show child attributes
Show child attributes
Per-Integration pricing adjustments applied on top of Portkey's base model pricing for cost tracking, analytics, and budget limits. Use to reflect negotiated discounts, committed-use rates, or internal markups for cost showback.
Show child attributes
Show child attributes
{
"multiplier": {
"default": 0.8,
"cache_read_input_token": 0.9,
"cache_write_input_token": 0.9
}
}
Was this page helpful?

