Claude Platform Docs

核准支出限制提高請求

IncreaseRequestApproveResponse beta().organization().spendLimits().increaseRequests().approve(params, requestOptions = RequestOptions.none())
POST/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve

核准待處理的支出限制提高請求。

為請求者寫入金額為 amount 的每位使用者支出限制,並將請求轉換為 approved。period 預設為該成員被封鎖時的期間。除非設定了 suppress_notification,否則 Anthropic 會寄送電子郵件給請求者。

Parameters
IncreaseRequestApproveParams params
Optional<String> spendLimitIncreaseRequestId⁠Path parameter

ID of the spend limit increase request.

String amount

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

Optional<BetaSpendLimitPeriod> period
Optional<Boolean> suppressNotification
Returns
class IncreaseRequestApproveResponse { type = "spend_limit_increase_request"; id; actor; /* 7 more */ }
JsonValue type = "spend_limit_increase_request"
String id
Actor actor
One of the following:
class BetaSpendLimitUserActor { 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.

JsonValue type = "user_actor"

Actor type. Always user_actor.

boolean deleted

True only when the underlying account has been deleted.

Optional<String> emailAddress

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

Optional<String> name

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

String userId

Tagged ID of the user.

class BetaSpendLimitScopedApiKeyActor { type = "scoped_api_key_actor"; scopedApiKeyId; }

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

JsonValue type = "scoped_api_key_actor"
String scopedApiKeyId
LocalDateTime createdAt
formatdate-time
One of the following:
DAILY("daily")
MONTHLY("monthly")
WEEKLY("weekly")
Optional<LocalDateTime> resolvedAt
formatdate-time
Optional<ResolvedBy> resolvedBy
One of the following:
class BetaSpendLimitUserActor { 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.

JsonValue type = "user_actor"

Actor type. Always user_actor.

boolean deleted

True only when the underlying account has been deleted.

Optional<String> emailAddress

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

Optional<String> name

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

String userId

Tagged ID of the user.

class BetaSpendLimitScopedApiKeyActor { type = "scoped_api_key_actor"; scopedApiKeyId; }

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

JsonValue type = "scoped_api_key_actor"
String scopedApiKeyId
BetaSpendLimit spendLimit

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

Optional<BetaSpendSummary> spendSummary

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

One of the following:
APPROVED("approved")
DENIED("denied")
PENDING("pending")
核准支出限制提高請求
package com.anthropic.example;

import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestApproveParams;
import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestApproveResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        AnthropicClient client = AnthropicOkHttpClient.fromEnv();

        IncreaseRequestApproveParams params = IncreaseRequestApproveParams.builder()
            .spendLimitIncreaseRequestId("spend_limit_increase_request_id")
            .amount("50000")
            .build();
        IncreaseRequestApproveResponse response = client.beta().organization().spendLimits().increaseRequests().approve(params);
    }
}
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"
}