Skip to main content
POST

Authorizations

x-portkey-api-key
string
header
required

Body

application/json
conditions
object[]
required

Array of conditions that define which requests the policy applies to

Minimum array length: 1
group_by
object[]
required

Array of group by fields that define how usage is aggregated

Minimum array length: 1
type
enum<string>
required

Policy type

Available options:
cost,
tokens
credit_limit
number
required

Maximum usage allowed

Required range: x >= 0
name
string

Policy name

Maximum string length: 255
Example:

"Monthly Cost Limit"

alert_threshold
number | null

Threshold at which to send alerts. Must be less than credit_limit.

Required range: x >= 0
periodic_reset
enum<string> | null

Reset period. If not provided, limit is cumulative.

Available options:
monthly,
weekly
workspace_id
string

Workspace ID or slug. Required if not using API key authentication.

organisation_id
string<uuid>

Organization ID. Required if not using API key authentication.

Response

Policy created successfully

id
string<uuid>

Created policy UUID

object
string

Resource type

Example:

"policy_usage_limits"

Last modified on April 8, 2026