CyberRXN Docs
APIAPI reference

Set or remove a scoped spending policy

PUT /v1/limits

PUT /v1/limits

API overview · OpenAPI

Owners and admins with limits:manage only. Null means no cap; all null removes the policy. monthly_calls=0 blocks matching calls. A zero money cap blocks paid calls. Monthly periods use UTC.

Authorization

This operation requires a bearer credential. The description defines additional role, scope or first-party-session restrictions; an API key does not grant those permissions by itself.

Request body

PropertyTypeRequiredDetails
scope"workspace" ∣ "member" ∣ "key" ∣ "client"yes
subject_idstringyesEmpty for workspace; otherwise user ID, key ID or OAuth client ID.
monthly_callsinteger ∣ nullyes
monthly_budget_microusdinteger ∣ nullyes
max_call_microusdinteger ∣ nullyes
Full schema: SpendLimit
{
  "properties": {
    "scope": {
      "type": "string",
      "enum": [
        "workspace",
        "member",
        "key",
        "client"
      ],
      "title": "Scope"
    },
    "subject_id": {
      "type": "string",
      "title": "Subject Id",
      "description": "Empty for workspace; otherwise user ID, key ID or OAuth client ID."
    },
    "monthly_calls": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Monthly Calls"
    },
    "monthly_budget_microusd": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Monthly Budget Microusd"
    },
    "max_call_microusd": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 9007199254740991,
          "minimum": 0
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Call Microusd"
    }
  },
  "type": "object",
  "required": [
    "scope",
    "subject_id",
    "monthly_calls",
    "monthly_budget_microusd",
    "max_call_microusd"
  ],
  "title": "SpendLimit"
}

Responses

HTTPDetailsType
200Successful Responseapplication/json: SpendLimitList
401Unauthorizedapplication/problem+json: ProblemDetails
403Forbiddenapplication/problem+json: ProblemDetails
404Not Foundapplication/problem+json: ProblemDetails
422Unprocessable Entityapplication/problem+json: ProblemDetails

Response: SpendLimitList

PropertyTypeRequiredDetails
itemsSpendLimit[]yes
currencystringyes
microusd_per_usdintegeryes
Full schema
{
  "properties": {
    "items": {
      "items": {
        "$ref": "#/components/schemas/SpendLimit"
      },
      "type": "array",
      "title": "Items"
    },
    "currency": {
      "type": "string",
      "const": "USD",
      "title": "Currency"
    },
    "microusd_per_usd": {
      "type": "integer",
      "const": 1000000,
      "title": "Microusd Per Usd"
    }
  },
  "type": "object",
  "required": [
    "items",
    "currency",
    "microusd_per_usd"
  ],
  "title": "SpendLimitList"
}

This page is generated from OpenAPI; examples are schemas, not a fabricated successful response.

Usage and billing · Structured errors

On this page