Claude Platform Docs

Get Spend Limit

client.beta.organization.spendLimits.retrieve(spendLimitID, options?): BetaSpendLimit
GET/v1/organizations/spend_limits/{spend_limit_id}

Retrieve a spend limit by ID.

Parameters
spendLimitID: string⁠Path parameter

ID of the Spend Limit.

Returns
interface BetaSpendLimit { type: "spend_limit"; id; amount; /* 6 more */ }

A configured spend limit: a cap on metered spend for one scope and period.

Errors

Any method can also return the general HTTP errors.

BetaSpendLimitsAdminAPIWritesNotEnabledErrorHTTP status 403error code spend_limits_admin_api_writes_not_enabled

The organization cannot retrieve, set or delete spend limits with an Admin API credential.

Get Spend Limit
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});

const betaSpendLimit = await client.beta.organization.spendLimits.retrieve("spend_limit_id");

console.log(betaSpendLimit.id);
Returns Examples
Response 200
{
  "id": "id",
  "amount": "50000",
  "created_at": "2019-12-27T18:11:19.117Z",
  "currency": "USD",
  "is_enabled": true,
  "period": "daily",
  "scope": {
    "type": "user",
    "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
  },
  "type": "spend_limit",
  "updated_at": "2019-12-27T18:11:19.117Z"
}