from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY"
)
# List providers
# Optional workspace_id
providers = portkey.providers.list(workspace_id="")
print(providers){
"object": "list",
"total": 123,
"data": [
{
"name": "Open AI Workspace",
"integration_id": "<string>",
"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>",
"rate_limits": [
{
"type": "requests",
"unit": "rpd",
"value": 123
}
],
"expires_at": "2023-11-07T05:31:56Z",
"object": "provider"
}
]
}from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY"
)
# List providers
# Optional workspace_id
providers = portkey.providers.list(workspace_id="")
print(providers){
"object": "list",
"total": 123,
"data": [
{
"name": "Open AI Workspace",
"integration_id": "<string>",
"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>",
"rate_limits": [
{
"type": "requests",
"unit": "rpd",
"value": 123
}
],
"expires_at": "2023-11-07T05:31:56Z",
"object": "provider"
}
]
}Current page, defaults to 0
Page size, default to 50
Not required when using workspace API keys. Required when using organisation admin keys
Successful response
list Total number of providers
Show child attributes
"Open AI Workspace"
"randomness"
active, exhausted, expired Show child attributes
Credit Limit. Used for tracking usage
x >= 1Type of credit limit
cost, tokens Alert Threshold. Used for alerting when usage reaches more than this
x >= 1Reset the usage periodically.
monthly, weekly {
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}0
provider Was this page helpful?