Virtual Keys
List Virtual Key
API Reference
Virtual Keys
API Keys
Analytics [BETA]
- Summary
- Groups Paginated Data
- Graphs - Time Series Data
User Invites
Workspaces
Workspace Members
OpenAPI
List Virtual Key
GET
/
virtual-keys
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# List virtual keys
virtual_keys = portkey.virtual_keys.list()
print(virtual_keys)
{
"object": "list",
"total": 123,
"data": [
{
"name": "Open AI Workspace",
"note": "randomness",
"status": "active",
"usage_limits": {
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
},
"reset_usage": 0,
"created_at": "2023-11-07T05:31:56Z",
"slug": "<string>",
"model_config": {},
"rate_limits": [
{
"type": "requests",
"unit": "rpm",
"value": 123
}
],
"object": "virtual-key"
}
]
}
Authorizations
Response
200
application/json
Successful response
Available options:
list
Total number of virtual keys
Example:
"Open AI Workspace"
Example:
"randomness"
Available options:
active
, exhausted
Credit Limit. Used for tracking usage
Required range:
x >= 1
Alert Threshold. Used for alerting when usage reaches more than this
Required range:
x >= 1
Reset the usage periodically.
Available options:
monthly
Example:
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}
Example:
0
Available options:
virtual-key
Was this page helpful?
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# List virtual keys
virtual_keys = portkey.virtual_keys.list()
print(virtual_keys)
{
"object": "list",
"total": 123,
"data": [
{
"name": "Open AI Workspace",
"note": "randomness",
"status": "active",
"usage_limits": {
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
},
"reset_usage": 0,
"created_at": "2023-11-07T05:31:56Z",
"slug": "<string>",
"model_config": {},
"rate_limits": [
{
"type": "requests",
"unit": "rpm",
"value": 123
}
],
"object": "virtual-key"
}
]
}