POST
/
virtual-keys
from portkey_ai import Portkey

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

# Add a new virtual key
new_virtual_key = portkey.virtual_keys.create(
    name="openaiVKey",
    provider="openai",
    key="PROVIDER_API_KEY"
)

print(new_virtual_key)
{
  "success": true,
  "data": {
    "slug": "<string>"
  }
}

Azure OpenAI

Create virtual key to access your Azure OpenAI models or deployments, and manage all auth in one place.

AWS Bedrock

Create virtual key to access your AWS Bedrock models or deployments, and manage all auth in one place.

Vertex AI

Create virtual key to access any models available or hosted on Vertex AI. Docs →

Learn More About Virtual Keys

Securely store your provider auth in Portkey vault and democratize and streamline access to Gen AI.

Authorizations

x-portkey-api-key
string
header
required

Body

application/json

Response

200
application/json
Successful response

The response is of type object.