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
POST
/
integrations
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>"
}Authorizations
Body
application/json
Human-readable name for the integration
Example:
"Production OpenAI"
ID of the base AI provider
Example:
"openai"
URL-friendly identifier (auto-generated if not provided)
Pattern:
^[a-zA-Z0-9_-]+$Example:
"production-openai"
API key for the provider (if required)
Example:
"sk-..."
Optional description of the integration
Example:
"Production OpenAI integration for customer-facing applications"
Workspace ID (for workspace-scoped integrations)
Example:
"ws-my-team-1234"
Provider-specific configuration object
- OpenAI
- Azure OpenAI
- AWS Bedrock
- Vertex AI
- Azure AI
- Workers AI
- AWS Sagemaker
- Hugginface
- Cortex
- Custom Base URL
Show child attributes
Show child attributes
Was this page helpful?

