Claude Platform Docs

Workspace-Ratenlimits auflisten

client.Beta.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[BetaWorkspaceRateLimit], error)
GET/v1/organizations/workspaces/{workspace_id}/rate_limits

Listet die Ratenlimits eines Workspace auf.

Standardmäßig werden nur die Gruppen und Limiter-Typen zurückgegeben, die eine Überschreibung auf Workspace-Ebene haben. Mit include_inherited=true wird jede Gruppe mit Limits auf Organisationsebene zurückgegeben, die der Workspace sehen kann, wobei für jede sowohl die von der Organisation geerbten Werte als auch die eigenen Überschreibungen aufgeführt werden. Das Feld source jedes Werts gibt an, um welchen es sich handelt.

Wenn limit weggelassen wird, werden alle passenden Einträge auf einer einzigen Seite zurückgegeben; wenn limit das Ergebnis kürzt, folge next_page, um die restlichen Einträge abzurufen.

Parameters
workspaceID string⁠Path parameter

The ID of the workspace.

query BetaOrganizationWorkspaceRateLimitListParams
GroupType BetaOrganizationWorkspaceRateLimitListParamsGroupType OptionalQuery parameter

Filter by group type.

const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeBatch BetaOrganizationWorkspaceRateLimitListParamsGroupType = "batch"
const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeFiles BetaOrganizationWorkspaceRateLimitListParamsGroupType = "files"
const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeModelGroup BetaOrganizationWorkspaceRateLimitListParamsGroupType = "model_group"
const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeSkills BetaOrganizationWorkspaceRateLimitListParamsGroupType = "skills"
const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeTokenCount BetaOrganizationWorkspaceRateLimitListParamsGroupType = "token_count"
const BetaOrganizationWorkspaceRateLimitListParamsGroupTypeWebSearch BetaOrganizationWorkspaceRateLimitListParamsGroupType = "web_search"
IncludeInherited param.Opt[bool] OptionalQuery parameter

Also list the limiter values the workspace inherits from the organization, including groups with no workspace-level override.

Limit param.Opt[int64] OptionalQuery parameter

Maximum number of items to return per page. Ranges from 1 to 1000.

When omitted, every remaining entry is returned in a single page and next_page is null.

minimum1
maximum1000
Page param.Opt[string] OptionalQuery parameter

Opaque cursor from a previous response's next_page.

Returns
type BetaWorkspaceRateLimit struct { Type: "workspace_rate_limit"; Group; GroupType; /* 4 more */ }
Workspace-Ratenlimits auflisten
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.Workspaces.RateLimits.List(
		context.TODO(),
		"workspace_id",
		anthropic.BetaOrganizationWorkspaceRateLimitListParams{},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}
Returns Examples
Response 200
{
  "data": [
    {
      "group": {
        "id": "id",
        "display_name": "display_name",
        "type": "model_group"
      },
      "group_type": "batch",
      "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"
    }
  ],
  "next_page": "next_page"
}