Claude Platform Docs

有効な支出上限の一覧取得

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

各メンバーの実効支出上限と期間累計の支出を一覧表示します。

メンバーが支出上限を解決する(メンバー、期間)ごとに1行を返し、支出上限の継承元である source スコープを含みます。メンバー単位でページ分割されるため、1人のメンバーの期間が複数のページに分かれることはありません。Claude Enterprise 組織でのみサポートされ、Claude Console 組織ではサポートされません。

Parameters
query OrganizationSpendLimitEffectiveListParams
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 []SpendLimitPeriod 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 SpendLimitPeriodDaily SpendLimitPeriod = "daily"
const SpendLimitPeriodMonthly SpendLimitPeriod = "monthly"
const SpendLimitPeriodWeekly SpendLimitPeriod = "weekly"
UserIDs []string OptionalQuery parameter

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

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

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

Errors

Any method can also return the general HTTP errors.

ErrorCodeOrganizationTypeNotSupportedHTTP status 400error code organization_type_not_supported

The endpoint does not support the organization's type. Each endpoint's description says which organization types it supports.

有効な支出上限の一覧取得
package main

import (
	"context"
	"fmt"

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

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	page, err := client.Organization.SpendLimits.Effective.List(context.TODO(), anthropic.OrganizationSpendLimitEffectiveListParams{})
	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_01WxYzAbCdEfGhJkMnPqRsTu"
      },
      "amount": "50000",
      "currency": "USD",
      "period": "daily",
      "period_to_date_spend": "12050.5",
      "scope": {
        "type": "user",
        "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
      },
      "source": {
        "type": "user",
        "user_id": "user_01WxYzAbCdEfGhJkMnPqRsTu"
      },
      "spend_limit_id": "spend_limit_id"
    }
  ],
  "next_page": "next_page"
}