curl --request GET \
--url https://api.portkey.ai/v1/policies/usage-limits \
--header 'x-portkey-api-key: <api-key>'{
"object": "list",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "cost",
"status": "active",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"last_updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"conditions": [
{
"key": "workspace_id",
"value": "workspace-123"
}
],
"group_by": [
{
"key": "api_key"
}
],
"credit_limit": 123,
"alert_threshold": 123,
"periodic_reset": "monthly",
"value_key_usage_map": {}
}
],
"total": 123
}List all usage limits policies with optional filtering.
curl --request GET \
--url https://api.portkey.ai/v1/policies/usage-limits \
--header 'x-portkey-api-key: <api-key>'{
"object": "list",
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "cost",
"status": "active",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"last_updated_at": "2023-11-07T05:31:56Z",
"name": "<string>",
"conditions": [
{
"key": "workspace_id",
"value": "workspace-123"
}
],
"group_by": [
{
"key": "api_key"
}
],
"credit_limit": 123,
"alert_threshold": 123,
"periodic_reset": "monthly",
"value_key_usage_map": {}
}
],
"total": 123
}Workspace ID or slug
Filter by status
active, archived Filter by policy type
cost, tokens Number of items per page
x >= 0Current page number
x >= 0List of usage limits policies
"list"
Show child attributes
Policy UUID
Policy type
cost, tokens Policy status
active, archived Workspace UUID
Organization UUID
Creation timestamp
Last update timestamp
Policy name
Array of conditions
Show child attributes
Condition key. Valid values:
api_key - Apply to a specific API keyorganisation_id - Apply to an organizationworkspace_id - Apply to a workspacemetadata.* - Apply based on custom metadata fields (e.g., metadata.user_id, metadata.team)"workspace_id"
Condition value
"workspace-123"
Maximum usage allowed
Alert threshold
Reset period
monthly, weekly Map of value keys to usage information (only included when include_usage=true)
Show child attributes
Show child attributes
Current usage value
Usage status
active, exhausted Whether threshold alerts have been sent
Whether exhausted alerts have been sent
Total number of policies
Was this page helpful?