POST
/
providers
from portkey_ai import Portkey

# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)

# Add a new provider
new_provider = portkey.providers.create(
name="openai provider",
integration_id="",
workspace_id=""
)

print(new_provider)
{
  "id": "<string>",
  "slug": "<string>"
}

Authorizations

x-portkey-api-key
string
header
required

Body

application/json
name
string
required
integration_id
string
required

Integration slug used for the provider creation.

workspace_id
string<uuid>

optional, needed when using organisation admin API keys

slug
string

Slug for the provider. If not passed, slug will be created by adding a random suffix to the name.

note
string | null
usage_limits
object
Example:
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}
rate_limits
object
expires_at
string<date-time>

Response

200 - application/json

Successful response

id
string
slug
string