Skip to content
ndStill is in development. These docs describe the v2 API as designed; the SDKs and the hosted MCP server are previews and not generally available.
Docs

Budgets API

Spend limits per window for each scope, with what is spent and what is reserved.

3 endpointsGenerated from the typed registry

Base URL https://api.ndstill.com/v2. Send Authorization: Bearer with a key, Ndstill-Version: 2026-11-01, and an Idempotency-Key on every POST. Conventions, scopes and errors are in the API overview and Errors and decline reasons. Examples come from the mock backend; the shapes are the TypeScript types in packages/api.

List budgets#

GET/v2/budgets
Query parameters all optional
  • scope_kindstring enum
    "team""org""agent""credential""tree""funding_source"
  • scope_idId
  • windowstring enum
    "day""week""month""quarter""total"
  • cursorstring
  • limitnumber

    1–200, default 50.

  • qstring

    Free-text search over names, ids and descriptors.

  • sortstring

    Sort field, prefix "-" for descending ("-created_at" is the default).

  • created_gteTimestamp

    created_at >= (ISO).

  • created_lteTimestamp

    created_at <= (ISO).

Response list of Budget

Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:

  • idId
  • object"budget"
  • org_idId
  • created_atTimestamp
  • updated_atTimestampoptional
  • test_modebooleanoptional

    True for test-mode objects (simulations, sandbox).

  • namestring
  • scopeScope
    Scope: 3 fields
    • kindScopeKind
      "team""org""agent""credential""tree""funding_source"
    • idId
    • namestring
  • windowBudgetWindow
    "day""week""month""quarter""total"
  • window_startTimestamp

    Calendar window start (budgets roll over at the policy's time zone).

  • window_endTimestamp
  • limitMoney

    An amount: integer minor units + asset.

    Money: 2 fields
    • amountnumber
    • assetAssetCode
      "USD""USDC""EUR""GBP"
  • reservedMoney

    Held for in-flight payments (pending reservations).

    Money: 2 fields
    • amountnumber
    • assetAssetCode
      "USD""USDC""EUR""GBP"
  • spentMoney

    An amount: integer minor units + asset.

    Money: 2 fields
    • amountnumber
    • assetAssetCode
      "USD""USDC""EUR""GBP"
  • remainingMoney

    An amount: integer minor units + asset.

    Money: 2 fields
    • amountnumber
    • assetAssetCode
      "USD""USDC""EUR""GBP"
  • forecast_breach_atTimestamp | null

    Forecast breach date at the current burn rate; null when not on track to breach.

  • parent_budget_idId | null
  • policy_idId | null
Errors
  • 400invalid_request

    A query parameter is invalid.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/budgets?limit=2" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "object": "list",
  "data": [
    {
      "id": "bud_01KQZY6YME8M060ZN6WTNXWKJH",
      "object": "budget",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-05-07T00:43:11.374Z",
      "name": "Ad buyer daily",
      "scope": {
        "kind": "agent",
        "id": "agt_01KW0P2WME52Y6RB8NQX9XBJ35",
        "name": "Ad buyer"
      },
      "window": "day",
      "limit": {
        "amount": 333333,
        "asset": "USD"
      },
      "parent_budget_id": "bud_01KQZY6YMEN4WQRT5EVFXA7VCH",
      "policy_id": null,
      "window_start": "2026-11-23T00:00:00.000Z",
      "window_end": "2026-11-24T00:00:00.000Z",
      "reserved": {
        "amount": 0,
        "asset": "USD"
      },
      "spent": {
        "amount": 0,
        "asset": "USD"
      },
      "remaining": {
        "amount": 333333,
        "asset": "USD"
      },
      "forecast_breach_at": null
    },
    {
      "id": "bud_01KQZY6YME12J1Y9H7E308KHPQ",
      "object": "budget",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-05-07T00:43:11.374Z",
      "name": "Invoice payer weekly",
      "scope": {
        "kind": "agent",
        "id": "agt_01KXX2ZXGEHCQDDER8JPXBWH4F",
        "name": "Invoice payer"
      },
      "window": "week",
      "limit": {
        "amount": 1562500,
        "asset": "USD"
      },
      "parent_budget_id": "bud_01KQZY6YME1DHRD5PGCAAGD0SJ",
      "policy_id": null,
      "window_start": "2026-11-23T00:00:00.000Z",
      "window_end": "2026-11-30T00:00:00.000Z",
      "reserved": {
        "amount": 0,
        "asset": "USD"
      },
      "spent": {
        "amount": 0,
        "asset": "USD"
      },
      "remaining": {
        "amount": 1562500,
        "asset": "USD"
      },
      "forecast_breach_at": null
    }
  ],
  "has_more": true,
  "next_cursor": "Mg==",
  "total": 97
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Retrieve a budget#

GET/v2/budgets/{id}
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response Budget

The same Budget object as List budgets.

Errors
  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/budgets/bud_01KQZY6YME8M060ZN6WTNXWKJH" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "id": "bud_01KQZY6YME8M060ZN6WTNXWKJH",
  "object": "budget",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-05-07T00:43:11.374Z",
  "name": "Ad buyer daily",
  "scope": {
    "kind": "agent",
    "id": "agt_01KW0P2WME52Y6RB8NQX9XBJ35",
    "name": "Ad buyer"
  },
  "window": "day",
  "limit": {
    "amount": 333333,
    "asset": "USD"
  },
  "parent_budget_id": "bud_01KQZY6YMEN4WQRT5EVFXA7VCH",
  "policy_id": null,
  "window_start": "2026-11-23T00:00:00.000Z",
  "window_end": "2026-11-24T00:00:00.000Z",
  "reserved": {
    "amount": 0,
    "asset": "USD"
  },
  "spent": {
    "amount": 0,
    "asset": "USD"
  },
  "remaining": {
    "amount": 333333,
    "asset": "USD"
  },
  "forecast_breach_at": null
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Update a budget#

PATCH/v2/budgets/{id}
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Request body BudgetUpdate
  • limitMoney

    An amount: integer minor units + asset.

    Money: 2 fields
    • amountnumberrequired
    • assetAssetCoderequired
      "USD""USDC""EUR""GBP"
  • step_upstring
Response Budget

The same Budget object as List budgets.

Errors
  • 400invalid_request

    A field is missing or invalid; fields names each one.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X PATCH "https://api.ndstill.com/v2/budgets/bud_01KQZY6YME8M060ZN6WTNXWKJH" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
{
  "id": "bud_01KQZY6YME8M060ZN6WTNXWKJH",
  "object": "budget",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-05-07T00:43:11.374Z",
  "name": "Ad buyer daily",
  "scope": {
    "kind": "agent",
    "id": "agt_01KW0P2WME52Y6RB8NQX9XBJ35",
    "name": "Ad buyer"
  },
  "window": "day",
  "limit": {
    "amount": 333333,
    "asset": "USD"
  },
  "parent_budget_id": "bud_01KQZY6YMEN4WQRT5EVFXA7VCH",
  "policy_id": null,
  "window_start": "2026-11-23T00:00:00.000Z",
  "window_end": "2026-11-24T00:00:00.000Z",
  "reserved": {
    "amount": 0,
    "asset": "USD"
  },
  "spent": {
    "amount": 0,
    "asset": "USD"
  },
  "remaining": {
    "amount": 333333,
    "asset": "USD"
  },
  "forecast_breach_at": null
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.