Skip to main content
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

x-portkey-api-key
string
header
required

Body

application/json
name
string
required

Human-readable name for the integration

Example:

"Production OpenAI"

ai_provider_id
string
required

ID of the base AI provider

Example:

"openai"

slug
string

URL-friendly identifier (auto-generated if not provided)

Example:

"production-openai"

key
string

API key for the provider (if required)

Example:

"sk-..."

description
string

Optional description of the integration

Example:

"Production OpenAI integration for customer-facing applications"

workspace_id
string

Workspace ID (for workspace-scoped integrations)

Example:

"ws-my-team-1234"

configurations
object

Provider-specific configuration object

  • OpenAI
  • Azure OpenAI
  • AWS Bedrock
  • Vertex AI
  • Azure AI
  • Workers AI
  • AWS Sagemaker
  • Hugginface
  • Cortex
  • Custom Base URL

Response

200 - application/json

Successful response

id
string<UUID>
slug
string
I