Claude Platform Docs

Approuver une demande d'augmentation de limite de dépenses

client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(ctx, spendLimitIncreaseRequestID, body) (*BetaOrganizationSpendLimitIncreaseRequestApproveResponse, error)
POST/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve

Approuver une demande d'augmentation de limite de dépenses en attente.

Écrit une limite de dépenses par utilisateur de amount pour le demandeur et fait passer la demande à approved. period prend par défaut la période sur laquelle le membre était bloqué. Anthropic envoie un e-mail au demandeur sauf si suppress_notification est défini.

Parameters
spendLimitIncreaseRequestID string⁠Path parameter

ID of the spend limit increase request.

body BetaOrganizationSpendLimitIncreaseRequestApproveParams
Amount string

New per-user spend limit as a non-negative integer decimal string (minor units).

Period BetaSpendLimitPeriod Optional
SuppressNotification param.Opt[bool] Optional
Returns
type BetaOrganizationSpendLimitIncreaseRequestApproveResponse struct { Type: "spend_limit_increase_request"; ID; Actor; /* 7 more */ }
Type SpendLimitIncreaseRequest
defaultspend_limit_increase_request
ID string
Actor BetaOrganizationSpendLimitIncreaseRequestApproveResponseActorUnion
One of the following:
type BetaSpendLimitUserActor struct { Type: "user_actor"; Deleted; EmailAddress; /* 2 more */ }

A user within the organization. name and email_address are null when the underlying account is unavailable or has been deleted; deleted is true only for deleted accounts.

Type UserActor

Actor type. Always user_actor.

defaultuser_actor
Deleted bool

True only when the underlying account has been deleted.

defaultfalse
EmailAddress string

The user's email address. Null when the account is unavailable or has been deleted.

Name string

The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

UserID string

Tagged ID of the user.

type BetaSpendLimitScopedAPIKeyActor struct { Type: "scoped_api_key_actor"; ScopedAPIKeyID }

A scoped Admin API key acting on behalf of the organization.

Type ScopedAPIKeyActor
defaultscoped_api_key_actor
ScopedAPIKeyID string
CreatedAt Time
formatdate-time
One of the following:
const BetaSpendLimitPeriodDaily BetaSpendLimitPeriod = "daily"
const BetaSpendLimitPeriodMonthly BetaSpendLimitPeriod = "monthly"
const BetaSpendLimitPeriodWeekly BetaSpendLimitPeriod = "weekly"
ResolvedAt Time
formatdate-time
ResolvedBy BetaOrganizationSpendLimitIncreaseRequestApproveResponseResolvedByUnion
One of the following:
type BetaSpendLimitUserActor struct { Type: "user_actor"; Deleted; EmailAddress; /* 2 more */ }

A user within the organization. name and email_address are null when the underlying account is unavailable or has been deleted; deleted is true only for deleted accounts.

Type UserActor

Actor type. Always user_actor.

defaultuser_actor
Deleted bool

True only when the underlying account has been deleted.

defaultfalse
EmailAddress string

The user's email address. Null when the account is unavailable or has been deleted.

Name string

The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

UserID string

Tagged ID of the user.

type BetaSpendLimitScopedAPIKeyActor struct { Type: "scoped_api_key_actor"; ScopedAPIKeyID }

A scoped Admin API key acting on behalf of the organization.

Type ScopedAPIKeyActor
defaultscoped_api_key_actor
ScopedAPIKeyID string
SpendLimit BetaSpendLimit

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

SpendSummary BetaSpendSummary

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

One of the following:
const BetaSpendLimitIncreaseRequestStatusApproved BetaSpendLimitIncreaseRequestStatus = "approved"
const BetaSpendLimitIncreaseRequestStatusDenied BetaSpendLimitIncreaseRequestStatus = "denied"
const BetaSpendLimitIncreaseRequestStatusPending BetaSpendLimitIncreaseRequestStatus = "pending"
Approuver une demande d'augmentation de limite de dépenses
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"),
	)
	response, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(
		context.TODO(),
		"spend_limit_increase_request_id",
		anthropic.BetaOrganizationSpendLimitIncreaseRequestApproveParams{
			Amount: "50000",
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.ID)
}
Returns Examples
Response 200
{
  "id": "id",
  "actor": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "created_at": "2019-12-27T18:11:19.117Z",
  "period": "daily",
  "resolved_at": "2019-12-27T18:11:19.117Z",
  "resolved_by": {
    "deleted": true,
    "email_address": "email_address",
    "name": "name",
    "type": "user_actor",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "spend_limit": {
    "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_01WCz1FkmYMm4gnmykNKUu3Q"
    },
    "type": "spend_limit",
    "updated_at": "2019-12-27T18:11:19.117Z"
  },
  "spend_summary": {
    "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"
  },
  "status": "approved",
  "type": "spend_limit_increase_request"
}