curl --request POST \
--url https://api.orq.ai/v2/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "api_key",
"entity_id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3Jrc3BhY2VJZCI6IjYxNGJiMTQ0LTE5NzgtNGMzNS05ODM1LWFkY2Q5NjM3ZmI2ZiIsImlzcyI6Im9ycSIsImlhdCI6MTc1NzA1NDE5Nn0...",
"period": "monthly",
"amount": 100
}
'{
"_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "contact",
"budget": {
"period": "monthly",
"amount": 250
},
"is_active": true,
"api_key_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"contact_id": "user_123",
"consumption": {
"current_amount": 125.5,
"remaining_amount": 124.5,
"period_start": "2024-01-01T00:00:00Z",
"period_end": "2024-01-31T23:59:59Z"
},
"created": "2025-12-08T10:34:25.425Z",
"updated": "2025-12-08T10:34:25.425Z"
}Create a new budget configuration for an API key, contact, or workspace. For API keys, provide the API key value (e.g., sk_live_xxx) in entity_id field. For contacts, provide the external ID in entity_id field. For workspaces, only the type field is required (entity_id is not needed). Only one budget can exist per workspace.
curl --request POST \
--url https://api.orq.ai/v2/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "api_key",
"entity_id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3Jrc3BhY2VJZCI6IjYxNGJiMTQ0LTE5NzgtNGMzNS05ODM1LWFkY2Q5NjM3ZmI2ZiIsImlzcyI6Im9ycSIsImlhdCI6MTc1NzA1NDE5Nn0...",
"period": "monthly",
"amount": 100
}
'{
"_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"workspace_id": "550e8400-e29b-41d4-a716-446655440000",
"type": "contact",
"budget": {
"period": "monthly",
"amount": 250
},
"is_active": true,
"api_key_id": "01ARZ3NDEKTSV4RRFFQ69G5FAV",
"contact_id": "user_123",
"consumption": {
"current_amount": 125.5,
"remaining_amount": 124.5,
"period_start": "2024-01-01T00:00:00Z",
"period_end": "2024-01-31T23:59:59Z"
},
"created": "2025-12-08T10:34:25.425Z",
"updated": "2025-12-08T10:34:25.425Z"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Create budget configuration for API key, contact, or workspace
API Key budget type
api_key "api_key"
API Key token
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3Jrc3BhY2VJZCI6IjYxNGJiMTQ0LTE5NzgtNGMzNS05ODM1LWFkY2Q5NjM3ZmI2ZiIsImlzcyI6Im9ycSIsImlhdCI6MTc1NzA1NDE5Nn0..."
Budget period type
daily, weekly, monthly, yearly "monthly"
Budget amount in USD for the specified period
x >= 0100
Budget configuration created successfully
Budget configuration details
Unique ULID for the budget configuration
"01ARZ3NDEKTSV4RRFFQ69G5FAV"
Workspace identifier that owns this budget configuration
"550e8400-e29b-41d4-a716-446655440000"
Budget entity type
api_key, contact, workspace "contact"
Whether this budget configuration is currently active
true
API Key identifier (present when type is "api_key")
"01ARZ3NDEKTSV4RRFFQ69G5FAV"
Contact external identifier (present when type is "contact")
"user_123"
Show child attributes
Current period consumption in USD
x >= 0125.5
Remaining budget (amount - current_amount)
124.5
When the current period started
"2024-01-01T00:00:00Z"
When the current period will reset
"2024-01-31T23:59:59Z"
The date and time the resource was created
The date and time the resource was last updated
Was this page helpful?