curl --request GET \
--url https://api.portkey.ai/v1/policies/usage-limits/{policyUsageLimitsId} \
--header 'x-portkey-api-key: <api-key>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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_days": 183,
"next_usage_reset_at": "2023-11-07T05:31:56Z",
"last_reset_at": "2023-11-07T05:31:56Z",
"value_key_usage_map": {},
"object": "policy_usage_limits"
}Retrieve Usage Limits Policy
Get a single usage limits policy by ID.
curl --request GET \
--url https://api.portkey.ai/v1/policies/usage-limits/{policyUsageLimitsId} \
--header 'x-portkey-api-key: <api-key>'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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_days": 183,
"next_usage_reset_at": "2023-11-07T05:31:56Z",
"last_reset_at": "2023-11-07T05:31:56Z",
"value_key_usage_map": {},
"object": "policy_usage_limits"
}Authorizations
Path Parameters
Usage limits policy UUID
Query Parameters
Filter by status
active, archived Include usage information for each value key
Response
Usage limits policy details
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
Show child attributes
Array of group by fields
Show child attributes
Show child attributes
Maximum usage allowed
Alert threshold
Reset period
monthly, weekly Reset the usage counter every N days (1-365). Mutually exclusive with periodic_reset.
1 <= x <= 365ISO 8601 datetime for the next scheduled usage reset. Populated for periodic_reset_days policies.
ISO 8601 datetime of the last usage reset.
Map of value keys to usage information (only included when include_usage=true)
Show child attributes
Show child attributes
"policy_usage_limits"
Was this page helpful?

