Claude Platform Docs

Listar limites de gastos efetivos

client.Beta.Organization.SpendLimits.Effective.List(ctx, query) (*PageCursor[BetaSpendSummary], error)
GET/v1/organizations/spend_limits/effective

Lista o limite de gastos efetivo de cada membro e os gastos acumulados no período.

Retorna uma linha por (membro, período) para o qual o membro resolve um limite de gastos, com o escopo source do qual o limite de gastos foi herdado. A paginação é feita por membro, de modo que os períodos de um membro nunca são divididos entre páginas. Compatível apenas com organizações do Claude Enterprise, não com organizações do Claude Console.

Parameters
query BetaOrganizationSpendLimitEffectiveListParams
Limit param.Opt[int64] OptionalQuery parameter

Maximum number of members per page. A member's period rows never split across pages, so a page may carry more rows than this. Defaults to 20.

minimum1
maximum1000
Page param.Opt[string] OptionalQuery parameter

Opaque cursor from a previous response's next_page field.

Period []string OptionalQuery parameter

Restrict the report to these limit periods. Omit to return one row per period each member resolves a spend limit for.

maxItems3
const BetaOrganizationSpendLimitEffectiveListParamsPeriodDaily BetaOrganizationSpendLimitEffectiveListParamsPeriod = "daily"
const BetaOrganizationSpendLimitEffectiveListParamsPeriodMonthly BetaOrganizationSpendLimitEffectiveListParamsPeriod = "monthly"
const BetaOrganizationSpendLimitEffectiveListParamsPeriodWeekly BetaOrganizationSpendLimitEffectiveListParamsPeriod = "weekly"
UserIDs []string OptionalQuery parameter

Restrict the report to these members, by tagged user ID (user_...). At most 100 entries.

maxItems100
Returns
type BetaSpendSummary struct { Actor; Amount; Currency; /* 5 more */ }

Per-member effective-limit report row (GET /spend_limits/effective).

Listar limites de gastos efetivos
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Beta.Organization.SpendLimits.Effective.List(context.TODO(), anthropic.BetaOrganizationSpendLimitEffectiveListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
Returns Examples
Response 200
{
  "data": [
    {
      "actor": {
        "deleted": true,
        "email_address": "email_address",
        "name": "name",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "amount": "50000",
      "currency": "USD",
      "period": "daily",
      "period_to_date_spend": "12050.5",
      "scope": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "source": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "spend_limit_id": "spend_limit_id"
    }
  ],
  "next_page": "next_page"
}