Skip to main content
PATCH
/
v2
/
budgets
/
{budget_id}
Update a budget
curl --request PATCH \
  --url https://api.orq.ai/v2/budgets/{budget_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "limits": {
    "amount": 123,
    "token_limit": "<string>"
  },
  "rate_limit": {
    "requests_per_minute": 123
  },
  "is_active": true,
  "expires_at": "2023-11-07T05:31:56Z",
  "clear_expires_at": true
}
'
{
  "budget": {
    "budget_id": "<string>",
    "workspace_id": "<string>",
    "scope": {
      "workspace": {},
      "project": {
        "project_id": "<string>"
      },
      "identity": {
        "identity_external_id": "<string>"
      },
      "api_key": {
        "api_key_id": "<string>"
      },
      "provider": {
        "provider": "<string>"
      },
      "model": {
        "model_id": "<string>"
      }
    },
    "limits": {
      "amount": 123,
      "token_limit": "<string>"
    },
    "rate_limit": {
      "requests_per_minute": 123
    },
    "is_active": true,
    "expires_at": "2023-11-07T05:31:56Z",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

budget_id
string
required

Budget id to update.

Body

application/json
limits
object

New limits. Omit to keep current.

rate_limit
object

New rate limit. Omit to keep current.

is_active
boolean

New active state. Omit to keep current.

expires_at
string<date-time>

New expiration. Omit to keep current. Set clear_expires_at = true to remove an existing expiration.

clear_expires_at
boolean

Force-clear the expiration. Mutually exclusive with expires_at.

Response

200 - application/json

OK

budget
object

Updated budget.