---
title: Set Workspace Rate Limits
url: https://platform.claude.com/docs/en/api/go/beta/organization/workspaces/rate_limits/update
---

# Set Workspace Rate Limits

`client.Beta.Organization.Workspaces.RateLimits.Update(ctx, rateLimitID, params) (*BetaWorkspaceRateLimit, error)`

**POST** `/v1/organizations/workspaces/{workspace_id}/rate_limits/{rate_limit_id}`

Set or clear rate-limit overrides for one rate-limit group in a workspace.

Only the limiter types named in `limits` change: an integer `value` sets
that type's override and `null` clears it. Types not named keep their
current value. A value above the organization's own limit is stored, but
the organization limit still applies, so the lower of the two is
enforced.

Returns the targeted group's entry with this request applied, in the shape
`GET /v1/organizations/workspaces/{workspace_id}/rate_limits` returns.
Changes take effect within about an hour.

## Parameters

- `rateLimitID string` (path parameter)

  The `id` of the organization's rate-limit entry to set overrides for.

- `params BetaOrganizationWorkspaceRateLimitUpdateParams`

  - `WorkspaceID string` (path parameter)

    The ID of the workspace.

  - `Limits []BetaWorkspaceRateLimitUpdateValueParam`

    Limits to set or clear. Unspecified limit types are unchanged.

    minItems: 1, maxItems: 16

    - `Type BetaWorkspaceRateLimitType`

      Rate limiter type. `input_tokens_per_minute` counts every input token, cache reads included. `input_tokens_per_minute_cache_aware` does not count cache reads, and on current models the organization's input-token limit usually has this type. A workspace limit of either type applies alongside the organization's limit, not in place of it. Because cache reads count toward an `input_tokens_per_minute` limit, it can reject requests that read mostly from the cache while the organization's limit still has room.

      - `const BetaWorkspaceRateLimitTypeFastItpmca BetaWorkspaceRateLimitType = "fast_itpmca"`

      - `const BetaWorkspaceRateLimitTypeFastOtpm BetaWorkspaceRateLimitType = "fast_otpm"`

      - `const BetaWorkspaceRateLimitTypeInputTokensPerMinute BetaWorkspaceRateLimitType = "input_tokens_per_minute"`

      - `const BetaWorkspaceRateLimitTypeInputTokensPerMinuteCacheAware BetaWorkspaceRateLimitType = "input_tokens_per_minute_cache_aware"`

      - `const BetaWorkspaceRateLimitTypeOutputTokensPerMinute BetaWorkspaceRateLimitType = "output_tokens_per_minute"`

      - `const BetaWorkspaceRateLimitTypeRequestsPerMinute BetaWorkspaceRateLimitType = "requests_per_minute"`

      - `const BetaWorkspaceRateLimitTypeTokensPerDay BetaWorkspaceRateLimitType = "tokens_per_day"`

      - `const BetaWorkspaceRateLimitTypeTokensPerMinute BetaWorkspaceRateLimitType = "tokens_per_minute"`

      - `const BetaWorkspaceRateLimitTypeToolUsesPerSecond BetaWorkspaceRateLimitType = "tool_uses_per_second"`

    - `Value int64`

      New limit value. Set to null to clear the workspace override and fall back to the organization limit.

      minimum: 0, maximum: 9007199254740991

## Returns

- `type BetaWorkspaceRateLimit`

  - `Type WorkspaceRateLimit`

    Object type. Always `workspace_rate_limit` for workspace rate-limit entries.

    default: workspace_rate_limit

  - `Group BetaWorkspaceRateLimitGroupUnion`

    The rate-limit group this entry's limits apply to.

    - `type BetaOrganizationRateLimitModelGroup`

      - `Type ModelGroup`

        Always `model_group`: a family of models.

        default: model_group

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

      - `DisplayName string`

        Human-readable name of the model group (for example, `Claude Sonnet 4.x`). For display only; it may change.

    - `type BetaOrganizationRateLimitBatchGroup`

      - `Type Batch`

        Always `batch`: the Message Batches API.

        default: batch

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitTokenCountGroup`

      - `Type TokenCount`

        Always `token_count`: the Token Count API.

        default: token_count

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitFilesGroup`

      - `Type Files`

        Always `files`: the Files API.

        default: files

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitSkillsGroup`

      - `Type Skills`

        Always `skills`: the Skills API.

        default: skills

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

    - `type BetaOrganizationRateLimitWebSearchGroup`

      - `Type WebSearch`

        Always `web_search`: the Messages API web search tool.

        default: web_search

      - `ID string`

        Opaque identifier of the rate-limit group (for example, `rlg_01VPTCmyiu5ZLsWkcxYG2pY8`). It is the same in every organization and never changes, unlike the entry's own identifier, which differs per organization.

  - `Limits []BetaWorkspaceRateLimitValue`

    The workspace's limiter values for this group. By default only the limiter types with a workspace-level override are listed. With `include_inherited` set to `true`, the limiter types the workspace inherits from the organization are listed too, each marked by `source`.

    - `Type string`

      The limiter type (for example, `requests_per_minute` or `input_tokens_per_minute_cache_aware`).

    - `OrgLimit int64`

      The organization-level value for the same limiter type, for reference. `null` when the organization has no limit configured for this limiter type.

    - `Source BetaWorkspaceRateLimitValueSourceUnion`

      Where `value` comes from. `organization` values are listed only when `include_inherited` is `true`, and then `value` equals `org_limit`.

      - `type BetaWorkspaceRateLimitWorkspaceSource`

        - `Type Workspace`

          Always `workspace`: a workspace-level override is stored.

          default: workspace

      - `type BetaWorkspaceRateLimitOrganizationSource`

        - `Type Organization`

          Always `organization`: no workspace-level override is stored, so the organization's value applies.

          default: organization

    - `Value int64`

      The workspace's value for this limiter type: the workspace-level override when `source.type` is `workspace`, otherwise the organization's value.

  - `Models []string`

    Model names this entry's limits apply to, including aliases. `null` when `group.type` is not `"model_group"`. The list covers the models this workspace has access to, so it can differ between workspaces.

  - `RateLimitID string`

    The `id` of the organization's RateLimit entry this entry applies to.

  - `WorkspaceID string`

    ID of the Workspace this entry applies to.

## Errors

Any method can also return the general [HTTP errors](https://platform.claude.com/docs/en/api/errors?sdk_languages=go).

- `ErrorCodeSandboxEgressRestricted` (HTTP status 403, error code `sandbox_egress_restricted`)

  The request came from a Claude sandbox with restricted network access, which is not allowed to make this request. Send it from outside the sandbox, or from a sandbox with unrestricted network access.

## Example

```go
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"),
	)
	betaWorkspaceRateLimit, err := client.Beta.Organization.Workspaces.RateLimits.Update(
		context.TODO(),
		"rate_limit_id",
		anthropic.BetaOrganizationWorkspaceRateLimitUpdateParams{
			WorkspaceID: "workspace_id",
			Limits: []anthropic.BetaWorkspaceRateLimitUpdateValueParam{{
				Type:  anthropic.BetaWorkspaceRateLimitTypeFastItpmca,
				Value: anthropic.Int(0),
			}},
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", betaWorkspaceRateLimit.RateLimitID)
}
```

### Response (200)

```json
{
  "group": {
    "id": "id",
    "display_name": "display_name",
    "type": "model_group"
  },
  "limits": [
    {
      "org_limit": 0,
      "source": {
        "type": "workspace"
      },
      "type": "type",
      "value": 0
    }
  ],
  "models": [
    "string"
  ],
  "rate_limit_id": "rate_limit_id",
  "type": "workspace_rate_limit",
  "workspace_id": "workspace_id"
}
```
