Skip to main content
POST
/
v2
/
budgets
cURL
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"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create budget configuration for API key, contact, or workspace

type
enum<string>
required

API Key budget type

Available options:
api_key
Example:

"api_key"

entity_id
string
required

API Key token

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3Jrc3BhY2VJZCI6IjYxNGJiMTQ0LTE5NzgtNGMzNS05ODM1LWFkY2Q5NjM3ZmI2ZiIsImlzcyI6Im9ycSIsImlhdCI6MTc1NzA1NDE5Nn0..."

period
enum<string>
required

Budget period type

Available options:
daily,
weekly,
monthly,
yearly
Example:

"monthly"

amount
number
required

Budget amount in USD for the specified period

Required range: x >= 0
Example:

100

Response

Budget configuration created successfully

Budget configuration details

_id
string<ulid>
required

Unique ULID for the budget configuration

Example:

"01ARZ3NDEKTSV4RRFFQ69G5FAV"

workspace_id
string<uuid>
required

Workspace identifier that owns this budget configuration

Example:

"550e8400-e29b-41d4-a716-446655440000"

type
enum<string>
required

Budget entity type

Available options:
api_key,
contact,
workspace
Example:

"contact"

budget
object
required

Budget configuration

is_active
boolean
required

Whether this budget configuration is currently active

Example:

true

api_key_id
string<ulid>

API Key identifier (present when type is "api_key")

Example:

"01ARZ3NDEKTSV4RRFFQ69G5FAV"

contact_id
string

Contact external identifier (present when type is "contact")

Example:

"user_123"

consumption
object
created
default:2025-12-08T10:34:25.425Z

The date and time the resource was created

updated
default:2025-12-08T10:34:25.425Z

The date and time the resource was last updated