POST
/
virtual-keys
curl --request POST \
  --url https://api.portkey.ai/v1/virtual-keys \
  --header 'Content-Type: application/json' \
  --header 'x-portkey-api-key: <api-key>' \
  --data '{
  "name": "My first virtual key",
  "provider": "openai",
  "key": "sk-jhkfkjs8d9f7jksfghkjhfg",
  "note": "Virtual key description",
  "usage_limits": {
    "credit_limit": 10,
    "periodic_reset": "monthly",
    "alert_threshold": 9
  },
  "workspace_id": ""
}'

Authorizations

x-portkey-api-key
string
headerrequired

Body

application/json
name
string
provider
enum<string>
Available options:
openai,
azure-openai,
ai21,
anthropic,
anyscale,
azure-openai,
bedrock,
cohere,
deepinfra,
fireworks-ai,
google,
groq,
hugging-face,
jina,
lingyi,
mistral-ai,
monsterapi,
moonshot,
nomic,
novita-ai,
open-ai,
openrouter,
palm,
perplexity-ai,
predibase,
reka-ai,
segmind,
stability-ai,
together-ai,
vertex-ai,
workers-ai,
zhipu
key
string
note
string | null
apiVersion
string | null
resourceName
string | null
deploymentName
string | null
workspace_id
string

optional, needed when using organisation admin API keys

usage_limits
object

Response

200 - application/json
success
boolean
data
object