PUT/api/orgs/{org_id}/trace-tags/budget

Set the checks budget

A monthly cap on what AI checks draw from your credits (null for none) and, optionally, AI judge calls per second. When this month's draw would pass the cap, AI checks stop until the next month (state cap_reached). Rule checks are free and never stop for the cap.

Authentication: Bearer API key in the Authorization header

Path parameters

  • org_idstringrequired

    Your organization id (uuid). GET /api/whoami returns it.

Request body

  • monthly_cap_nano_usdinteger | nullrequired

    This UTC month's cap on what AI checks draw, nano-USD; null for none.

  • calls_per_secondnumber | null

    0.1 to 20; default 2.

Responses

  • 200

    The budget.

    Response
    • calls_per_secondnumber
    • monthly_cap_nano_usdinteger | null
    • month_spend_nano_usdinteger
    • month_callsinteger
    • stateenum

      Why checks are paused, if they are. Checks never retry in a loop: a paused organization is checked again after 10 minutes.

      "running""cap_reached""needs_credits""needs_verification""capture_off""account_restricted""staff_only""paused"
    • judge_modelsarray<object>

      The judges this organization may pick, AI and Rule.

      judge_models
      • slugstring
      • labelstring
      • price_per_span_nano_usdinteger
    • ai_checksobject | null

      Your plan's AI check terms. One AI check per judgment, a request or a session judged, however many AI checks score it; a retry counts nothing. Rule checks are free.

      ai_checks
      • plan_billingboolean

        Whether these terms are in effect.

      • included_per_monthinteger | null

        AI-checked requests or sessions included each month, one per judgment. 0 on Free, which has no AI checks.

      • nano_usd_per_checkinteger | null

        The price of one AI check (one judgment) past the included amount, in nano-USD. Null when there is none and AI checks pause there.

      • used_this_monthinteger

        AI checks (judgments) this UTC month.

  • 401

    Missing, unknown or revoked API key.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 403

    The key is valid but may not perform this action (for example an inference key on a provisioning-key route, or a feature outside your plan).

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 404

    The resource does not exist or belongs to another organization.

    Response
    • errorstringrequired

      Human-readable message.

    • codestring

      Stable machine reason, when the route defines one (for example pro_required).

    • actionstring

      Stable remediation action, when the route defines one.

    • detailsobject

      Customer-safe string facts the caller needs to act (for example a suggested identifier).

  • 422

    The body or query failed validation.

    Response
    • detailarray<object>required
      detail
      • typestring
      • locarray<string | integer>
      • msgstring

Request

curl -X PUT 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/trace-tags/budget' \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "monthly_cap_nano_usd": 50000000000,
  "calls_per_second": 2
}'

Response

{
  "calls_per_second": 2,
  "monthly_cap_nano_usd": 50000000000,
  "month_spend_nano_usd": 1820000000,
  "month_calls": 9120,
  "state": "running",
  "judge_models": [
    {
      "slug": "deterministic-rules",
      "label": "Rule",
      "price_per_span_nano_usd": 0
    }
  ],
  "ai_checks": {
    "plan_billing": true,
    "included_per_month": 6500,
    "nano_usd_per_check": 550000,
    "used_this_month": 1840
  }
}

https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/trace-tags/budget