Merge anthropic admin package

This commit is contained in:
2026-10-24 07:47:06 +02:00
64 changed files with 7703 additions and 3 deletions
+165
View File
@@ -0,0 +1,165 @@
# Anthropic admin and agent platform (`molo::anthropic::admin`)
Status 2026-10-24. Plan: `plans/17-llm-vendor-platforms.md`, package
"anthropic admin". The Messages, Batches, Files, Models and Skills families
belong to `src/anthropic/core` and are excluded (see `EXCLUDED` in the checker).
## Scope
255 calls in one table (`calls.cpp`), 243 read from the official Python SDK
and 12 documented only in the API reference:
| Credential | Calls | Surface |
|---|---|---|
| Admin API key or `org:admin` OAuth token (125) | organization info, users, invites, workspaces, workspace members and rate limits, API keys, external keys (CMEK), rate limits, compliance settings, RBAC groups and roles, spend limits, plugins, plugin marketplaces, telemetry destinations, organization webhooks, Claude Tag, Enterprise analytics, usage and cost reports, organization-level MCP tunnel views |
| `org:admin` OAuth token only (26) | service accounts (and their workspaces), federation issuers and rules, workspace service accounts |
| Standard API key (104) | Managed Agents: agents (+versions), environments (+work queue), sessions (+events, resources, threads, thread events, SSE streams), deployments, deployment runs, vaults (+credentials), memory stores (+memories, versions), dreams, tunnels (+certificates), user profiles (+action URLs) |
Managed Agents is public REST (`/v1/agents`, `/v1/sessions`, ...), beta header
`managed-agents-2026-04-01` (other families carry their own beta header,
column `beta`). It uses the standard workspace key, not the admin key, so the
package keeps three credential lanes (below).
## Module map (one concern per class)
| File | Class | Concern |
|---|---|---|
| `calls.h/.cpp` | `Call`, `CallSpec` | generated table, the only place paths live |
| `services/*.h/.cpp` | one class per resource group (`Invites`, `Workspaces`, `Agents`, ...) | generated methods, one per row; `list_all` for paged rows |
| `api.h` | `AdminApi` | facade owning every group |
| `credentials.h/.cpp` | `KeyRules`, `Lane` | which key may go in which lane |
| `gateway.h/.cpp` | `Gateway` | three `llm::ApiClient` lanes, lane choice per call, GET SSE |
| `request.h/.cpp` | `RequestBuilder` | all local validation; builds the exact request without network |
| `query.h/.cpp` | `Query` | query parameters, arrays as `name[]` |
| `pager.h/.cpp` | `Pager`, `Walk` | page rules for the four page shapes, capped walks |
| `resource.h/.cpp` | `Resource : llm::Service` | send, send raw, multipart, stream, walk |
| `reports.h/.cpp` | `MessagesUsageQuery`, `CostQuery`, `ClaudeCodeQuery`, `ReportParser`, `Decimal`, `Reports` | usage and cost reports |
| `webhook.h/.cpp` | `WebhookVerifier` | Standard Webhooks signature check |
| `caps.h` | `Caps` | every ceiling |
| `tools/check_spec.py` | | verifier and generator |
## Contracts
- Credentials: `ANTHROPIC_ADMIN_KEY` (must start `sk-ant-admin`, header
`x-api-key`), `ANTHROPIC_AUTH_TOKEN` (org:admin OAuth token, `Authorization:
Bearer`; the only credential for the 26 OAuth-only calls), `ANTHROPIC_API_KEY`
(standard key, managed agents). A standard key in the admin lane, an API key
in the OAuth lane, an admin key in the platform lane: refused locally with
`credential_rejected`, no request leaves. Nothing configured:
`NotConfiguredError` (503). Keys are never logged or shown (status shows
state only).
- Local validation comes before the credential check: path ids through
`Service::valid_id` (1..256 of `A-Za-z0-9._:-`), unknown and missing body
fields and query parameters, `limit` 1..1000, <=100 values per array
parameter, <=512 bytes per value, <=8 KiB query, <=1 MiB JSON body, multipart
<=32 MiB and <=512 parts, form part names (`files[]`, plain `files` is
refused), report ranges per bucket width (1d 31, 1h 168, 1m 1440; cost 31;
Claude Code 1000). Errors are `ApiError` 400 `INVALID_ARGUMENT`.
- Headers: `anthropic-version: 2026-10-21` (pinned), `anthropic-beta` from the
row, `anthropic-workspace-id` only where the row accepts it
(`Gateway::set_workspace_id`), header parameters (`Anthropic-Worker-ID`).
- Query arrays use the SDK's `brackets` format: `group_by[]=a&group_by[]=b`.
- Paging: `Pager` follows `has_more`/`last_id` (ids), `next_page` (cursor and
report) and stops when the server says so. `list_all` is capped at
`Caps::kMaxPages` (20, hard 100) pages and `kMaxItems` (5000) items and
reports `Walk.truncated` with `reason` and the continuing `next_page`.
- Mutating calls are `Kind::kWrite`, deletes/archives/cancels/stops/redacts/
token rotation `Kind::kDestructive`; each is its own explicit method (no
default behaviour, marked MUTATES / DESTRUCTIVE in the generated header).
Secret-returning calls (`reveal_token`) are marked.
- Streams (`sessions.events.stream`, `sessions.threads.events.stream`) are GET
SSE through `Gateway::stream_get`, at most `Caps::kMaxStreamEvents` events.
- Webhooks: Standard Webhooks (`webhook-id`, `webhook-timestamp`,
`webhook-signature`, `whsec_` key, HMAC-SHA256 via wolfSSL), tolerance 300 s.
- Reports: `Decimal` is exact fixed point (9 digits); cost `amount` strings are
summed without floating point and overflow throws.
## Demo (`example/app/ai/AnthropicAdminDemo.cpp`)
`GET /ai/anthropic/admin` (page), `/status` (lane states, never a key),
`/calls` (the table). `POST /call` (any non-stream, non-upload row by name:
validated, dry run for every non-read unless `"confirm":true`), `/organization`,
`/usage`, `/cost`, `/claude-code`, `/webhook/verify` (local). 503
`not_configured` without credential, 422 bad input, 401/403 `credential_rejected`.
## Sources
1. Official Python SDK `anthropics/anthropic-sdk-python` commit
`202db72c87d7c6eaa72129c67ce67fd343a3a20c` (release 2.3.0, 2026-10-23):
`src/anthropic/resources/**` (verb, path, body keys, query keys, header
params, beta header, page class, return type) and `types/**/*_params.py`
(TypedDict fields). `.stats.yml` says `configured_endpoints: 349` and has no
`openapi_spec_url` (also checked: TypeScript, Go, Java, Ruby, C#, PHP): there
is no published OpenAPI document, so the SDK source is the machine-readable
source. `_client.py` fixes query arrays to `brackets`, `_constants.py` the
API version.
2. API reference pages `platform.claude.com/docs/en/api/**.md` (one per
operation; method and path line, path/query/body parameters, credential
note "Admin API keys are not accepted").
3. Guides `manage-claude/admin-api`, `admin-api-keys`, `usage-cost-api`,
`claude-tag-api` (credential rules, report semantics, Claude Tag endpoints).
4. Standard Webhooks specification (signature scheme, published test vector).
## Verified against spec
`python3 -I src/anthropic/admin/tools/check_spec.py` on 2026-10-24: 351 SDK
operations scanned, 255 table rows (12 docs-only), 253 reference pages checked
(14 rows are checked against the Claude Tag guide or the SDK alone), 0 failures.
It fails when a generated file is stale, a row disagrees with the SDK or its
page (verb, path, every body and query field in both directions, credential
class), a field is missing from the SDK params module, or an SDK operation is
neither in the table nor excluded (Messages, Batches, Models, Files, Skills).
Regenerate with `--emit`. `--sdk-tar` and `--pages-dir` reuse local copies.
## Verified live
Unauthenticated probes, 2026-10-24: see "Probes" at the end of this file.
No Anthropic key exists in this environment: no authenticated call has been
made. Opt-in live test (`MOLO_LIVE_NET=1` plus `ANTHROPIC_ADMIN_KEY`): read-only
organization info, one-item lists of users, workspaces, API keys, one report.
It prints a loud SKIP otherwise.
## Unverified
- Response shapes beyond the documented report examples (typed parsing exists
only for the three reports; everything else is returned as `Json`).
- Whether an Admin API key is accepted by the 26 OAuth-only calls: the pages
say it is not; the package follows the pages.
- Rows with no reference page: `analytics/usage` and `analytics/cost`
(SDK only); Claude Tag (guide only, field names from the SDK).
- Fields documented but not in the SDK params: none at this commit.
- Report enum members (`group_by`, `service_tiers`, ...) are not validated
locally except cost `group_by`; the server rejects unknown values.
- `sessions.resources.add` has `type` required in the SDK signature while the
migration guide says it is optional; the table follows the SDK.
- Actual limits enforced by the server for `limit` on non-report lists (the
package only caps at 1000).
## Gaps
- Personal and service-account keys not scoped to a workspace are valid Admin
API credentials per the docs, but look like standard keys (`sk-ant-api...`)
and are refused by design (rule: the standard key is never accepted).
Claude Enterprise scoped keys (`sk-ant-api01`) fall under the same rule.
- No GET streaming in `llm::ApiClient` (foundation gap, `src/llm`): the package
has its own `Gateway::stream_get`.
- Multipart upload goes through `ApiClient::post_multipart`, which parses a JSON
reply only; the binary plugin download uses `request_raw`.
- No typed models for non-report resources; no OAuth token refresh.
- `ANTHROPIC_AUTH_TOKEN` is the SDK's name for the bearer token; the plan's
key list names only `ANTHROPIC_ADMIN_KEY`.
## Probes (unauthenticated, 2026-10-24, header `anthropic-version: 2026-10-21`)
Host `api.anthropic.com` resolves, TLS works. Every documented path below
answers 401 (not 404) with the documented envelope
`{"type":"error","error":{"type":"authentication_error","message":...},"request_id":...}`;
an invented route answers 404 `not_found_error`.
| Path | Status |
|---|---|
| `/v1/organizations/{me,users,workspaces,api_keys,service_accounts,cost_report,tunnels}` | 401 `x-api-key header is required` |
| `/v1/organizations/usage_report/{messages,claude_code}` | 401 (the two docs-only report paths exist) |
| `/v1/agents`, `/v1/sessions`, `/v1/vaults` | 401 `Authentication failed` |
| `/v1/environments` | 401 `x-api-key header is required` |
| `/v1/nonexistent_route` | 404 `not_found_error` |
+265
View File
@@ -0,0 +1,265 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// AdminApi: every resource group of the package behind one object. Build it
// from the environment (ANTHROPIC_ADMIN_KEY, ANTHROPIC_ADMIN_TOKEN,
// ANTHROPIC_API_KEY) or from an explicit Gateway.
#include <memory>
#include "anthropic/admin/gateway.h"
#include "anthropic/admin/services/access.h"
#include "anthropic/admin/services/agents.h"
#include "anthropic/admin/services/analytics.h"
#include "anthropic/admin/services/claude_tag.h"
#include "anthropic/admin/services/deployments.h"
#include "anthropic/admin/services/dreams.h"
#include "anthropic/admin/services/environments.h"
#include "anthropic/admin/services/identity.h"
#include "anthropic/admin/services/memory.h"
#include "anthropic/admin/services/plugins.h"
#include "anthropic/admin/services/reports.h"
#include "anthropic/admin/services/sessions.h"
#include "anthropic/admin/services/spend_limits.h"
#include "anthropic/admin/services/telemetry.h"
#include "anthropic/admin/services/tunnels.h"
#include "anthropic/admin/services/user_profiles.h"
#include "anthropic/admin/services/vaults.h"
#include "anthropic/admin/services/workspaces.h"
namespace molo::anthropic::admin {
class AdminApi {
public:
explicit AdminApi(std::shared_ptr<Gateway> gateway)
: gateway_(std::move(gateway)),
federation_issuers_(gateway_),
federation_rules_(gateway_),
federation_rules_workspaces_(gateway_),
rbac_groups_(gateway_),
rbac_groups_members_(gateway_),
rbac_roles_(gateway_),
rbac_roles_permissions_(gateway_),
service_accounts_(gateway_),
service_accounts_workspaces_(gateway_),
agents_(gateway_),
agents_versions_(gateway_),
analytics_apps_chat_projects_(gateway_),
analytics_artifacts_(gateway_),
analytics_connectors_(gateway_),
analytics_cost_(gateway_),
analytics_cost_report_(gateway_),
analytics_plugins_(gateway_),
analytics_skills_(gateway_),
analytics_summaries_(gateway_),
analytics_usage_(gateway_),
analytics_usage_report_(gateway_),
analytics_user_cost_report_(gateway_),
analytics_user_usage_report_(gateway_),
analytics_users_(gateway_),
claude_tag_bundles_(gateway_),
claude_tag_bundles_targets_(gateway_),
claude_tag_slack_channels_(gateway_),
claude_tag_slack_workspaces_(gateway_),
deployment_runs_(gateway_),
deployments_(gateway_),
dreams_(gateway_),
environments_(gateway_),
environments_work_(gateway_),
api_keys_(gateway_),
compliance_settings_(gateway_),
external_keys_(gateway_),
invites_(gateway_),
organization_(gateway_),
rate_limits_(gateway_),
users_(gateway_),
memory_stores_(gateway_),
memory_stores_memories_(gateway_),
memory_stores_memory_versions_(gateway_),
plugin_marketplaces_(gateway_),
plugins_(gateway_),
plugins_installation_settings_(gateway_),
plugins_shares_(gateway_),
plugins_versions_(gateway_),
cost_report_(gateway_),
usage_report_(gateway_),
sessions_(gateway_),
sessions_events_(gateway_),
sessions_resources_(gateway_),
sessions_threads_(gateway_),
sessions_threads_events_(gateway_),
spend_limits_(gateway_),
spend_limits_effective_(gateway_),
spend_limits_increase_requests_(gateway_),
telemetry_destinations_(gateway_),
telemetry_destinations_workspaces_(gateway_),
webhooks_(gateway_),
mcp_tunnels_(gateway_),
mcp_tunnels_certificates_(gateway_),
tunnels_(gateway_),
tunnels_certificates_(gateway_),
user_profiles_(gateway_),
user_profiles_action_urls_(gateway_),
vaults_(gateway_),
vaults_credentials_(gateway_),
workspaces_(gateway_),
workspaces_members_(gateway_),
workspaces_rate_limits_(gateway_),
workspaces_service_accounts_(gateway_) {}
static AdminApi from_env() { return AdminApi(Gateway::from_env()); }
const Gateway& gateway() const { return *gateway_; }
const FederationIssuers& federation_issuers() const { return federation_issuers_; }
const FederationRules& federation_rules() const { return federation_rules_; }
const FederationRuleWorkspaces& federation_rules_workspaces() const { return federation_rules_workspaces_; }
const RbacGroups& rbac_groups() const { return rbac_groups_; }
const RbacGroupsMembers& rbac_groups_members() const { return rbac_groups_members_; }
const RbacRoles& rbac_roles() const { return rbac_roles_; }
const RbacRolesPermissions& rbac_roles_permissions() const { return rbac_roles_permissions_; }
const ServiceAccounts& service_accounts() const { return service_accounts_; }
const ServiceAccountWorkspaces& service_accounts_workspaces() const { return service_accounts_workspaces_; }
const Agents& agents() const { return agents_; }
const AgentsVersions& agents_versions() const { return agents_versions_; }
const AnalyticsAppsChatProjects& analytics_apps_chat_projects() const { return analytics_apps_chat_projects_; }
const AnalyticsArtifacts& analytics_artifacts() const { return analytics_artifacts_; }
const AnalyticsConnectors& analytics_connectors() const { return analytics_connectors_; }
const AnalyticsCost& analytics_cost() const { return analytics_cost_; }
const AnalyticsCostReport& analytics_cost_report() const { return analytics_cost_report_; }
const AnalyticsPlugins& analytics_plugins() const { return analytics_plugins_; }
const AnalyticsSkills& analytics_skills() const { return analytics_skills_; }
const AnalyticsSummaries& analytics_summaries() const { return analytics_summaries_; }
const AnalyticsUsage& analytics_usage() const { return analytics_usage_; }
const AnalyticsUsageReport& analytics_usage_report() const { return analytics_usage_report_; }
const AnalyticsUserCostReport& analytics_user_cost_report() const { return analytics_user_cost_report_; }
const AnalyticsUserUsageReport& analytics_user_usage_report() const { return analytics_user_usage_report_; }
const AnalyticsUsers& analytics_users() const { return analytics_users_; }
const ClaudeTagBundles& claude_tag_bundles() const { return claude_tag_bundles_; }
const ClaudeTagBundlesTargets& claude_tag_bundles_targets() const { return claude_tag_bundles_targets_; }
const ClaudeTagSlackChannels& claude_tag_slack_channels() const { return claude_tag_slack_channels_; }
const ClaudeTagSlackWorkspaces& claude_tag_slack_workspaces() const { return claude_tag_slack_workspaces_; }
const DeploymentRuns& deployment_runs() const { return deployment_runs_; }
const Deployments& deployments() const { return deployments_; }
const Dreams& dreams() const { return dreams_; }
const Environments& environments() const { return environments_; }
const EnvironmentsWork& environments_work() const { return environments_work_; }
const ApiKeys& api_keys() const { return api_keys_; }
const ComplianceSettings& compliance_settings() const { return compliance_settings_; }
const ExternalKeys& external_keys() const { return external_keys_; }
const Invites& invites() const { return invites_; }
const Organization& organization() const { return organization_; }
const RateLimits& rate_limits() const { return rate_limits_; }
const Users& users() const { return users_; }
const MemoryStores& memory_stores() const { return memory_stores_; }
const MemoryStoresMemories& memory_stores_memories() const { return memory_stores_memories_; }
const MemoryStoresMemoryVersions& memory_stores_memory_versions() const { return memory_stores_memory_versions_; }
const PluginMarketplaces& plugin_marketplaces() const { return plugin_marketplaces_; }
const Plugins& plugins() const { return plugins_; }
const PluginsInstallationSettings& plugins_installation_settings() const { return plugins_installation_settings_; }
const PluginsShares& plugins_shares() const { return plugins_shares_; }
const PluginsVersions& plugins_versions() const { return plugins_versions_; }
const CostReports& cost_report() const { return cost_report_; }
const UsageReports& usage_report() const { return usage_report_; }
const Sessions& sessions() const { return sessions_; }
const SessionsEvents& sessions_events() const { return sessions_events_; }
const SessionsResources& sessions_resources() const { return sessions_resources_; }
const SessionsThreads& sessions_threads() const { return sessions_threads_; }
const SessionsThreadsEvents& sessions_threads_events() const { return sessions_threads_events_; }
const SpendLimits& spend_limits() const { return spend_limits_; }
const SpendLimitsEffective& spend_limits_effective() const { return spend_limits_effective_; }
const SpendLimitsIncreaseRequests& spend_limits_increase_requests() const { return spend_limits_increase_requests_; }
const TelemetryDestinations& telemetry_destinations() const { return telemetry_destinations_; }
const TelemetryDestinationsWorkspaces& telemetry_destinations_workspaces() const { return telemetry_destinations_workspaces_; }
const Webhooks& webhooks() const { return webhooks_; }
const McpTunnels& mcp_tunnels() const { return mcp_tunnels_; }
const McpTunnelCertificates& mcp_tunnels_certificates() const { return mcp_tunnels_certificates_; }
const Tunnels& tunnels() const { return tunnels_; }
const TunnelsCertificates& tunnels_certificates() const { return tunnels_certificates_; }
const UserProfiles& user_profiles() const { return user_profiles_; }
const UserProfilesActionUrls& user_profiles_action_urls() const { return user_profiles_action_urls_; }
const Vaults& vaults() const { return vaults_; }
const VaultsCredentials& vaults_credentials() const { return vaults_credentials_; }
const Workspaces& workspaces() const { return workspaces_; }
const WorkspaceMembers& workspaces_members() const { return workspaces_members_; }
const WorkspaceRateLimits& workspaces_rate_limits() const { return workspaces_rate_limits_; }
const WorkspaceServiceAccounts& workspaces_service_accounts() const { return workspaces_service_accounts_; }
private:
std::shared_ptr<Gateway> gateway_;
FederationIssuers federation_issuers_;
FederationRules federation_rules_;
FederationRuleWorkspaces federation_rules_workspaces_;
RbacGroups rbac_groups_;
RbacGroupsMembers rbac_groups_members_;
RbacRoles rbac_roles_;
RbacRolesPermissions rbac_roles_permissions_;
ServiceAccounts service_accounts_;
ServiceAccountWorkspaces service_accounts_workspaces_;
Agents agents_;
AgentsVersions agents_versions_;
AnalyticsAppsChatProjects analytics_apps_chat_projects_;
AnalyticsArtifacts analytics_artifacts_;
AnalyticsConnectors analytics_connectors_;
AnalyticsCost analytics_cost_;
AnalyticsCostReport analytics_cost_report_;
AnalyticsPlugins analytics_plugins_;
AnalyticsSkills analytics_skills_;
AnalyticsSummaries analytics_summaries_;
AnalyticsUsage analytics_usage_;
AnalyticsUsageReport analytics_usage_report_;
AnalyticsUserCostReport analytics_user_cost_report_;
AnalyticsUserUsageReport analytics_user_usage_report_;
AnalyticsUsers analytics_users_;
ClaudeTagBundles claude_tag_bundles_;
ClaudeTagBundlesTargets claude_tag_bundles_targets_;
ClaudeTagSlackChannels claude_tag_slack_channels_;
ClaudeTagSlackWorkspaces claude_tag_slack_workspaces_;
DeploymentRuns deployment_runs_;
Deployments deployments_;
Dreams dreams_;
Environments environments_;
EnvironmentsWork environments_work_;
ApiKeys api_keys_;
ComplianceSettings compliance_settings_;
ExternalKeys external_keys_;
Invites invites_;
Organization organization_;
RateLimits rate_limits_;
Users users_;
MemoryStores memory_stores_;
MemoryStoresMemories memory_stores_memories_;
MemoryStoresMemoryVersions memory_stores_memory_versions_;
PluginMarketplaces plugin_marketplaces_;
Plugins plugins_;
PluginsInstallationSettings plugins_installation_settings_;
PluginsShares plugins_shares_;
PluginsVersions plugins_versions_;
CostReports cost_report_;
UsageReports usage_report_;
Sessions sessions_;
SessionsEvents sessions_events_;
SessionsResources sessions_resources_;
SessionsThreads sessions_threads_;
SessionsThreadsEvents sessions_threads_events_;
SpendLimits spend_limits_;
SpendLimitsEffective spend_limits_effective_;
SpendLimitsIncreaseRequests spend_limits_increase_requests_;
TelemetryDestinations telemetry_destinations_;
TelemetryDestinationsWorkspaces telemetry_destinations_workspaces_;
Webhooks webhooks_;
McpTunnels mcp_tunnels_;
McpTunnelCertificates mcp_tunnels_certificates_;
Tunnels tunnels_;
TunnelsCertificates tunnels_certificates_;
UserProfiles user_profiles_;
UserProfilesActionUrls user_profiles_action_urls_;
Vaults vaults_;
VaultsCredentials vaults_credentials_;
Workspaces workspaces_;
WorkspaceMembers workspaces_members_;
WorkspaceRateLimits workspaces_rate_limits_;
WorkspaceServiceAccounts workspaces_service_accounts_;
};
} // namespace molo::anthropic::admin
+291
View File
@@ -0,0 +1,291 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/calls.h"
#include <stdexcept>
namespace molo::anthropic::admin {
// CALLS-BEGIN (parsed by tools/check_spec.py; one row per line)
static const CallSpec kCalls[] = {
{Call::kAnalyticsAppsChatProjectsList, "organization.analytics.apps.chat.projects.list", "GET", "/v1/organizations/analytics/apps/chat/projects", "api/beta/organization/analytics/apps/chat/projects/list", "ProjectListParams", "BetaAnalyticsProjectActivity", "", "", "date,ending_date,filter[],group_by[],limit,order,order_by,page,starting_date", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kAnalyticsArtifactsList, "organization.analytics.artifacts.list", "GET", "/v1/organizations/analytics/artifacts", "api/beta/organization/analytics/artifacts/list", "ArtifactListParams", "BetaAnalyticsArtifactActivity", "", "date", "date,filter[],group_by[],limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kAnalyticsConnectorsList, "organization.analytics.connectors.list", "GET", "/v1/organizations/analytics/connectors", "api/beta/organization/analytics/connectors/list", "ConnectorListParams", "BetaAnalyticsConnectorActivity", "", "", "date,ending_date,filter[],group_by[],limit,order,order_by,page,starting_date", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kAnalyticsCostList, "organization.analytics.cost.list", "GET", "/v1/organizations/analytics/cost", "", "CostListParams", "BetaAnalyticsCostItem", "", "starting_at", "starting_at,actor_ids[],actor_types[],agent_ids[],api_key_ids[],claude_tag_categories[],claude_tag_user_ids[],context_windows[],deployment_ids[],ending_at,environment_ids[],exclude_deleted_users,group_by[],inference_geos[],limit,models[],order,order_by,page,products[],rbac_group_ids[],service_tiers[],session_ids[],slack_channel_ids[],speeds[],time_bucket_width,user_profile_ids[],workspace_ids[]", "", "analytics-usage-cost-2026-08-24", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, false},
{Call::kAnalyticsCostReportList, "organization.analytics.cost_report.list", "GET", "/v1/organizations/analytics/cost_report", "api/beta/organization/analytics/cost_report/list", "CostReportListParams", "BetaAnalyticsCostReportTimeBucket", "", "starting_at", "starting_at,bucket_width,claude_tag_categories[],claude_tag_user_ids[],context_windows[],ending_at,group_by[],inference_geos[],limit,models[],page,products[],rbac_group_ids[],slack_channel_ids[],speeds[],user_ids[]", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, false},
{Call::kAnalyticsPluginsList, "organization.analytics.plugins.list", "GET", "/v1/organizations/analytics/plugins", "api/beta/organization/analytics/plugins/list", "PluginListParams", "BetaAnalyticsPluginActivity", "", "", "date,ending_date,filter[],group_by[],limit,order,order_by,page,starting_date", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kAnalyticsSkillsList, "organization.analytics.skills.list", "GET", "/v1/organizations/analytics/skills", "api/beta/organization/analytics/skills/list", "SkillListParams", "BetaAnalyticsSkillActivity", "", "", "date,ending_date,filter[],group_by[],limit,order,order_by,page,starting_date", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kAnalyticsSummariesList, "organization.analytics.summaries.list", "GET", "/v1/organizations/analytics/summaries", "api/beta/organization/analytics/summaries/list", "SummaryListParams", "BetaAnalyticsSingleDayActivitySummary", "", "starting_date", "starting_date,ending_date,filter[],limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kAnalyticsUsageList, "organization.analytics.usage.list", "GET", "/v1/organizations/analytics/usage", "", "UsageListParams", "BetaAnalyticsUsageItem", "", "starting_at", "starting_at,actor_ids[],actor_types[],agent_ids[],api_key_ids[],claude_tag_categories[],claude_tag_user_ids[],context_windows[],deployment_ids[],ending_at,environment_ids[],exclude_deleted_users,group_by[],inference_geos[],limit,models[],order,order_by,page,products[],rbac_group_ids[],service_tiers[],session_ids[],slack_channel_ids[],speeds[],time_bucket_width,user_profile_ids[],workspace_ids[]", "", "analytics-usage-cost-2026-08-24", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, false},
{Call::kAnalyticsUsageReportList, "organization.analytics.usage_report.list", "GET", "/v1/organizations/analytics/usage_report", "api/beta/organization/analytics/usage_report/list", "UsageReportListParams", "BetaAnalyticsUsageReportTimeBucket", "", "starting_at", "starting_at,bucket_width,claude_tag_categories[],claude_tag_user_ids[],context_windows[],ending_at,group_by[],inference_geos[],limit,models[],page,products[],rbac_group_ids[],slack_channel_ids[],speeds[],user_ids[]", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, false},
{Call::kAnalyticsUserCostReportList, "organization.analytics.user_cost_report.list", "GET", "/v1/organizations/analytics/user_cost_report", "api/beta/organization/analytics/user_cost_report/list", "UserCostReportListParams", "BetaAnalyticsCostUsersItem", "", "starting_at", "starting_at,bucket_width,claude_tag_categories[],claude_tag_user_ids[],context_windows[],ending_at,exclude_deleted_users,group_by[],inference_geos[],limit,models[],order,order_by,page,products[],rbac_group_ids[],slack_channel_ids[],speeds[],user_ids[]", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, false},
{Call::kAnalyticsUserUsageReportList, "organization.analytics.user_usage_report.list", "GET", "/v1/organizations/analytics/user_usage_report", "api/beta/organization/analytics/user_usage_report/list", "UserUsageReportListParams", "BetaAnalyticsUsageUsersItem", "", "starting_at", "starting_at,bucket_width,claude_tag_categories[],claude_tag_user_ids[],context_windows[],ending_at,exclude_deleted_users,group_by[],inference_geos[],limit,models[],order,order_by,page,products[],rbac_group_ids[],slack_channel_ids[],speeds[],user_ids[]", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, false},
{Call::kAnalyticsUsersList, "organization.analytics.users.list", "GET", "/v1/organizations/analytics/users", "api/beta/organization/analytics/users/list", "UserListParams", "BetaAnalyticsUserActivity", "", "", "date,ending_date,filter[],group_by[],limit,order,order_by,page,starting_date", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kApiKeysList, "organization.api_keys.list", "GET", "/v1/organizations/api_keys", "api/organization/api_keys/list", "ApiKeyListParams", "BetaAPIKey", "", "", "after_id,before_id,created_by_user_id,limit,status,workspace_id", "", "", Auth::kAdmin, Kind::kRead, Page::kIds, Wire::kJson, true, false},
{Call::kApiKeysRetrieve, "organization.api_keys.retrieve", "GET", "/v1/organizations/api_keys/{api_key_id}", "api/organization/api_keys/retrieve", "", "BetaAPIKey", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kApiKeysUpdate, "organization.api_keys.update", "POST", "/v1/organizations/api_keys/{api_key_id}", "api/organization/api_keys/update", "ApiKeyUpdateParams", "BetaAPIKey", "name,status", "", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagBundlesList, "organization.claude_tag.bundles.list", "GET", "/v1/organizations/claude_tag/bundles", "guide:manage-claude/claude-tag-api", "BundleListParams", "BetaClaudeTagBundle", "", "", "limit,page", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kClaudeTagBundlesRetrieve, "organization.claude_tag.bundles.retrieve", "GET", "/v1/organizations/claude_tag/bundles/{bundle_id}", "guide:manage-claude/claude-tag-api", "", "BetaClaudeTagBundle", "", "", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagBundlesTargetsCreate, "organization.claude_tag.bundles.targets.create", "POST", "/v1/organizations/claude_tag/bundles/{bundle_id}/targets", "guide:manage-claude/claude-tag-api", "TargetCreateParams", "BetaClaudeTagBundleTarget", "", "", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagBundlesTargetsDelete, "organization.claude_tag.bundles.targets.delete", "DELETE", "/v1/organizations/claude_tag/bundles/{bundle_id}/targets/{target_id}", "guide:manage-claude/claude-tag-api", "", "BetaClaudeTagDeletedBundleTarget", "", "", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagBundlesTargetsList, "organization.claude_tag.bundles.targets.list", "GET", "/v1/organizations/claude_tag/bundles/{bundle_id}/targets", "guide:manage-claude/claude-tag-api", "TargetListParams", "BetaClaudeTagBundleTarget", "", "", "limit,page", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kClaudeTagBundlesTargetsRetrieve, "organization.claude_tag.bundles.targets.retrieve", "GET", "/v1/organizations/claude_tag/bundles/{bundle_id}/targets/{target_id}", "guide:manage-claude/claude-tag-api", "", "BetaClaudeTagBundleTarget", "", "", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagSlackChannelsCreate, "organization.claude_tag.slack_channels.create", "POST", "/v1/organizations/claude_tag/slack_channels", "guide:manage-claude/claude-tag-api", "SlackChannelCreateParams", "BetaClaudeTagSlackChannel", "slack,settings", "slack", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagSlackChannelsDelete, "organization.claude_tag.slack_channels.delete", "DELETE", "/v1/organizations/claude_tag/slack_channels/{id}", "guide:manage-claude/claude-tag-api", "", "BetaClaudeTagDeletedSlackChannel", "", "", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagSlackChannelsList, "organization.claude_tag.slack_channels.list", "GET", "/v1/organizations/claude_tag/slack_channels", "guide:manage-claude/claude-tag-api", "SlackChannelListParams", "BetaClaudeTagSlackChannel", "", "slack_workspace_id", "slack_workspace_id,include_inherited,limit,page,slack_channel_id", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kClaudeTagSlackChannelsRetrieve, "organization.claude_tag.slack_channels.retrieve", "GET", "/v1/organizations/claude_tag/slack_channels/{id}", "guide:manage-claude/claude-tag-api", "SlackChannelRetrieveParams", "BetaClaudeTagSlackChannel", "", "", "include_inherited", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagSlackChannelsUpdate, "organization.claude_tag.slack_channels.update", "POST", "/v1/organizations/claude_tag/slack_channels/{id}", "guide:manage-claude/claude-tag-api", "SlackChannelUpdateParams", "BetaClaudeTagSlackChannel", "settings", "settings", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagSlackWorkspacesList, "organization.claude_tag.slack_workspaces.list", "GET", "/v1/organizations/claude_tag/slack_workspaces", "guide:manage-claude/claude-tag-api", "SlackWorkspaceListParams", "BetaClaudeTagSlackWorkspace", "", "", "include_inherited,limit,page,slack_workspace_id", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kClaudeTagSlackWorkspacesRetrieve, "organization.claude_tag.slack_workspaces.retrieve", "GET", "/v1/organizations/claude_tag/slack_workspaces/{id}", "guide:manage-claude/claude-tag-api", "SlackWorkspaceRetrieveParams", "BetaClaudeTagSlackWorkspace", "", "", "include_inherited", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kClaudeTagSlackWorkspacesUpdate, "organization.claude_tag.slack_workspaces.update", "POST", "/v1/organizations/claude_tag/slack_workspaces/{id}", "guide:manage-claude/claude-tag-api", "SlackWorkspaceUpdateParams", "BetaClaudeTagSlackWorkspace", "settings", "settings", "", "", "experimental-claude-tag-2026-10-21", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kComplianceSettingsRetrieve, "organization.compliance_settings.retrieve", "GET", "/v1/organizations/compliance_settings", "api/organization/compliance_settings/retrieve", "", "BetaComplianceSettings", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kComplianceSettingsUpdate, "organization.compliance_settings.update", "POST", "/v1/organizations/compliance_settings", "api/organization/compliance_settings/update", "ComplianceSettingUpdateParams", "BetaComplianceSettings", "state", "state", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kCostReportRetrieve, "organization.cost_report.retrieve", "GET", "/v1/organizations/cost_report", "api/beta/organization/cost_report/retrieve", "", "BetaCostReport", "", "starting_at", "starting_at,bucket_width,ending_at,group_by[],limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, true},
{Call::kExternalKeysCreate, "organization.external_keys.create", "POST", "/v1/organizations/external_keys", "api/organization/external_keys/create", "ExternalKeyCreateParams", "BetaExternalKey", "provider_config,display_name,geo", "provider_config", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kExternalKeysDelete, "organization.external_keys.delete", "DELETE", "/v1/organizations/external_keys/{external_key_id}", "api/organization/external_keys/delete", "", "ExternalKeyDeleteResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kExternalKeysList, "organization.external_keys.list", "GET", "/v1/organizations/external_keys", "api/organization/external_keys/list", "ExternalKeyListParams", "BetaExternalKey", "", "", "limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kExternalKeysRetrieve, "organization.external_keys.retrieve", "GET", "/v1/organizations/external_keys/{external_key_id}", "api/organization/external_keys/retrieve", "", "BetaExternalKey", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kExternalKeysUpdate, "organization.external_keys.update", "POST", "/v1/organizations/external_keys/{external_key_id}", "api/organization/external_keys/update", "ExternalKeyUpdateParams", "BetaExternalKey", "display_name,geo,provider_config", "", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kExternalKeysValidate, "organization.external_keys.validate", "POST", "/v1/organizations/external_keys/{external_key_id}/validate", "api/organization/external_keys/validate", "", "ExternalKeyValidateResponse", "", "", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kInvitesCreate, "organization.invites.create", "POST", "/v1/organizations/invites", "api/organization/invites/create", "InviteCreateParams", "BetaOrganizationInvite", "email,role,rbac_group_ids", "email,role", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kInvitesDelete, "organization.invites.delete", "DELETE", "/v1/organizations/invites/{invite_id}", "api/organization/invites/delete", "", "InviteDeleteResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kInvitesList, "organization.invites.list", "GET", "/v1/organizations/invites", "api/organization/invites/list", "InviteListParams", "BetaOrganizationInvite", "", "", "after_id,before_id,email,limit,roles[],statuses[]", "", "", Auth::kAdmin, Kind::kRead, Page::kIds, Wire::kJson, false, false},
{Call::kInvitesRetrieve, "organization.invites.retrieve", "GET", "/v1/organizations/invites/{invite_id}", "api/organization/invites/retrieve", "", "BetaOrganizationInvite", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kMcpTunnelsArchive, "organization.mcp_tunnels.archive", "POST", "/v1/organizations/tunnels/{tunnel_id}/archive", "api/beta/organization/mcp_tunnels/archive", "", "BetaMcpTunnel", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, true},
{Call::kMcpTunnelsCertificatesArchive, "organization.mcp_tunnels.certificates.archive", "POST", "/v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}/archive", "api/beta/organization/mcp_tunnels/tunnel_certificates/archive", "", "BetaMcpTunnelCertificate", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, true},
{Call::kMcpTunnelsCertificatesCreate, "organization.mcp_tunnels.certificates.create", "POST", "/v1/organizations/tunnels/{tunnel_id}/certificates", "api/beta/organization/mcp_tunnels/tunnel_certificates/create", "", "BetaMcpTunnelCertificate", "ca_certificate_pem", "ca_certificate_pem", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, true},
{Call::kMcpTunnelsCertificatesList, "organization.mcp_tunnels.certificates.list", "GET", "/v1/organizations/tunnels/{tunnel_id}/certificates", "api/beta/organization/mcp_tunnels/tunnel_certificates/list", "", "BetaMcpTunnelCertificate", "", "", "include_archived,limit,page", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, true},
{Call::kMcpTunnelsCertificatesRetrieve, "organization.mcp_tunnels.certificates.retrieve", "GET", "/v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}", "api/beta/organization/mcp_tunnels/tunnel_certificates/retrieve", "", "BetaMcpTunnelCertificate", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, true},
{Call::kMcpTunnelsList, "organization.mcp_tunnels.list", "GET", "/v1/organizations/tunnels", "api/beta/organization/mcp_tunnels/list", "", "BetaMcpTunnel", "", "", "include_archived,limit,page,workspace_id", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, true},
{Call::kMcpTunnelsRetrieve, "organization.mcp_tunnels.retrieve", "GET", "/v1/organizations/tunnels/{tunnel_id}", "api/beta/organization/mcp_tunnels/retrieve", "", "BetaMcpTunnel", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, true},
{Call::kMcpTunnelsRevealToken, "organization.mcp_tunnels.reveal_token", "POST", "/v1/organizations/tunnels/{tunnel_id}/reveal_token", "api/beta/organization/mcp_tunnels/reveal_token", "", "BetaMcpTunnelToken", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, true},
{Call::kMcpTunnelsRotateToken, "organization.mcp_tunnels.rotate_token", "POST", "/v1/organizations/tunnels/{tunnel_id}/rotate_token", "api/beta/organization/mcp_tunnels/rotate_token", "", "BetaMcpTunnelToken", "reason", "", "", "", "mcp-tunnels-2026-06-22", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, true},
{Call::kOrganizationRetrieve, "organization.retrieve", "GET", "/v1/organizations/me", "api/organization/retrieve", "", "BetaOrganization", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kPluginMarketplacesList, "organization.plugin_marketplaces.list", "GET", "/v1/organizations/plugin_marketplaces", "api/beta/organization/plugin_marketplaces/list", "PluginMarketplaceListParams", "BetaPluginMarketplace", "", "", "limit,organization_id,owner_type,page,source", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kPluginMarketplacesRetrieve, "organization.plugin_marketplaces.retrieve", "GET", "/v1/organizations/plugin_marketplaces/{marketplace_id}", "api/beta/organization/plugin_marketplaces/retrieve", "PluginMarketplaceRetrieveParams", "BetaPluginMarketplace", "", "", "organization_id", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kPluginMarketplacesUpdate, "organization.plugin_marketplaces.update", "POST", "/v1/organizations/plugin_marketplaces/{marketplace_id}", "api/beta/organization/plugin_marketplaces/update", "PluginMarketplaceUpdateParams", "BetaPluginMarketplace", "default_installation_preference", "default_installation_preference", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kPluginMarketplacesValidateArchive, "organization.plugin_marketplaces.validate_archive", "POST", "/v1/organizations/plugin_marketplaces/validate_archive", "api/beta/organization/plugin_marketplaces/validate_archive", "PluginMarketplaceValidateArchiveParams", "BetaPluginMarketplaceValidationReport", "archive", "archive", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kMultipart, false, false},
{Call::kPluginMarketplacesValidateRepository, "organization.plugin_marketplaces.validate_repository", "POST", "/v1/organizations/plugin_marketplaces/validate_repository", "api/beta/organization/plugin_marketplaces/validate_repository", "PluginMarketplaceValidateRepositoryParams", "BetaPluginMarketplaceValidationReport", "repository_url,ref", "repository_url", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kPluginsCreate, "organization.plugins.create", "POST", "/v1/organizations/plugins", "api/beta/organization/plugins/create", "PluginCreateParams", "BetaPlugin", "files[],marketplace_id,release_notes", "files[]", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kMultipart, false, false},
{Call::kPluginsDelete, "organization.plugins.delete", "DELETE", "/v1/organizations/plugins/{plugin_id}", "api/beta/organization/plugins/delete", "", "BetaDeletedPlugin", "", "", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kPluginsInstallationSettingsList, "organization.plugins.installation_settings.list", "GET", "/v1/organizations/plugins/{plugin_id}/installation_settings", "api/beta/organization/plugins/installation_settings/list", "InstallationSettingListParams", "BetaPluginInstallationSetting", "", "", "limit,organization_id,page,target_type", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kPluginsInstallationSettingsRemove, "organization.plugins.installation_settings.remove", "DELETE", "/v1/organizations/plugins/{plugin_id}/installation_settings/{target}", "api/beta/organization/plugins/installation_settings/remove", "", "BetaDeletedPluginInstallationSetting", "", "", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kPluginsInstallationSettingsSet, "organization.plugins.installation_settings.set", "POST", "/v1/organizations/plugins/{plugin_id}/installation_settings/{target}", "api/beta/organization/plugins/installation_settings/set", "InstallationSettingSetParams", "BetaPluginInstallationSetting", "installation_preference", "installation_preference", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kPluginsList, "organization.plugins.list", "GET", "/v1/organizations/plugins", "api/beta/organization/plugins/list", "PluginListParams", "BetaPlugin", "", "", "created_at[gt],created_at[gte],created_at[lt],created_at[lte],limit,marketplace_id,organization_id,owner_type,owner_user_id,page", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kPluginsRetrieve, "organization.plugins.retrieve", "GET", "/v1/organizations/plugins/{plugin_id}", "api/beta/organization/plugins/retrieve", "PluginRetrieveParams", "BetaPlugin", "", "", "organization_id", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kPluginsSharesList, "organization.plugins.shares.list", "GET", "/v1/organizations/plugins/{plugin_id}/shares", "api/beta/organization/plugins/shares/list", "ShareListParams", "BetaPluginShare", "", "", "limit,organization_id,page,target_type", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kPluginsUpdate, "organization.plugins.update", "POST", "/v1/organizations/plugins/{plugin_id}", "api/beta/organization/plugins/update", "PluginUpdateParams", "BetaPlugin", "served_version_id", "served_version_id", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kPluginsVersionsCreate, "organization.plugins.versions.create", "POST", "/v1/organizations/plugins/{plugin_id}/versions", "api/beta/organization/plugins/versions/create", "VersionCreateParams", "BetaPluginVersion", "files[],release_notes", "files[]", "", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kMultipart, false, false},
{Call::kPluginsVersionsDownload, "organization.plugins.versions.download", "GET", "/v1/organizations/plugins/{plugin_id}/versions/{version}/content", "api/beta/organization/plugins/versions/download", "VersionDownloadParams", "Binary", "", "", "organization_id", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kRaw, false, false},
{Call::kPluginsVersionsList, "organization.plugins.versions.list", "GET", "/v1/organizations/plugins/{plugin_id}/versions", "api/beta/organization/plugins/versions/list", "VersionListParams", "BetaPluginVersion", "", "", "limit,organization_id,page", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kPluginsVersionsRetrieve, "organization.plugins.versions.retrieve", "GET", "/v1/organizations/plugins/{plugin_id}/versions/{version}", "api/beta/organization/plugins/versions/retrieve", "VersionRetrieveParams", "BetaPluginVersion", "", "", "organization_id", "", "ce-plugins-2026-09-01", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kRateLimitsList, "organization.rate_limits.list", "GET", "/v1/organizations/rate_limits", "api/organization/rate_limits/list", "RateLimitListParams", "BetaOrganizationRateLimit", "", "", "group_type,limit,model,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kRbacGroupsCreate, "organization.rbac_groups.create", "POST", "/v1/organizations/rbac_groups", "api/beta/organization/rbac_groups/create", "RbacGroupCreateParams", "BetaRBACGroup", "name", "name", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kRbacGroupsDelete, "organization.rbac_groups.delete", "DELETE", "/v1/organizations/rbac_groups/{rbac_group_id}", "api/beta/organization/rbac_groups/delete", "", "RBACGroupDeleteResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kRbacGroupsList, "organization.rbac_groups.list", "GET", "/v1/organizations/rbac_groups", "api/beta/organization/rbac_groups/list", "RbacGroupListParams", "BetaRBACGroup", "", "", "limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kRbacGroupsMembersAdd, "organization.rbac_groups.members.add", "POST", "/v1/organizations/rbac_groups/{rbac_group_id}/members", "api/beta/organization/rbac_groups/members/add", "MemberAddParams", "BetaRBACGroupMember", "user_id", "user_id", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kRbacGroupsMembersList, "organization.rbac_groups.members.list", "GET", "/v1/organizations/rbac_groups/{rbac_group_id}/members", "api/beta/organization/rbac_groups/members/list", "MemberListParams", "BetaRBACGroupMember", "", "", "limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kRbacGroupsMembersRemove, "organization.rbac_groups.members.remove", "DELETE", "/v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id}", "api/beta/organization/rbac_groups/members/remove", "", "MemberRemoveResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kRbacGroupsRetrieve, "organization.rbac_groups.retrieve", "GET", "/v1/organizations/rbac_groups/{rbac_group_id}", "api/beta/organization/rbac_groups/retrieve", "", "BetaRBACGroup", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kRbacGroupsUpdate, "organization.rbac_groups.update", "POST", "/v1/organizations/rbac_groups/{rbac_group_id}", "api/beta/organization/rbac_groups/update", "RbacGroupUpdateParams", "BetaRBACGroup", "name", "", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kRbacRolesList, "organization.rbac_roles.list", "GET", "/v1/organizations/rbac_roles", "api/beta/organization/rbac_roles/list", "RbacRoleListParams", "BetaRBACRole", "", "", "limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kRbacRolesPermissionsList, "organization.rbac_roles.permissions.list", "GET", "/v1/organizations/rbac_roles/{rbac_role_id}/permissions", "api/beta/organization/rbac_roles/permissions/list", "PermissionListParams", "BetaRBACRolePermission", "", "", "limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kRbacRolesRetrieve, "organization.rbac_roles.retrieve", "GET", "/v1/organizations/rbac_roles/{rbac_role_id}", "api/beta/organization/rbac_roles/retrieve", "", "BetaRBACRole", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kSpendLimitsDelete, "organization.spend_limits.delete", "DELETE", "/v1/organizations/spend_limits/{spend_limit_id}", "api/beta/organization/spend_limits/delete", "", "SpendLimitDeleteResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kSpendLimitsEffectiveList, "organization.spend_limits.effective.list", "GET", "/v1/organizations/spend_limits/effective", "api/beta/organization/spend_limits/effective/list", "EffectiveListParams", "BetaSpendSummary", "", "", "limit,page,period[],user_ids[]", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kSpendLimitsIncreaseRequestsApprove, "organization.spend_limits.increase_requests.approve", "POST", "/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve", "api/beta/organization/spend_limits/increase_requests/approve", "IncreaseRequestApproveParams", "IncreaseRequestApproveResponse", "amount,period,suppress_notification", "amount", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kSpendLimitsIncreaseRequestsDeny, "organization.spend_limits.increase_requests.deny", "POST", "/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/deny", "api/beta/organization/spend_limits/increase_requests/deny", "IncreaseRequestDenyParams", "BetaSpendLimitIncreaseRequest", "suppress_notification", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kSpendLimitsIncreaseRequestsList, "organization.spend_limits.increase_requests.list", "GET", "/v1/organizations/spend_limit_increase_requests", "api/beta/organization/spend_limits/increase_requests/list", "IncreaseRequestListParams", "BetaSpendLimitIncreaseRequest", "", "", "actor_ids[],limit,page,status[]", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kSpendLimitsIncreaseRequestsRetrieve, "organization.spend_limits.increase_requests.retrieve", "GET", "/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}", "api/beta/organization/spend_limits/increase_requests/retrieve", "", "BetaSpendLimitIncreaseRequest", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kSpendLimitsList, "organization.spend_limits.list", "GET", "/v1/organizations/spend_limits", "api/beta/organization/spend_limits/list", "SpendLimitListParams", "BetaSpendLimit", "", "", "limit,page,scope_type[],workspace_id", "", "spend-limit-reads-2026-09-26", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kSpendLimitsRetrieve, "organization.spend_limits.retrieve", "GET", "/v1/organizations/spend_limits/{spend_limit_id}", "api/beta/organization/spend_limits/retrieve", "", "BetaSpendLimit", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kSpendLimitsSet, "organization.spend_limits.set", "POST", "/v1/organizations/spend_limits", "api/beta/organization/spend_limits/set", "SpendLimitSetParams", "BetaSpendLimit", "amount,scope,period", "amount,scope", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsCreate, "organization.telemetry_destinations.create", "POST", "/v1/organizations/telemetry_destinations", "api/beta/organization/telemetry_destinations/create", "TelemetryDestinationCreateParams", "BetaTelemetryDestination", "endpoint_url,workspaces,display_name,headers,traces", "endpoint_url,workspaces", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsDelete, "organization.telemetry_destinations.delete", "DELETE", "/v1/organizations/telemetry_destinations/{destination_id}", "api/beta/organization/telemetry_destinations/delete", "", "BetaDeletedTelemetryDestination", "", "", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsList, "organization.telemetry_destinations.list", "GET", "/v1/organizations/telemetry_destinations", "api/beta/organization/telemetry_destinations/list", "TelemetryDestinationListParams", "BetaTelemetryDestination", "", "", "limit,page,workspace_ids[]", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kTelemetryDestinationsRetrieve, "organization.telemetry_destinations.retrieve", "GET", "/v1/organizations/telemetry_destinations/{destination_id}", "api/beta/organization/telemetry_destinations/retrieve", "", "BetaTelemetryDestination", "", "", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsTest, "organization.telemetry_destinations.test", "POST", "/v1/organizations/telemetry_destinations/{destination_id}/test", "api/beta/organization/telemetry_destinations/test", "", "BetaTelemetryDestinationTestResponse", "", "", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsUpdate, "organization.telemetry_destinations.update", "POST", "/v1/organizations/telemetry_destinations/{destination_id}", "api/beta/organization/telemetry_destinations/update", "TelemetryDestinationUpdateParams", "BetaTelemetryDestination", "display_name,endpoint_url,headers,state,traces,workspaces", "", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsWorkspacesAdd, "organization.telemetry_destinations.workspaces.add", "POST", "/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}", "api/beta/organization/telemetry_destinations/workspaces/add", "", "BetaTelemetryDestinationWorkspace", "", "", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kTelemetryDestinationsWorkspacesList, "organization.telemetry_destinations.workspaces.list", "GET", "/v1/organizations/telemetry_destinations/{destination_id}/workspaces", "api/beta/organization/telemetry_destinations/workspaces/list", "WorkspaceListParams", "BetaTelemetryDestinationWorkspace", "", "", "limit,page", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kTelemetryDestinationsWorkspacesRemove, "organization.telemetry_destinations.workspaces.remove", "DELETE", "/v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id}", "api/beta/organization/telemetry_destinations/workspaces/remove", "", "BetaDeletedTelemetryDestinationWorkspace", "", "", "", "", "telemetry-destinations-2026-08-11", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kUsageReportRetrieveClaudeCode, "organization.usage_report.retrieve_claude_code", "GET", "/v1/organizations/usage_report/claude_code", "api/beta/organization/usage_report/retrieve_claude_code", "", "BetaClaudeCodeUsageReport", "", "starting_at", "starting_at,limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, true},
{Call::kUsageReportRetrieveMessages, "organization.usage_report.retrieve_messages", "GET", "/v1/organizations/usage_report/messages", "api/beta/organization/usage_report/retrieve_messages", "", "BetaMessagesUsageReport", "", "starting_at", "starting_at,account_ids[],api_key_ids[],bucket_width,context_window[],ending_at,group_by[],inference_geos[],limit,models[],page,service_account_ids[],service_tiers[],speeds[],workspace_ids[]", "", "", Auth::kAdmin, Kind::kRead, Page::kReport, Wire::kJson, false, true},
{Call::kUsersList, "organization.users.list", "GET", "/v1/organizations/users", "api/organization/users/list", "UserListParams", "BetaOrganizationUser", "", "", "after_id,before_id,email,limit,roles[]", "", "", Auth::kAdmin, Kind::kRead, Page::kIds, Wire::kJson, false, false},
{Call::kUsersRemove, "organization.users.remove", "DELETE", "/v1/organizations/users/{user_id}", "api/organization/users/remove", "", "UserRemoveResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kUsersRetrieve, "organization.users.retrieve", "GET", "/v1/organizations/users/{user_id}", "api/organization/users/retrieve", "", "BetaOrganizationUser", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kUsersUpdate, "organization.users.update", "POST", "/v1/organizations/users/{user_id}", "api/organization/users/update", "UserUpdateParams", "BetaOrganizationUser", "role", "role", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kWebhooksCreate, "organization.webhooks.create", "POST", "/v1/organizations/webhooks", "api/beta/organization/webhooks/create", "WebhookCreateParams", "BetaNewOrganizationWebhookEndpoint", "enabled_events,url,description,name", "enabled_events,url", "", "", "webhooks-2026-10-07", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kWebhooksDelete, "organization.webhooks.delete", "DELETE", "/v1/organizations/webhooks/{webhook_endpoint_id}", "api/beta/organization/webhooks/delete", "", "BetaDeletedOrganizationWebhookEndpoint", "", "", "", "", "webhooks-2026-10-07", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kWebhooksList, "organization.webhooks.list", "GET", "/v1/organizations/webhooks", "api/beta/organization/webhooks/list", "WebhookListParams", "BetaOrganizationWebhookEndpoint", "", "", "after_id,before_id,limit,order", "", "webhooks-2026-10-07", Auth::kAdmin, Kind::kRead, Page::kIds, Wire::kJson, false, false},
{Call::kWebhooksRegenerateSigningSecret, "organization.webhooks.regenerate_signing_secret", "POST", "/v1/organizations/webhooks/{webhook_endpoint_id}/regenerate_signing_secret", "api/beta/organization/webhooks/regenerate_signing_secret", "", "BetaOrganizationWebhookEndpointSigningSecret", "", "", "", "", "webhooks-2026-10-07", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kWebhooksRetrieve, "organization.webhooks.retrieve", "GET", "/v1/organizations/webhooks/{webhook_endpoint_id}", "api/beta/organization/webhooks/retrieve", "", "BetaOrganizationWebhookEndpoint", "", "", "", "", "webhooks-2026-10-07", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kWebhooksUpdate, "organization.webhooks.update", "POST", "/v1/organizations/webhooks/{webhook_endpoint_id}", "api/beta/organization/webhooks/update", "WebhookUpdateParams", "BetaOrganizationWebhookEndpoint", "description,enabled_events,name,state,url", "", "", "", "webhooks-2026-10-07", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesArchive, "organization.workspaces.archive", "POST", "/v1/organizations/workspaces/{workspace_id}/archive", "api/organization/workspaces/archive", "", "BetaWorkspace", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesCreate, "organization.workspaces.create", "POST", "/v1/organizations/workspaces", "api/organization/workspaces/create", "WorkspaceCreateParams", "BetaWorkspace", "name,data_residency,display_color,external_key_id,tags", "name", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesList, "organization.workspaces.list", "GET", "/v1/organizations/workspaces", "api/organization/workspaces/list", "WorkspaceListParams", "BetaWorkspace", "", "", "after_id,before_id,include_archived,include_default,limit", "", "", Auth::kAdmin, Kind::kRead, Page::kIds, Wire::kJson, false, false},
{Call::kWorkspacesMembersAdd, "organization.workspaces.members.add", "POST", "/v1/organizations/workspaces/{workspace_id}/members", "api/organization/workspaces/members/add", "MemberAddParams", "BetaWorkspaceMember", "user_id,workspace_role", "user_id,workspace_role", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesMembersList, "organization.workspaces.members.list", "GET", "/v1/organizations/workspaces/{workspace_id}/members", "api/organization/workspaces/members/list", "MemberListParams", "BetaWorkspaceMember", "", "", "after_id,before_id,limit", "", "", Auth::kAdmin, Kind::kRead, Page::kIds, Wire::kJson, false, false},
{Call::kWorkspacesMembersRemove, "organization.workspaces.members.remove", "DELETE", "/v1/organizations/workspaces/{workspace_id}/members/{user_id}", "api/organization/workspaces/members/remove", "", "MemberRemoveResponse", "", "", "", "", "", Auth::kAdmin, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kWorkspacesMembersRetrieve, "organization.workspaces.members.retrieve", "GET", "/v1/organizations/workspaces/{workspace_id}/members/{user_id}", "api/organization/workspaces/members/retrieve", "", "BetaWorkspaceMember", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kWorkspacesMembersUpdate, "organization.workspaces.members.update", "POST", "/v1/organizations/workspaces/{workspace_id}/members/{user_id}", "api/organization/workspaces/members/update", "MemberUpdateParams", "BetaWorkspaceMember", "workspace_role", "workspace_role", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kWorkspacesRateLimitsList, "organization.workspaces.rate_limits.list", "GET", "/v1/organizations/workspaces/{workspace_id}/rate_limits", "api/organization/workspaces/rate_limits/list", "RateLimitListParams", "BetaWorkspaceRateLimit", "", "", "group_type,include_inherited,limit,page", "", "", Auth::kAdmin, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kWorkspacesRateLimitsUpdate, "organization.workspaces.rate_limits.update", "POST", "/v1/organizations/workspaces/{workspace_id}/rate_limits/{rate_limit_id}", "api/organization/workspaces/rate_limits/update", "RateLimitUpdateParams", "BetaWorkspaceRateLimit", "limits", "limits", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kWorkspacesRetrieve, "organization.workspaces.retrieve", "GET", "/v1/organizations/workspaces/{workspace_id}", "api/organization/workspaces/retrieve", "", "BetaWorkspace", "", "", "", "", "", Auth::kAdmin, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesUpdate, "organization.workspaces.update", "POST", "/v1/organizations/workspaces/{workspace_id}", "api/organization/workspaces/update", "WorkspaceUpdateParams", "BetaWorkspace", "data_residency,display_color,external_key_id,name,tags", "", "", "", "", Auth::kAdmin, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kFederationIssuersArchive, "organization.federation.issuers.archive", "POST", "/v1/organizations/federation_issuers/{federation_issuer_id}/archive", "api/organization/federation/issuers/archive", "", "BetaFederationIssuer", "", "", "", "", "", Auth::kOAuth, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kFederationIssuersCreate, "organization.federation.issuers.create", "POST", "/v1/organizations/federation_issuers", "api/organization/federation/issuers/create", "IssuerCreateParams", "BetaFederationIssuer", "issuer_url,name,check_jti,jwks,max_jwt_lifetime_seconds", "issuer_url,name", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kFederationIssuersList, "organization.federation.issuers.list", "GET", "/v1/organizations/federation_issuers", "api/organization/federation/issuers/list", "IssuerListParams", "BetaFederationIssuer", "", "", "include_archived,limit,page", "", "", Auth::kOAuth, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kFederationIssuersRetrieve, "organization.federation.issuers.retrieve", "GET", "/v1/organizations/federation_issuers/{federation_issuer_id}", "api/organization/federation/issuers/retrieve", "", "BetaFederationIssuer", "", "", "", "", "", Auth::kOAuth, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kFederationIssuersUpdate, "organization.federation.issuers.update", "POST", "/v1/organizations/federation_issuers/{federation_issuer_id}", "api/organization/federation/issuers/update", "IssuerUpdateParams", "BetaFederationIssuer", "check_jti,issuer_url,jwks,jwks_polling_disabled,max_jwt_lifetime_seconds,name", "", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kFederationRulesArchive, "organization.federation.rules.archive", "POST", "/v1/organizations/federation_rules/{federation_rule_id}/archive", "api/organization/federation/rules/archive", "", "BetaFederationRule", "", "", "", "", "", Auth::kOAuth, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kFederationRulesCreate, "organization.federation.rules.create", "POST", "/v1/organizations/federation_rules", "api/organization/federation/rules/create", "RuleCreateParams", "BetaFederationRule", "issuer_id,match,name,oauth_scope,target,applies_to_all_workspaces,attributes,description,token_lifetime_seconds,workspace_id", "issuer_id,match,name,oauth_scope,target", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kFederationRulesList, "organization.federation.rules.list", "GET", "/v1/organizations/federation_rules", "api/organization/federation/rules/list", "RuleListParams", "BetaFederationRule", "", "", "include_archived,issuer_id,limit,page", "", "", Auth::kOAuth, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kFederationRulesRetrieve, "organization.federation.rules.retrieve", "GET", "/v1/organizations/federation_rules/{federation_rule_id}", "api/organization/federation/rules/retrieve", "", "BetaFederationRule", "", "", "", "", "", Auth::kOAuth, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kFederationRulesUpdate, "organization.federation.rules.update", "POST", "/v1/organizations/federation_rules/{federation_rule_id}", "api/organization/federation/rules/update", "RuleUpdateParams", "BetaFederationRule", "applies_to_all_workspaces,attributes,description,match,name,oauth_scope,target,token_lifetime_seconds,workspace_id", "", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kFederationRulesWorkspacesAdd, "organization.federation.rules.workspaces.add", "POST", "/v1/organizations/federation_rules/{federation_rule_id}/workspaces", "api/organization/federation/rules/workspaces/add", "WorkspaceAddParams", "BetaFederationRuleWorkspace", "workspace_id", "workspace_id", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kFederationRulesWorkspacesList, "organization.federation.rules.workspaces.list", "GET", "/v1/organizations/federation_rules/{federation_rule_id}/workspaces", "api/organization/federation/rules/workspaces/list", "WorkspaceListParams", "BetaFederationRuleWorkspace", "", "", "limit,page", "", "", Auth::kOAuth, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kFederationRulesWorkspacesRemove, "organization.federation.rules.workspaces.remove", "DELETE", "/v1/organizations/federation_rules/{federation_rule_id}/workspaces/{workspace_id}", "api/organization/federation/rules/workspaces/remove", "", "WorkspaceRemoveResponse", "", "", "", "", "", Auth::kOAuth, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kServiceAccountsArchive, "organization.service_accounts.archive", "POST", "/v1/organizations/service_accounts/{service_account_id}/archive", "api/organization/service_accounts/archive", "", "BetaServiceAccount", "", "", "", "", "", Auth::kOAuth, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kServiceAccountsCreate, "organization.service_accounts.create", "POST", "/v1/organizations/service_accounts", "api/organization/service_accounts/create", "ServiceAccountCreateParams", "BetaServiceAccount", "name,description,organization_role", "name", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kServiceAccountsList, "organization.service_accounts.list", "GET", "/v1/organizations/service_accounts", "api/organization/service_accounts/list", "ServiceAccountListParams", "BetaServiceAccount", "", "", "include_archived,limit,page", "", "", Auth::kOAuth, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kServiceAccountsRetrieve, "organization.service_accounts.retrieve", "GET", "/v1/organizations/service_accounts/{service_account_id}", "api/organization/service_accounts/retrieve", "", "BetaServiceAccount", "", "", "", "", "", Auth::kOAuth, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kServiceAccountsUpdate, "organization.service_accounts.update", "POST", "/v1/organizations/service_accounts/{service_account_id}", "api/organization/service_accounts/update", "ServiceAccountUpdateParams", "BetaServiceAccount", "description,organization_role", "", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kServiceAccountsWorkspacesAdd, "organization.service_accounts.workspaces.add", "POST", "/v1/organizations/service_accounts/{service_account_id}/workspaces", "api/organization/service_accounts/workspaces/add", "WorkspaceAddParams", "BetaServiceAccountWorkspaceMember", "workspace_id,workspace_role", "workspace_id,workspace_role", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kServiceAccountsWorkspacesList, "organization.service_accounts.workspaces.list", "GET", "/v1/organizations/service_accounts/{service_account_id}/workspaces", "api/organization/service_accounts/workspaces/list", "WorkspaceListParams", "BetaServiceAccountWorkspaceMember", "", "", "limit,page", "", "", Auth::kOAuth, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kServiceAccountsWorkspacesRemove, "organization.service_accounts.workspaces.remove", "DELETE", "/v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id}", "api/organization/service_accounts/workspaces/remove", "", "WorkspaceRemoveResponse", "", "", "", "", "", Auth::kOAuth, Kind::kDestructive, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesServiceAccountsAdd, "organization.workspaces.service_accounts.add", "POST", "/v1/organizations/workspaces/{workspace_id}/service_accounts", "api/organization/workspaces/service_accounts/add", "ServiceAccountAddParams", "BetaServiceAccountWorkspaceMember", "service_account_id,workspace_role", "service_account_id,workspace_role", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kWorkspacesServiceAccountsList, "organization.workspaces.service_accounts.list", "GET", "/v1/organizations/workspaces/{workspace_id}/service_accounts", "api/organization/workspaces/service_accounts/list", "ServiceAccountListParams", "BetaServiceAccountWorkspaceMember", "", "", "limit,page", "", "", Auth::kOAuth, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kWorkspacesServiceAccountsRemove, "organization.workspaces.service_accounts.remove", "DELETE", "/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}", "api/organization/workspaces/service_accounts/remove", "", "ServiceAccountRemoveResponse", "", "", "", "", "", Auth::kOAuth, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kWorkspacesServiceAccountsRetrieve, "organization.workspaces.service_accounts.retrieve", "GET", "/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}", "api/organization/workspaces/service_accounts/retrieve", "", "BetaServiceAccountWorkspaceMember", "", "", "", "", "", Auth::kOAuth, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kWorkspacesServiceAccountsUpdate, "organization.workspaces.service_accounts.update", "POST", "/v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}", "api/organization/workspaces/service_accounts/update", "ServiceAccountUpdateParams", "BetaServiceAccountWorkspaceMember", "workspace_role", "workspace_role", "", "", "", Auth::kOAuth, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kAgentsArchive, "agents.archive", "POST", "/v1/agents/{agent_id}/archive", "api/beta/agents/archive", "", "BetaManagedAgentsAgent", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kAgentsCreate, "agents.create", "POST", "/v1/agents", "api/beta/agents/create", "AgentCreateParams", "BetaManagedAgentsAgent", "model,name,description,execution_identity,mcp_servers,metadata,multiagent,skills,system,tools", "model,name", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kAgentsList, "agents.list", "GET", "/v1/agents", "api/beta/agents/list", "AgentListParams", "BetaManagedAgentsAgent", "", "", "created_at[gte],created_at[lte],include_archived,limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kAgentsRetrieve, "agents.retrieve", "GET", "/v1/agents/{agent_id}", "api/beta/agents/retrieve", "AgentRetrieveParams", "BetaManagedAgentsAgent", "", "", "version", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kAgentsUpdate, "agents.update", "POST", "/v1/agents/{agent_id}", "api/beta/agents/update", "AgentUpdateParams", "BetaManagedAgentsAgent", "description,execution_identity,mcp_servers,metadata,model,multiagent,name,skills,system,tools,version", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kAgentsVersionsList, "agents.versions.list", "GET", "/v1/agents/{agent_id}/versions", "api/beta/agents/versions/list", "VersionListParams", "BetaManagedAgentsAgent", "", "", "limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kDeploymentRunsList, "deployment_runs.list", "GET", "/v1/deployment_runs", "api/beta/deployment_runs/list", "DeploymentRunListParams", "BetaManagedAgentsDeploymentRun", "", "", "created_at[gt],created_at[gte],created_at[lt],created_at[lte],deployment_id,has_error,limit,page,trigger_type", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kDeploymentRunsRetrieve, "deployment_runs.retrieve", "GET", "/v1/deployment_runs/{deployment_run_id}", "api/beta/deployment_runs/retrieve", "", "BetaManagedAgentsDeploymentRun", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsArchive, "deployments.archive", "POST", "/v1/deployments/{deployment_id}/archive", "api/beta/deployments/archive", "", "BetaManagedAgentsDeployment", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsCreate, "deployments.create", "POST", "/v1/deployments", "api/beta/deployments/create", "DeploymentCreateParams", "BetaManagedAgentsDeployment", "agent,environment_id,initial_events,name,budget,description,metadata,resources,schedule,vault_ids", "agent,environment_id,initial_events,name", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsList, "deployments.list", "GET", "/v1/deployments", "api/beta/deployments/list", "DeploymentListParams", "BetaManagedAgentsDeployment", "", "", "agent_id,created_at[gte],created_at[lte],include_archived,limit,page,status", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kDeploymentsPause, "deployments.pause", "POST", "/v1/deployments/{deployment_id}/pause", "api/beta/deployments/pause", "", "BetaManagedAgentsDeployment", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsRetrieve, "deployments.retrieve", "GET", "/v1/deployments/{deployment_id}", "api/beta/deployments/retrieve", "", "BetaManagedAgentsDeployment", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsRun, "deployments.run", "POST", "/v1/deployments/{deployment_id}/run", "api/beta/deployments/run", "", "BetaManagedAgentsDeploymentRun", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsUnpause, "deployments.unpause", "POST", "/v1/deployments/{deployment_id}/unpause", "api/beta/deployments/unpause", "", "BetaManagedAgentsDeployment", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kDeploymentsUpdate, "deployments.update", "POST", "/v1/deployments/{deployment_id}", "api/beta/deployments/update", "DeploymentUpdateParams", "BetaManagedAgentsDeployment", "agent,budget,description,environment_id,initial_events,metadata,name,resources,schedule,vault_ids", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kDreamsArchive, "dreams.archive", "POST", "/v1/dreams/{dream_id}/archive", "api/beta/dreams/archive", "", "BetaDream", "", "", "", "", "dreaming-2026-04-21", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kDreamsCancel, "dreams.cancel", "POST", "/v1/dreams/{dream_id}/cancel", "api/beta/dreams/cancel", "", "BetaDream", "", "", "", "", "dreaming-2026-04-21", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kDreamsCreate, "dreams.create", "POST", "/v1/dreams", "api/beta/dreams/create", "DreamCreateParams", "BetaDream", "inputs,model,instructions,output_behavior", "inputs,model", "", "", "dreaming-2026-04-21", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kDreamsList, "dreams.list", "GET", "/v1/dreams", "api/beta/dreams/list", "DreamListParams", "BetaDream", "", "", "created_at[gt],created_at[lt],include_archived,limit,page,statuses[]", "", "dreaming-2026-04-21", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kDreamsRetrieve, "dreams.retrieve", "GET", "/v1/dreams/{dream_id}", "api/beta/dreams/retrieve", "", "BetaDream", "", "", "", "", "dreaming-2026-04-21", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsArchive, "environments.archive", "POST", "/v1/environments/{environment_id}/archive", "api/beta/environments/archive", "", "BetaEnvironment", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsCreate, "environments.create", "POST", "/v1/environments", "api/beta/environments/create", "EnvironmentCreateParams", "BetaEnvironment", "name,config,description,metadata,scope", "name", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsDelete, "environments.delete", "DELETE", "/v1/environments/{environment_id}", "api/beta/environments/delete", "", "BetaEnvironmentDeleteResponse", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsList, "environments.list", "GET", "/v1/environments", "api/beta/environments/list", "EnvironmentListParams", "BetaEnvironment", "", "", "include_archived,limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kEnvironmentsRetrieve, "environments.retrieve", "GET", "/v1/environments/{environment_id}", "api/beta/environments/retrieve", "", "BetaEnvironment", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsUpdate, "environments.update", "POST", "/v1/environments/{environment_id}", "api/beta/environments/update", "EnvironmentUpdateParams", "BetaEnvironment", "config,description,metadata,name,scope", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsWorkAck, "environments.work.ack", "POST", "/v1/environments/{environment_id}/work/{work_id}/ack", "api/beta/environments/work/ack", "", "BetaSelfHostedWork", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kEnvironmentsWorkHeartbeat, "environments.work.heartbeat", "POST", "/v1/environments/{environment_id}/work/{work_id}/heartbeat", "api/beta/environments/work/heartbeat", "WorkHeartbeatParams", "BetaSelfHostedWorkHeartbeatResponse", "", "", "desired_ttl_seconds,expected_last_heartbeat", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, false, false},
{Call::kEnvironmentsWorkList, "environments.work.list", "GET", "/v1/environments/{environment_id}/work", "api/beta/environments/work/list", "WorkListParams", "BetaSelfHostedWork", "", "", "limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, false, false},
{Call::kEnvironmentsWorkPoll, "environments.work.poll", "GET", "/v1/environments/{environment_id}/work/poll", "api/beta/environments/work/poll", "WorkPollParams", "BetaSelfHostedWork", "", "", "block_ms,reclaim_older_than_ms", "anthropic_worker_id=Anthropic-Worker-ID", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, false, false},
{Call::kEnvironmentsWorkRetrieve, "environments.work.retrieve", "GET", "/v1/environments/{environment_id}/work/{work_id}", "api/beta/environments/work/retrieve", "", "BetaSelfHostedWork", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsWorkStats, "environments.work.stats", "GET", "/v1/environments/{environment_id}/work/stats", "api/beta/environments/work/stats", "", "BetaSelfHostedWorkQueueStats", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsWorkStop, "environments.work.stop", "POST", "/v1/environments/{environment_id}/work/{work_id}/stop", "api/beta/environments/work/stop", "WorkStopParams", "BetaSelfHostedWork", "force", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kEnvironmentsWorkUpdate, "environments.work.update", "POST", "/v1/environments/{environment_id}/work/{work_id}", "api/beta/environments/work/update", "WorkUpdateParams", "BetaSelfHostedWork", "metadata", "metadata", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresArchive, "memory_stores.archive", "POST", "/v1/memory_stores/{memory_store_id}/archive", "api/beta/memory_stores/archive", "", "BetaManagedAgentsMemoryStore", "", "", "", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresCreate, "memory_stores.create", "POST", "/v1/memory_stores", "api/beta/memory_stores/create", "MemoryStoreCreateParams", "BetaManagedAgentsMemoryStore", "name,description,metadata", "name", "", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresDelete, "memory_stores.delete", "DELETE", "/v1/memory_stores/{memory_store_id}", "api/beta/memory_stores/delete", "", "BetaManagedAgentsDeletedMemoryStore", "", "", "", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresList, "memory_stores.list", "GET", "/v1/memory_stores", "api/beta/memory_stores/list", "MemoryStoreListParams", "BetaManagedAgentsMemoryStore", "", "", "created_at[gte],created_at[lte],include_archived,limit,page", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kMemoryStoresMemoriesCreate, "memory_stores.memories.create", "POST", "/v1/memory_stores/{memory_store_id}/memories", "api/beta/memory_stores/memories/create", "MemoryCreateParams", "BetaManagedAgentsMemory", "content,path", "content,path", "view", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresMemoriesDelete, "memory_stores.memories.delete", "DELETE", "/v1/memory_stores/{memory_store_id}/memories/{memory_id}", "api/beta/memory_stores/memories/delete", "MemoryDeleteParams", "BetaManagedAgentsDeletedMemory", "", "", "expected_content_sha256", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresMemoriesList, "memory_stores.memories.list", "GET", "/v1/memory_stores/{memory_store_id}/memories", "api/beta/memory_stores/memories/list", "MemoryListParams", "BetaManagedAgentsMemoryListItem", "", "", "depth,limit,page,path_prefix,view", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kMemoryStoresMemoriesRetrieve, "memory_stores.memories.retrieve", "GET", "/v1/memory_stores/{memory_store_id}/memories/{memory_id}", "api/beta/memory_stores/memories/retrieve", "MemoryRetrieveParams", "BetaManagedAgentsMemory", "", "", "view", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresMemoriesUpdate, "memory_stores.memories.update", "POST", "/v1/memory_stores/{memory_store_id}/memories/{memory_id}", "api/beta/memory_stores/memories/update", "MemoryUpdateParams", "BetaManagedAgentsMemory", "content,path,precondition", "", "view", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresMemoryVersionsList, "memory_stores.memory_versions.list", "GET", "/v1/memory_stores/{memory_store_id}/memory_versions", "api/beta/memory_stores/memory_versions/list", "MemoryVersionListParams", "BetaManagedAgentsMemoryVersion", "", "", "api_key_id,created_at[gte],created_at[lte],limit,memory_id,operation,page,service_account_id,session_id,view", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kMemoryStoresMemoryVersionsRedact, "memory_stores.memory_versions.redact", "POST", "/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact", "api/beta/memory_stores/memory_versions/redact", "", "BetaManagedAgentsMemoryVersion", "", "", "", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresMemoryVersionsRetrieve, "memory_stores.memory_versions.retrieve", "GET", "/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}", "api/beta/memory_stores/memory_versions/retrieve", "MemoryVersionRetrieveParams", "BetaManagedAgentsMemoryVersion", "", "", "view", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresRetrieve, "memory_stores.retrieve", "GET", "/v1/memory_stores/{memory_store_id}", "api/beta/memory_stores/retrieve", "", "BetaManagedAgentsMemoryStore", "", "", "", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kMemoryStoresUpdate, "memory_stores.update", "POST", "/v1/memory_stores/{memory_store_id}", "api/beta/memory_stores/update", "MemoryStoreUpdateParams", "BetaManagedAgentsMemoryStore", "description,metadata,name", "", "", "", "agent-memory-2026-07-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsArchive, "sessions.archive", "POST", "/v1/sessions/{session_id}/archive", "api/beta/sessions/archive", "", "BetaManagedAgentsSession", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsCreate, "sessions.create", "POST", "/v1/sessions", "api/beta/sessions/create", "SessionCreateParams", "BetaManagedAgentsSession", "agent,environment_id,budget,initial_events,metadata,resources,title,vault_ids", "agent,environment_id", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsDelete, "sessions.delete", "DELETE", "/v1/sessions/{session_id}", "api/beta/sessions/delete", "", "BetaManagedAgentsDeletedSession", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsEventsList, "sessions.events.list", "GET", "/v1/sessions/{session_id}/events", "api/beta/sessions/events/list", "EventListParams", "BetaManagedAgentsSessionEvent", "", "", "created_at[gt],created_at[gte],created_at[lt],created_at[lte],limit,order,page,types[]", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kSessionsEventsSend, "sessions.events.send", "POST", "/v1/sessions/{session_id}/events", "api/beta/sessions/events/send", "EventSendParams", "BetaManagedAgentsSendSessionEvents", "events", "events", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsEventsStream, "sessions.events.stream", "GET", "/v1/sessions/{session_id}/events/stream", "api/beta/sessions/events/stream", "EventStreamParams", "BetaManagedAgentsStreamSessionEvents", "", "", "event_deltas[]", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kSse, true, false},
{Call::kSessionsList, "sessions.list", "GET", "/v1/sessions", "api/beta/sessions/list", "SessionListParams", "BetaManagedAgentsSession", "", "", "agent_id,agent_version,created_at[gt],created_at[gte],created_at[lt],created_at[lte],deployment_id,include_archived,limit,memory_store_id,order,page,statuses[]", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kBidirectional, Wire::kJson, true, false},
{Call::kSessionsResourcesAdd, "sessions.resources.add", "POST", "/v1/sessions/{session_id}/resources", "api/beta/sessions/resources/add", "ResourceAddParams", "BetaManagedAgentsFileResource", "file_id,type,mount_path", "file_id,type", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsResourcesDelete, "sessions.resources.delete", "DELETE", "/v1/sessions/{session_id}/resources/{resource_id}", "api/beta/sessions/resources/delete", "", "BetaManagedAgentsDeleteSessionResource", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsResourcesList, "sessions.resources.list", "GET", "/v1/sessions/{session_id}/resources", "api/beta/sessions/resources/list", "ResourceListParams", "BetaManagedAgentsSessionResource", "", "", "limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kSessionsResourcesRetrieve, "sessions.resources.retrieve", "GET", "/v1/sessions/{session_id}/resources/{resource_id}", "api/beta/sessions/resources/retrieve", "", "ResourceRetrieveResponse", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsResourcesUpdate, "sessions.resources.update", "POST", "/v1/sessions/{session_id}/resources/{resource_id}", "api/beta/sessions/resources/update", "ResourceUpdateParams", "ResourceUpdateResponse", "authorization_token", "authorization_token", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsRetrieve, "sessions.retrieve", "GET", "/v1/sessions/{session_id}", "api/beta/sessions/retrieve", "", "BetaManagedAgentsSession", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsThreadsArchive, "sessions.threads.archive", "POST", "/v1/sessions/{session_id}/threads/{thread_id}/archive", "api/beta/sessions/threads/archive", "", "BetaManagedAgentsSessionThread", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsThreadsEventsList, "sessions.threads.events.list", "GET", "/v1/sessions/{session_id}/threads/{thread_id}/events", "api/beta/sessions/threads/events/list", "EventListParams", "BetaManagedAgentsSessionEvent", "", "", "limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kSessionsThreadsEventsStream, "sessions.threads.events.stream", "GET", "/v1/sessions/{session_id}/threads/{thread_id}/stream", "api/beta/sessions/threads/events/stream", "EventStreamParams", "BetaManagedAgentsStreamSessionThreadEvents", "", "", "event_deltas[]", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kSse, true, false},
{Call::kSessionsThreadsList, "sessions.threads.list", "GET", "/v1/sessions/{session_id}/threads", "api/beta/sessions/threads/list", "ThreadListParams", "BetaManagedAgentsSessionThread", "", "", "limit,page,statuses[]", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kSessionsThreadsRetrieve, "sessions.threads.retrieve", "GET", "/v1/sessions/{session_id}/threads/{thread_id}", "api/beta/sessions/threads/retrieve", "", "BetaManagedAgentsSessionThread", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kSessionsUpdate, "sessions.update", "POST", "/v1/sessions/{session_id}", "api/beta/sessions/update", "SessionUpdateParams", "BetaManagedAgentsSession", "agent,budget,metadata,title,vault_ids", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsArchive, "tunnels.archive", "POST", "/v1/tunnels/{tunnel_id}/archive", "api/beta/tunnels/archive", "", "BetaTunnel", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsCertificatesArchive, "tunnels.certificates.archive", "POST", "/v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive", "api/beta/tunnels/certificates/archive", "", "BetaTunnelCertificate", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsCertificatesCreate, "tunnels.certificates.create", "POST", "/v1/tunnels/{tunnel_id}/certificates", "api/beta/tunnels/certificates/create", "CertificateCreateParams", "BetaTunnelCertificate", "ca_certificate_pem", "ca_certificate_pem", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsCertificatesList, "tunnels.certificates.list", "GET", "/v1/tunnels/{tunnel_id}/certificates", "api/beta/tunnels/certificates/list", "CertificateListParams", "BetaTunnelCertificate", "", "", "include_archived,limit,page", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kTunnelsCertificatesRetrieve, "tunnels.certificates.retrieve", "GET", "/v1/tunnels/{tunnel_id}/certificates/{certificate_id}", "api/beta/tunnels/certificates/retrieve", "", "BetaTunnelCertificate", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsCreate, "tunnels.create", "POST", "/v1/tunnels", "api/beta/tunnels/create", "TunnelCreateParams", "BetaTunnel", "display_name", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsList, "tunnels.list", "GET", "/v1/tunnels", "api/beta/tunnels/list", "TunnelListParams", "BetaTunnel", "", "", "include_archived,limit,page", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kTunnelsRetrieve, "tunnels.retrieve", "GET", "/v1/tunnels/{tunnel_id}", "api/beta/tunnels/retrieve", "", "BetaTunnel", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsRevealToken, "tunnels.reveal_token", "POST", "/v1/tunnels/{tunnel_id}/reveal_token", "api/beta/tunnels/reveal_token", "", "BetaTunnelToken", "", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kTunnelsRotateToken, "tunnels.rotate_token", "POST", "/v1/tunnels/{tunnel_id}/rotate_token", "api/beta/tunnels/rotate_token", "TunnelRotateTokenParams", "BetaTunnelToken", "reason", "", "", "", "mcp-tunnels-2026-06-22", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesActionUrlsCreate, "user_profiles.action_urls.create", "POST", "/v1/user_profiles/{user_profile_id}/action_urls", "api/user_profiles/action_urls/create", "ActionUrlCreateParams", "UserProfileActionURL", "action", "action", "", "", "", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesActionUrlsCreateBeta, "user_profiles.action_urls.createbeta", "POST", "/v1/user_profiles/{user_profile_id}/action_urls", "api/beta/user_profiles/action_urls/create", "ActionUrlCreateParams", "BetaUserProfileActionURL", "action", "action", "", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesCreate, "user_profiles.create", "POST", "/v1/user_profiles", "api/user_profiles/create", "UserProfileCreateParams", "UserProfile", "access_type,external_user_details,metadata,name", "", "", "", "", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesCreateBeta, "user_profiles.createbeta", "POST", "/v1/user_profiles", "api/beta/user_profiles/create", "UserProfileCreateParams", "BetaUserProfile", "access_type,external_id,external_user_details,external_user_onboarded_at,metadata,name", "", "", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesCreateEnrollmentUrl, "user_profiles.create_enrollment_url", "POST", "/v1/user_profiles/{user_profile_id}/enrollment_url", "api/beta/user_profiles/create_enrollment_url", "", "BetaUserProfileEnrollmentURL", "", "", "", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesDelete, "user_profiles.delete", "DELETE", "/v1/user_profiles/{user_profile_id}", "api/user_profiles/delete", "", "DeletedUserProfile", "", "", "", "", "", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesDeleteBeta, "user_profiles.deletebeta", "DELETE", "/v1/user_profiles/{user_profile_id}", "api/beta/user_profiles/delete", "", "BetaDeletedUserProfile", "", "", "", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesList, "user_profiles.list", "GET", "/v1/user_profiles", "api/user_profiles/list", "UserProfileListParams", "UserProfile", "", "", "enforcement_status[],limit,order,order_by,page", "", "", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kUserProfilesListBeta, "user_profiles.listbeta", "GET", "/v1/user_profiles", "api/beta/user_profiles/list", "UserProfileListParams", "BetaUserProfile", "", "", "limit,order,order_by,page", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kUserProfilesRetrieve, "user_profiles.retrieve", "GET", "/v1/user_profiles/{user_profile_id}", "api/user_profiles/retrieve", "", "UserProfile", "", "", "", "", "", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesRetrieveBeta, "user_profiles.retrievebeta", "GET", "/v1/user_profiles/{user_profile_id}", "api/beta/user_profiles/retrieve", "", "BetaUserProfile", "", "", "", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesUpdate, "user_profiles.update", "POST", "/v1/user_profiles/{user_profile_id}", "api/user_profiles/update", "UserProfileUpdateParams", "UserProfile", "access_type,external_user_details,metadata,name", "", "", "", "", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kUserProfilesUpdateBeta, "user_profiles.updatebeta", "POST", "/v1/user_profiles/{user_profile_id}", "api/beta/user_profiles/update", "UserProfileUpdateParams", "BetaUserProfile", "access_type,external_id,external_user_details,external_user_onboarded_at,metadata,name", "", "", "", "user-profiles-2026-08-18", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsArchive, "vaults.archive", "POST", "/v1/vaults/{vault_id}/archive", "api/beta/vaults/archive", "", "BetaManagedAgentsVault", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCreate, "vaults.create", "POST", "/v1/vaults", "api/beta/vaults/create", "VaultCreateParams", "BetaManagedAgentsVault", "display_name,metadata", "display_name", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCredentialsArchive, "vaults.credentials.archive", "POST", "/v1/vaults/{vault_id}/credentials/{credential_id}/archive", "api/beta/vaults/credentials/archive", "", "BetaManagedAgentsCredential", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCredentialsCreate, "vaults.credentials.create", "POST", "/v1/vaults/{vault_id}/credentials", "api/beta/vaults/credentials/create", "CredentialCreateParams", "BetaManagedAgentsCredential", "auth,display_name,metadata", "auth", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCredentialsDelete, "vaults.credentials.delete", "DELETE", "/v1/vaults/{vault_id}/credentials/{credential_id}", "api/beta/vaults/credentials/delete", "", "BetaManagedAgentsDeletedCredential", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCredentialsList, "vaults.credentials.list", "GET", "/v1/vaults/{vault_id}/credentials", "api/beta/vaults/credentials/list", "CredentialListParams", "BetaManagedAgentsCredential", "", "", "include_archived,limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kVaultsCredentialsMcpOauthValidate, "vaults.credentials.mcp_oauth_validate", "POST", "/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate", "api/beta/vaults/credentials/mcp_oauth_validate", "", "BetaManagedAgentsCredentialValidation", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCredentialsRetrieve, "vaults.credentials.retrieve", "GET", "/v1/vaults/{vault_id}/credentials/{credential_id}", "api/beta/vaults/credentials/retrieve", "", "BetaManagedAgentsCredential", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsCredentialsUpdate, "vaults.credentials.update", "POST", "/v1/vaults/{vault_id}/credentials/{credential_id}", "api/beta/vaults/credentials/update", "CredentialUpdateParams", "BetaManagedAgentsCredential", "auth,display_name,metadata", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsDelete, "vaults.delete", "DELETE", "/v1/vaults/{vault_id}", "api/beta/vaults/delete", "", "BetaManagedAgentsDeletedVault", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kDestructive, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsList, "vaults.list", "GET", "/v1/vaults", "api/beta/vaults/list", "VaultListParams", "BetaManagedAgentsVault", "", "", "include_archived,limit,page", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kCursor, Wire::kJson, true, false},
{Call::kVaultsRetrieve, "vaults.retrieve", "GET", "/v1/vaults/{vault_id}", "api/beta/vaults/retrieve", "", "BetaManagedAgentsVault", "", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kRead, Page::kNone, Wire::kJson, true, false},
{Call::kVaultsUpdate, "vaults.update", "POST", "/v1/vaults/{vault_id}", "api/beta/vaults/update", "VaultUpdateParams", "BetaManagedAgentsVault", "display_name,metadata", "", "", "", "managed-agents-2026-04-01", Auth::kPlatform, Kind::kWrite, Page::kNone, Wire::kJson, true, false},
};
// CALLS-END
std::size_t call_count() { return sizeof(kCalls) / sizeof(kCalls[0]); }
const CallSpec& spec_at(std::size_t index) {
if (index >= call_count()) throw std::out_of_range("call index");
return kCalls[index];
}
const CallSpec& spec_of(Call call) {
for (const CallSpec& s : kCalls)
if (s.call == call) return s;
throw std::out_of_range("unknown call");
}
clients::Method method_of(Call call) {
const std::string m = spec_of(call).http;
if (m == "GET") return clients::Method::kGet;
if (m == "POST") return clients::Method::kPost;
if (m == "DELETE") return clients::Method::kDelete;
if (m == "PATCH") return clients::Method::kPatch;
return clients::Method::kPut;
}
} // namespace molo::anthropic::admin
+310
View File
@@ -0,0 +1,310 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// The ONE table of REST calls this package makes. Every row is checked by
// tools/check_spec.py against the official SDK source and the API reference.
// Code builds every URL from this table, never from a literal.
#include <cstddef>
#include "clients/request.h"
namespace molo::anthropic::admin {
enum class Call {
kAnalyticsAppsChatProjectsList,
kAnalyticsArtifactsList,
kAnalyticsConnectorsList,
kAnalyticsCostList,
kAnalyticsCostReportList,
kAnalyticsPluginsList,
kAnalyticsSkillsList,
kAnalyticsSummariesList,
kAnalyticsUsageList,
kAnalyticsUsageReportList,
kAnalyticsUserCostReportList,
kAnalyticsUserUsageReportList,
kAnalyticsUsersList,
kApiKeysList,
kApiKeysRetrieve,
kApiKeysUpdate,
kClaudeTagBundlesList,
kClaudeTagBundlesRetrieve,
kClaudeTagBundlesTargetsCreate,
kClaudeTagBundlesTargetsDelete,
kClaudeTagBundlesTargetsList,
kClaudeTagBundlesTargetsRetrieve,
kClaudeTagSlackChannelsCreate,
kClaudeTagSlackChannelsDelete,
kClaudeTagSlackChannelsList,
kClaudeTagSlackChannelsRetrieve,
kClaudeTagSlackChannelsUpdate,
kClaudeTagSlackWorkspacesList,
kClaudeTagSlackWorkspacesRetrieve,
kClaudeTagSlackWorkspacesUpdate,
kComplianceSettingsRetrieve,
kComplianceSettingsUpdate,
kCostReportRetrieve,
kExternalKeysCreate,
kExternalKeysDelete,
kExternalKeysList,
kExternalKeysRetrieve,
kExternalKeysUpdate,
kExternalKeysValidate,
kInvitesCreate,
kInvitesDelete,
kInvitesList,
kInvitesRetrieve,
kMcpTunnelsArchive,
kMcpTunnelsCertificatesArchive,
kMcpTunnelsCertificatesCreate,
kMcpTunnelsCertificatesList,
kMcpTunnelsCertificatesRetrieve,
kMcpTunnelsList,
kMcpTunnelsRetrieve,
kMcpTunnelsRevealToken,
kMcpTunnelsRotateToken,
kOrganizationRetrieve,
kPluginMarketplacesList,
kPluginMarketplacesRetrieve,
kPluginMarketplacesUpdate,
kPluginMarketplacesValidateArchive,
kPluginMarketplacesValidateRepository,
kPluginsCreate,
kPluginsDelete,
kPluginsInstallationSettingsList,
kPluginsInstallationSettingsRemove,
kPluginsInstallationSettingsSet,
kPluginsList,
kPluginsRetrieve,
kPluginsSharesList,
kPluginsUpdate,
kPluginsVersionsCreate,
kPluginsVersionsDownload,
kPluginsVersionsList,
kPluginsVersionsRetrieve,
kRateLimitsList,
kRbacGroupsCreate,
kRbacGroupsDelete,
kRbacGroupsList,
kRbacGroupsMembersAdd,
kRbacGroupsMembersList,
kRbacGroupsMembersRemove,
kRbacGroupsRetrieve,
kRbacGroupsUpdate,
kRbacRolesList,
kRbacRolesPermissionsList,
kRbacRolesRetrieve,
kSpendLimitsDelete,
kSpendLimitsEffectiveList,
kSpendLimitsIncreaseRequestsApprove,
kSpendLimitsIncreaseRequestsDeny,
kSpendLimitsIncreaseRequestsList,
kSpendLimitsIncreaseRequestsRetrieve,
kSpendLimitsList,
kSpendLimitsRetrieve,
kSpendLimitsSet,
kTelemetryDestinationsCreate,
kTelemetryDestinationsDelete,
kTelemetryDestinationsList,
kTelemetryDestinationsRetrieve,
kTelemetryDestinationsTest,
kTelemetryDestinationsUpdate,
kTelemetryDestinationsWorkspacesAdd,
kTelemetryDestinationsWorkspacesList,
kTelemetryDestinationsWorkspacesRemove,
kUsageReportRetrieveClaudeCode,
kUsageReportRetrieveMessages,
kUsersList,
kUsersRemove,
kUsersRetrieve,
kUsersUpdate,
kWebhooksCreate,
kWebhooksDelete,
kWebhooksList,
kWebhooksRegenerateSigningSecret,
kWebhooksRetrieve,
kWebhooksUpdate,
kWorkspacesArchive,
kWorkspacesCreate,
kWorkspacesList,
kWorkspacesMembersAdd,
kWorkspacesMembersList,
kWorkspacesMembersRemove,
kWorkspacesMembersRetrieve,
kWorkspacesMembersUpdate,
kWorkspacesRateLimitsList,
kWorkspacesRateLimitsUpdate,
kWorkspacesRetrieve,
kWorkspacesUpdate,
kFederationIssuersArchive,
kFederationIssuersCreate,
kFederationIssuersList,
kFederationIssuersRetrieve,
kFederationIssuersUpdate,
kFederationRulesArchive,
kFederationRulesCreate,
kFederationRulesList,
kFederationRulesRetrieve,
kFederationRulesUpdate,
kFederationRulesWorkspacesAdd,
kFederationRulesWorkspacesList,
kFederationRulesWorkspacesRemove,
kServiceAccountsArchive,
kServiceAccountsCreate,
kServiceAccountsList,
kServiceAccountsRetrieve,
kServiceAccountsUpdate,
kServiceAccountsWorkspacesAdd,
kServiceAccountsWorkspacesList,
kServiceAccountsWorkspacesRemove,
kWorkspacesServiceAccountsAdd,
kWorkspacesServiceAccountsList,
kWorkspacesServiceAccountsRemove,
kWorkspacesServiceAccountsRetrieve,
kWorkspacesServiceAccountsUpdate,
kAgentsArchive,
kAgentsCreate,
kAgentsList,
kAgentsRetrieve,
kAgentsUpdate,
kAgentsVersionsList,
kDeploymentRunsList,
kDeploymentRunsRetrieve,
kDeploymentsArchive,
kDeploymentsCreate,
kDeploymentsList,
kDeploymentsPause,
kDeploymentsRetrieve,
kDeploymentsRun,
kDeploymentsUnpause,
kDeploymentsUpdate,
kDreamsArchive,
kDreamsCancel,
kDreamsCreate,
kDreamsList,
kDreamsRetrieve,
kEnvironmentsArchive,
kEnvironmentsCreate,
kEnvironmentsDelete,
kEnvironmentsList,
kEnvironmentsRetrieve,
kEnvironmentsUpdate,
kEnvironmentsWorkAck,
kEnvironmentsWorkHeartbeat,
kEnvironmentsWorkList,
kEnvironmentsWorkPoll,
kEnvironmentsWorkRetrieve,
kEnvironmentsWorkStats,
kEnvironmentsWorkStop,
kEnvironmentsWorkUpdate,
kMemoryStoresArchive,
kMemoryStoresCreate,
kMemoryStoresDelete,
kMemoryStoresList,
kMemoryStoresMemoriesCreate,
kMemoryStoresMemoriesDelete,
kMemoryStoresMemoriesList,
kMemoryStoresMemoriesRetrieve,
kMemoryStoresMemoriesUpdate,
kMemoryStoresMemoryVersionsList,
kMemoryStoresMemoryVersionsRedact,
kMemoryStoresMemoryVersionsRetrieve,
kMemoryStoresRetrieve,
kMemoryStoresUpdate,
kSessionsArchive,
kSessionsCreate,
kSessionsDelete,
kSessionsEventsList,
kSessionsEventsSend,
kSessionsEventsStream,
kSessionsList,
kSessionsResourcesAdd,
kSessionsResourcesDelete,
kSessionsResourcesList,
kSessionsResourcesRetrieve,
kSessionsResourcesUpdate,
kSessionsRetrieve,
kSessionsThreadsArchive,
kSessionsThreadsEventsList,
kSessionsThreadsEventsStream,
kSessionsThreadsList,
kSessionsThreadsRetrieve,
kSessionsUpdate,
kTunnelsArchive,
kTunnelsCertificatesArchive,
kTunnelsCertificatesCreate,
kTunnelsCertificatesList,
kTunnelsCertificatesRetrieve,
kTunnelsCreate,
kTunnelsList,
kTunnelsRetrieve,
kTunnelsRevealToken,
kTunnelsRotateToken,
kUserProfilesActionUrlsCreate,
kUserProfilesActionUrlsCreateBeta,
kUserProfilesCreate,
kUserProfilesCreateBeta,
kUserProfilesCreateEnrollmentUrl,
kUserProfilesDelete,
kUserProfilesDeleteBeta,
kUserProfilesList,
kUserProfilesListBeta,
kUserProfilesRetrieve,
kUserProfilesRetrieveBeta,
kUserProfilesUpdate,
kUserProfilesUpdateBeta,
kVaultsArchive,
kVaultsCreate,
kVaultsCredentialsArchive,
kVaultsCredentialsCreate,
kVaultsCredentialsDelete,
kVaultsCredentialsList,
kVaultsCredentialsMcpOauthValidate,
kVaultsCredentialsRetrieve,
kVaultsCredentialsUpdate,
kVaultsDelete,
kVaultsList,
kVaultsRetrieve,
kVaultsUpdate,
};
// Which credential a call needs.
enum class Auth {
kAdmin, // Admin API key (sk-ant-admin..., x-api-key) or an org:admin OAuth token
kOAuth, // only an org:admin OAuth bearer token (service accounts, federation)
kPlatform, // standard workspace API key (managed agents surface)
};
enum class Kind { kRead, kWrite, kDestructive };
enum class Page { kNone, kIds, kCursor, kReport, kBidirectional };
enum class Wire { kJson, kSse, kMultipart, kRaw };
struct CallSpec {
Call call;
const char* name; // SDK-style operation id, e.g. organization.invites.create
const char* http; // GET POST PATCH DELETE
const char* path; // /v1/organizations/invites/{invite_id}
const char* docs; // reference page slug, guide:<page>, or "" (SDK only)
const char* request; // SDK request schema (TypedDict) or ""
const char* response; // SDK response type
const char* body; // comma list: JSON body fields (multipart: part names)
const char* required; // comma list: required body fields and query parameters
const char* query; // comma list: query parameters; `name[]` is sent repeated
const char* headers; // comma list: arg=Header-Name request header parameters
const char* beta; // anthropic-beta value the call needs, or ""
Auth auth;
Kind kind;
Page page;
Wire wire;
bool workspace; // accepts the anthropic-workspace-id header
bool docs_only; // not in any SDK: reference page is the only source
};
const CallSpec& spec_of(Call call);
clients::Method method_of(Call call);
std::size_t call_count();
const CallSpec& spec_at(std::size_t index);
} // namespace molo::anthropic::admin
+36
View File
@@ -0,0 +1,36 @@
#pragma once
// Static ceilings for the Anthropic admin and agent-platform package. Never
// autotuned: a constant you can read beats magic you cannot debug.
#include <cstddef>
namespace molo::anthropic::admin {
struct Caps {
// Page walks: pages fetched and items collected by one list_all call.
static constexpr std::size_t kMaxPages = 20;
static constexpr std::size_t kMaxPagesHard = 100;
static constexpr std::size_t kMaxItems = 5000;
// Ids put into a URL path (see llm::Service::valid_id).
static constexpr std::size_t kMaxIdBytes = 256;
// JSON request body.
static constexpr std::size_t kMaxBodyBytes = 1u * 1024u * 1024u;
// Query string: values per parameter, bytes per value, bytes in total.
static constexpr std::size_t kMaxQueryValues = 100;
static constexpr std::size_t kMaxQueryValueBytes = 512;
static constexpr std::size_t kMaxQueryBytes = 8u * 1024u;
// Multipart uploads (plugin files, marketplace archive: the API caps the
// archive at 32 MiB).
static constexpr std::size_t kMaxFormBytes = 32u * 1024u * 1024u;
static constexpr std::size_t kMaxFormParts = 512;
// Server-sent event streams: events handed to the sink.
static constexpr std::size_t kMaxStreamEvents = 1000;
// Largest page size this package ever sends.
static constexpr long kMaxLimit = 1000;
// Webhook signature timestamp tolerance, seconds (Standard Webhooks: 5 min).
static constexpr long kWebhookToleranceSeconds = 300;
static constexpr std::size_t kMaxWebhookPayloadBytes = 1u * 1024u * 1024u;
};
} // namespace molo::anthropic::admin
+71
View File
@@ -0,0 +1,71 @@
#include "anthropic/admin/credentials.h"
namespace molo::anthropic::admin {
namespace {
bool starts_with(const std::string& s, const char* prefix) {
return s.rfind(prefix, 0) == 0;
}
bool clean(const std::string& s) {
for (unsigned char c : s)
if (c <= 0x20 || c >= 0x7f) return false;
return true;
}
} // namespace
const char* KeyRules::env_of(Lane lane) {
switch (lane) {
case Lane::kAdminKey: return "ANTHROPIC_ADMIN_KEY";
case Lane::kOAuth: return "ANTHROPIC_AUTH_TOKEN";
case Lane::kPlatform: return "ANTHROPIC_API_KEY";
}
return "";
}
const char* KeyRules::name_of(Lane lane) {
switch (lane) {
case Lane::kAdminKey: return "admin_key";
case Lane::kOAuth: return "oauth_token";
case Lane::kPlatform: return "api_key";
}
return "";
}
bool KeyRules::is_admin_key(const std::string& value) { return starts_with(value, kAdminPrefix); }
LaneState KeyRules::check(Lane lane, const std::string& value, std::string& reason) {
reason.clear();
if (value.empty()) return LaneState::kMissing;
if (!clean(value)) {
reason = std::string(env_of(lane)) + " has whitespace or control characters";
return LaneState::kRejected;
}
switch (lane) {
case Lane::kAdminKey:
if (!is_admin_key(value)) {
reason = std::string(env_of(lane)) + " must be an Admin API key (sk-ant-admin...); a standard API key is not accepted";
return LaneState::kRejected;
}
break;
case Lane::kOAuth:
if (is_admin_key(value) || starts_with(value, kApiPrefix)) {
reason = std::string(env_of(lane)) + " must be an org:admin OAuth token, not an API key";
return LaneState::kRejected;
}
break;
case Lane::kPlatform:
if (is_admin_key(value)) {
reason = std::string(env_of(lane)) + " is an Admin API key; managed agents take a standard workspace key";
return LaneState::kRejected;
}
break;
}
return LaneState::kReady;
}
std::string KeyRules::redacted(const std::string& value) {
if (value.size() <= 12) return std::string(value.size(), '*');
return value.substr(0, 12) + "...";
}
} // namespace molo::anthropic::admin
+47
View File
@@ -0,0 +1,47 @@
#pragma once
// Credential rules. The package talks with three credentials, each kept in
// its own lane and never mixed up:
//
// kAdminKey ANTHROPIC_ADMIN_KEY sk-ant-admin..., header x-api-key
// kOAuth ANTHROPIC_AUTH_TOKEN org:admin OAuth token, Authorization: Bearer
// kPlatform ANTHROPIC_API_KEY standard workspace key (managed agents)
//
// A lane refuses a credential of the wrong kind before any request leaves
// the process: the standard key is never accepted as an admin key, and an
// admin key never goes to the platform lane.
#include <string>
namespace molo::anthropic::admin {
enum class Lane { kAdminKey, kOAuth, kPlatform };
enum class LaneState {
kMissing, // nothing configured
kReady, // configured and plausible for this lane
kRejected, // configured but of the wrong kind; calls fail locally
};
struct LaneInfo {
Lane lane;
const char* env; // environment variable that feeds the lane
LaneState state;
std::string reason; // why a credential was rejected, else ""
};
class KeyRules {
public:
static constexpr const char* kAdminPrefix = "sk-ant-admin";
static constexpr const char* kApiPrefix = "sk-ant-api";
static const char* env_of(Lane lane);
static const char* name_of(Lane lane);
// Classifies `value` for `lane`; fills `reason` on rejection.
static LaneState check(Lane lane, const std::string& value, std::string& reason);
static bool is_admin_key(const std::string& value);
// First 12 characters then "...": safe to show, never the whole key.
static std::string redacted(const std::string& value);
};
} // namespace molo::anthropic::admin
+162
View File
@@ -0,0 +1,162 @@
#include "anthropic/admin/gateway.h"
#include <mutex>
#include "anthropic/admin/caps.h"
#include "clients/transports/http_transport.h"
#include "llm/config.h"
#include "llm/error.h"
namespace molo::anthropic::admin {
namespace {
constexpr const char* kVendor = "anthropic";
std::size_t index_of(Lane lane) { return static_cast<std::size_t>(lane); }
Lane lane_of(Auth auth) {
switch (auth) {
case Auth::kAdmin: return Lane::kAdminKey;
case Auth::kOAuth: return Lane::kOAuth;
case Auth::kPlatform: return Lane::kPlatform;
}
return Lane::kAdminKey;
}
std::mutex& stream_mutex() {
static std::mutex m;
return m;
}
} // namespace
Gateway::Gateway(TransportFactory factory, Keys keys, std::string base_url)
: base_url_(std::move(base_url)), factory_(std::move(factory)) {
const std::string values[3] = {keys.admin_key, keys.oauth_token, keys.api_key};
const Lane order[3] = {Lane::kAdminKey, Lane::kOAuth, Lane::kPlatform};
for (int i = 0; i < 3; ++i) {
Slot& s = slots_[index_of(order[i])];
s.info.lane = order[i];
s.info.env = KeyRules::env_of(order[i]);
s.info.state = KeyRules::check(order[i], values[i], s.info.reason);
s.key = s.info.state == LaneState::kReady ? values[i] : std::string();
s.config.vendor = kVendor;
s.config.base_url = base_url_;
s.config.key_env = s.info.env;
s.config.auth = order[i] == Lane::kOAuth ? llm::AuthStyle::kBearer : llm::AuthStyle::kHeader;
s.config.auth_header = "x-api-key";
s.config.default_headers["anthropic-version"] = kApiVersion;
s.client = std::make_shared<llm::ApiClient>(factory_(), s.config, s.key);
}
}
std::shared_ptr<Gateway> Gateway::from_env() {
Keys keys;
keys.admin_key = llm::Config::get(KeyRules::env_of(Lane::kAdminKey));
keys.oauth_token = llm::Config::get(KeyRules::env_of(Lane::kOAuth));
keys.api_key = llm::Config::get(KeyRules::env_of(Lane::kPlatform));
return std::make_shared<Gateway>(
[] { return std::unique_ptr<clients::Transport>(new clients::transports::HttpTransport()); },
std::move(keys));
}
const Gateway::Slot& Gateway::slot(Lane lane) const { return slots_[index_of(lane)]; }
LaneInfo Gateway::describe(Lane lane) const { return slot(lane).info; }
std::vector<LaneInfo> Gateway::lanes() const {
return {slot(Lane::kAdminKey).info, slot(Lane::kOAuth).info, slot(Lane::kPlatform).info};
}
std::shared_ptr<llm::ApiClient> Gateway::primary_client(Auth auth) const {
return slot(lane_of(auth)).client;
}
Lane Gateway::lane_for(Auth auth) const {
auto refuse = [&](const LaneInfo& info) -> void {
if (info.state == LaneState::kRejected)
throw llm::ApiError(kVendor, 401, "credential_rejected", info.reason);
};
switch (auth) {
case Auth::kAdmin: {
const LaneInfo& key = slot(Lane::kAdminKey).info;
const LaneInfo& tok = slot(Lane::kOAuth).info;
if (key.state == LaneState::kReady) return Lane::kAdminKey;
if (tok.state == LaneState::kReady) return Lane::kOAuth;
refuse(key);
refuse(tok);
throw llm::NotConfiguredError(kVendor, KeyRules::env_of(Lane::kAdminKey));
}
case Auth::kOAuth: {
const LaneInfo& tok = slot(Lane::kOAuth).info;
if (tok.state == LaneState::kReady) return Lane::kOAuth;
refuse(tok);
if (slot(Lane::kAdminKey).info.state == LaneState::kReady)
throw llm::ApiError(kVendor, 403, "credential_rejected",
"this call accepts only an org:admin OAuth token (set ANTHROPIC_AUTH_TOKEN); an Admin API key is not accepted");
throw llm::NotConfiguredError(kVendor, KeyRules::env_of(Lane::kOAuth));
}
case Auth::kPlatform: {
const LaneInfo& k = slot(Lane::kPlatform).info;
if (k.state == LaneState::kReady) return Lane::kPlatform;
refuse(k);
throw llm::NotConfiguredError(kVendor, KeyRules::env_of(Lane::kPlatform));
}
}
throw llm::ApiError(kVendor, 500, "internal", "unknown credential class");
}
std::shared_ptr<llm::ApiClient> Gateway::client_for(Auth auth) const {
return slot(lane_for(auth)).client;
}
bool Gateway::ready(Auth auth) const {
try {
lane_for(auth);
return true;
} catch (const llm::ApiError&) {
return false;
}
}
void Gateway::set_workspace_id(std::string id) {
if (!id.empty() && !llm::Service::valid_id(id))
throw llm::ApiError::invalid(kVendor, "bad workspace id");
workspace_id_ = std::move(id);
}
void Gateway::stream_get(Auth auth, const std::string& target,
const std::map<std::string, std::string>& headers,
const llm::SseDecoder::Sink& sink, std::size_t max_events) const {
const Slot& s = slot(lane_for(auth));
if (target.empty() || target.front() != '/' || target.find("..") != std::string::npos)
throw llm::ApiError::invalid(kVendor, "bad request path");
if (max_events == 0 || max_events > Caps::kMaxStreamEvents)
throw llm::ApiError::invalid(kVendor, "max_events must be 1.." + std::to_string(Caps::kMaxStreamEvents));
std::lock_guard<std::mutex> lock(stream_mutex());
if (!stream_client_) stream_client_ = std::make_unique<clients::Client>(factory_());
std::size_t seen = 0;
llm::SseDecoder decoder(kVendor, [&](const llm::SseEvent& ev) {
++seen;
bool keep = sink(ev);
return keep && seen < max_events;
});
try {
clients::ClientRequest req(clients::Method::kGet, clients::Url::parse(base_url_ + target));
if (s.config.auth == llm::AuthStyle::kBearer) req.bearer(s.key);
else req.header(s.config.auth_header, s.key);
for (const auto& [k, v] : s.config.default_headers) req.header(k, v);
for (const auto& [k, v] : headers) req.header(k, v);
req.header("Accept", "text/event-stream");
stream_client_->send_stream_blocking(std::move(req),
[&](const std::string& chunk) { return decoder.feed(chunk); });
decoder.finish();
} catch (const llm::ApiError&) {
throw;
} catch (const std::exception& e) {
throw llm::ApiError(kVendor, 502, "UNAVAILABLE", e.what());
}
}
} // namespace molo::anthropic::admin
+84
View File
@@ -0,0 +1,84 @@
#pragma once
// Gateway: the three credential lanes behind one object. Owns one
// llm::ApiClient per lane (x-api-key for the admin key and the standard key,
// Authorization: Bearer for the OAuth token, anthropic-version on all) and
// picks the lane a call needs from the call table. A lane holding a
// credential of the wrong kind refuses locally; the request never leaves.
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "anthropic/admin/calls.h"
#include "anthropic/admin/credentials.h"
#include "clients/client.h"
#include "clients/transport.h"
#include "llm/api_client.h"
#include "llm/sse.h"
namespace molo::anthropic::admin {
class Gateway {
public:
static constexpr const char* kBaseUrl = "https://api.anthropic.com";
// Pinned API version (reference: platform.claude.com/docs/en/api/versioning).
static constexpr const char* kApiVersion = "2026-10-21";
using TransportFactory = std::function<std::unique_ptr<clients::Transport>()>;
struct Keys {
std::string admin_key; // ANTHROPIC_ADMIN_KEY
std::string oauth_token; // ANTHROPIC_AUTH_TOKEN
std::string api_key; // ANTHROPIC_API_KEY
};
// One transport per lane is taken from `factory` (plus one for streams).
Gateway(TransportFactory factory, Keys keys, std::string base_url = kBaseUrl);
// HTTPS transport, credentials from llm::Config (environment, then the
// .env.json files).
static std::shared_ptr<Gateway> from_env();
// Never throws: the lane's client, possibly unconfigured. For llm::Service.
std::shared_ptr<llm::ApiClient> primary_client(Auth auth) const;
// The lane that serves `auth`, or throws llm::NotConfiguredError (nothing
// configured) / llm::ApiError "credential_rejected" (wrong kind of key).
Lane lane_for(Auth auth) const;
std::shared_ptr<llm::ApiClient> client_for(Auth auth) const;
LaneInfo describe(Lane lane) const;
std::vector<LaneInfo> lanes() const;
// True when a call of this class could be sent now.
bool ready(Auth auth) const;
// anthropic-workspace-id sent on managed-agents calls (empty: none).
void set_workspace_id(std::string id);
const std::string& workspace_id() const { return workspace_id_; }
// GET server-sent events (llm::ApiClient streams POST only). Stops after
// `max_events` events or when the sink returns false.
void stream_get(Auth auth, const std::string& target,
const std::map<std::string, std::string>& headers,
const llm::SseDecoder::Sink& sink, std::size_t max_events) const;
private:
struct Slot {
LaneInfo info;
std::string key;
llm::ApiClientConfig config;
std::shared_ptr<llm::ApiClient> client;
};
const Slot& slot(Lane lane) const;
std::string base_url_;
Slot slots_[3];
std::string workspace_id_;
mutable std::unique_ptr<clients::Client> stream_client_;
TransportFactory factory_;
};
} // namespace molo::anthropic::admin
+70
View File
@@ -0,0 +1,70 @@
#include "anthropic/admin/pager.h"
namespace molo::anthropic::admin {
using clients::body::Json;
namespace {
std::string text_of(const Json& doc, const char* key) {
const Json* v = doc.is_object() ? doc.find(key) : nullptr;
return v && v->is_string() ? v->as_string() : "";
}
// has_more == false stops a walk; absent or null leaves the decision to the cursor.
bool has_more_false(const Json& doc) {
const Json* v = doc.is_object() ? doc.find("has_more") : nullptr;
return v && v->is_bool() && !v->as_bool();
}
} // namespace
const Json::Array& Pager::items_of(const Json& page) {
static const Json::Array kEmpty;
const Json* d = page.is_object() ? page.find("data") : nullptr;
return d && d->is_array() ? d->as_array() : kEmpty;
}
bool Pager::advance(Page kind, const Json& page, Query& query) {
switch (kind) {
case Page::kNone:
return false;
case Page::kIds: {
if (has_more_false(page)) return false;
if (query.has("before_id")) {
std::string first = text_of(page, "first_id");
if (first.empty()) return false;
query.set("before_id", first);
return true;
}
std::string last = text_of(page, "last_id");
if (last.empty()) return false;
query.set("after_id", last);
return true;
}
case Page::kReport:
if (has_more_false(page)) return false;
[[fallthrough]];
case Page::kCursor:
case Page::kBidirectional: {
std::string next = text_of(page, "next_page");
if (next.empty()) return false;
query.set("page", next);
return true;
}
}
return false;
}
Json Walk::to_json() const {
Json o = Json::object();
o.set("items", items);
o.set("count", Json(static_cast<long>(size())));
o.set("pages", Json(static_cast<long>(pages)));
o.set("truncated", Json(truncated));
if (!reason.empty()) o.set("reason", Json(reason));
if (!next_page.empty()) o.set("next_page", Json(next_page));
return o;
}
} // namespace molo::anthropic::admin
+37
View File
@@ -0,0 +1,37 @@
#pragma once
// Pager: bounded page walking. The API has four page shapes (see calls.h
// Page): id cursors (data / has_more / first_id / last_id), opaque cursors
// (data / next_page), reports (data / has_more / next_page) and
// bidirectional cursors (next_page / prev_page). A walk is capped in pages
// and items; hitting a cap is reported loudly in Walk, never silent.
#include <string>
#include "anthropic/admin/calls.h"
#include "anthropic/admin/query.h"
#include "clients/body/json.h"
namespace molo::anthropic::admin {
struct Walk {
clients::body::Json items = clients::body::Json::array(); // every item collected
std::size_t pages = 0; // pages fetched
bool truncated = false; // more pages exist beyond the caps
std::string reason; // "page_cap", "item_cap" or ""
std::string next_page; // cursor to continue from, when known
std::size_t size() const { return items.as_array().size(); }
clients::body::Json to_json() const;
};
class Pager {
public:
// Rewrites `query` to ask for the page after `page` (the parsed response of
// a call of kind `kind`). False when there is no further page.
static bool advance(Page kind, const clients::body::Json& page, Query& query);
// Items of one page response: its `data` array (empty when absent).
static const clients::body::Json::Array& items_of(const clients::body::Json& page);
};
} // namespace molo::anthropic::admin
+42
View File
@@ -0,0 +1,42 @@
#include "anthropic/admin/query.h"
namespace molo::anthropic::admin {
Query& Query::set(const std::string& name, const std::string& value) {
for (auto it = items_.begin(); it != items_.end();) {
if (it->first == name) it = items_.erase(it);
else ++it;
}
items_.emplace_back(name, value);
return *this;
}
Query& Query::set_int(const std::string& name, long value) {
return set(name, std::to_string(value));
}
Query& Query::set_bool(const std::string& name, bool value) {
return set(name, value ? "true" : "false");
}
Query& Query::add(const std::string& name, const std::string& value) {
items_.emplace_back(name, value);
return *this;
}
bool Query::has(const std::string& name) const { return count(name) > 0; }
std::string Query::get(const std::string& name) const {
for (const auto& kv : items_)
if (kv.first == name) return kv.second;
return "";
}
std::size_t Query::count(const std::string& name) const {
std::size_t n = 0;
for (const auto& kv : items_)
if (kv.first == name) ++n;
return n;
}
} // namespace molo::anthropic::admin
+35
View File
@@ -0,0 +1,35 @@
#pragma once
// Query: the query-string parameters of one call, built by name. Array
// parameters are added repeatedly (`add`); the request builder checks names,
// counts and sizes against the call table and encodes `name[]=a&name[]=b`.
#include <string>
#include <utility>
#include <vector>
namespace molo::anthropic::admin {
class Query {
public:
Query() = default;
// Replaces any earlier value of `name`.
Query& set(const std::string& name, const std::string& value);
Query& set_int(const std::string& name, long value);
Query& set_bool(const std::string& name, bool value);
// Appends a value (array parameters: statuses, roles, group_by, ...).
Query& add(const std::string& name, const std::string& value);
bool empty() const { return items_.empty(); }
bool has(const std::string& name) const;
// First value of `name`, or "".
std::string get(const std::string& name) const;
std::size_t count(const std::string& name) const;
const std::vector<std::pair<std::string, std::string>>& items() const { return items_; }
private:
std::vector<std::pair<std::string, std::string>> items_;
};
} // namespace molo::anthropic::admin
+324
View File
@@ -0,0 +1,324 @@
#include "anthropic/admin/reports.h"
#include <cstdlib>
#include <stdexcept>
#include "anthropic/admin/caps.h"
#include "llm/error.h"
namespace molo::anthropic::admin {
using clients::body::Json;
namespace {
constexpr const char* kVendor = "anthropic";
constexpr std::size_t kMaxList = 32; // values in one array filter
[[noreturn]] void bad(const std::string& why) { throw llm::ApiError::invalid(kVendor, why); }
[[noreturn]] void shape(const std::string& why) {
throw llm::ApiError(kVendor, 502, "BAD_RESPONSE", why);
}
bool digits(const std::string& s, std::size_t at, std::size_t n) {
if (at + n > s.size()) return false;
for (std::size_t i = at; i < at + n; ++i)
if (s[i] < '0' || s[i] > '9') return false;
return true;
}
void add_all(Query& q, const char* name, const std::vector<std::string>& values) {
if (values.size() > kMaxList) bad(std::string(name) + " has too many values");
for (const std::string& v : values) {
if (v.empty()) bad(std::string(name) + " has an empty value");
q.add(name, v);
}
}
void check_limit(long limit, long lo, long hi) {
if (limit != 0 && (limit < lo || limit > hi))
bad("limit must be " + std::to_string(lo) + ".." + std::to_string(hi));
}
std::string str(const Json& o, const char* key) {
const Json* v = o.is_object() ? o.find(key) : nullptr;
return v && v->is_string() ? v->as_string() : "";
}
long long num(const Json& o, const char* key) {
const Json* v = o.is_object() ? o.find(key) : nullptr;
return v && v->is_number() ? static_cast<long long>(v->as_number()) : 0;
}
const Json& sub(const Json& o, const char* key) {
static const Json kEmpty = Json::object();
const Json* v = o.is_object() ? o.find(key) : nullptr;
return v && v->is_object() ? *v : kEmpty;
}
const Json::Array& list(const Json& doc, const char* key) {
static const Json::Array kEmpty;
const Json* v = doc.is_object() ? doc.find(key) : nullptr;
if (!v) return kEmpty;
if (!v->is_array()) shape(std::string(key) + " is not an array");
return v->as_array();
}
template <typename T>
void paging(const Json& doc, ReportPage<T>& page) {
if (!doc.is_object()) shape("report is not an object");
const Json* m = doc.find("has_more");
page.has_more = m && m->is_bool() && m->as_bool();
page.next_page = str(doc, "next_page");
}
} // namespace
bool valid_date(const std::string& s) {
if (s.size() != 10 || !digits(s, 0, 4) || s[4] != '-' || !digits(s, 5, 2) || s[7] != '-' || !digits(s, 8, 2))
return false;
int m = std::atoi(s.substr(5, 2).c_str()), d = std::atoi(s.substr(8, 2).c_str());
return m >= 1 && m <= 12 && d >= 1 && d <= 31;
}
bool valid_rfc3339(const std::string& s) {
if (s.size() < 20 || !valid_date(s.substr(0, 10)) || s[10] != 'T') return false;
if (!digits(s, 11, 2) || s[13] != ':' || !digits(s, 14, 2) || s[16] != ':' || !digits(s, 17, 2)) return false;
if (std::atoi(s.substr(11, 2).c_str()) > 23 || std::atoi(s.substr(14, 2).c_str()) > 59) return false;
std::size_t i = 19;
if (i < s.size() && s[i] == '.') {
++i;
std::size_t start = i;
while (i < s.size() && s[i] >= '0' && s[i] <= '9') ++i;
if (i == start) return false;
}
if (i < s.size() && s[i] == 'Z') return i + 1 == s.size();
if (i + 6 == s.size() && (s[i] == '+' || s[i] == '-')) return digits(s, i + 1, 2) && s[i + 3] == ':' && digits(s, i + 4, 2);
return false;
}
bool BucketWidth::valid(const std::string& w) { return w == "1d" || w == "1h" || w == "1m"; }
long BucketWidth::default_limit(const std::string& w) { return w == "1d" ? 7 : w == "1h" ? 24 : 60; }
long BucketWidth::max_limit(const std::string& w) { return w == "1d" ? 31 : w == "1h" ? 168 : 1440; }
Query MessagesUsageQuery::to_query() const {
if (!valid_rfc3339(starting_at)) bad("starting_at must be an RFC 3339 timestamp");
if (!ending_at.empty() && !valid_rfc3339(ending_at)) bad("ending_at must be an RFC 3339 timestamp");
if (!BucketWidth::valid(bucket_width)) bad("bucket_width must be 1d, 1h or 1m");
check_limit(limit, 1, BucketWidth::max_limit(bucket_width));
Query q;
q.set("starting_at", starting_at);
if (!ending_at.empty()) q.set("ending_at", ending_at);
q.set("bucket_width", bucket_width);
if (limit) q.set_int("limit", limit);
if (!page.empty()) q.set("page", page);
add_all(q, "group_by", group_by);
add_all(q, "models", models);
add_all(q, "workspace_ids", workspace_ids);
add_all(q, "api_key_ids", api_key_ids);
add_all(q, "account_ids", account_ids);
add_all(q, "service_account_ids", service_account_ids);
add_all(q, "service_tiers", service_tiers);
add_all(q, "context_window", context_window);
add_all(q, "inference_geos", inference_geos);
add_all(q, "speeds", speeds);
return q;
}
Query CostQuery::to_query() const {
if (!valid_rfc3339(starting_at)) bad("starting_at must be an RFC 3339 timestamp");
if (!ending_at.empty() && !valid_rfc3339(ending_at)) bad("ending_at must be an RFC 3339 timestamp");
check_limit(limit, 1, 31);
Query q;
q.set("starting_at", starting_at);
if (!ending_at.empty()) q.set("ending_at", ending_at);
q.set("bucket_width", "1d");
if (limit) q.set_int("limit", limit);
if (!page.empty()) q.set("page", page);
for (const std::string& g : group_by)
if (g != "description" && g != "workspace_id") bad("group_by must be description or workspace_id");
add_all(q, "group_by", group_by);
return q;
}
Query ClaudeCodeQuery::to_query() const {
if (!valid_date(starting_at)) bad("starting_at must be a UTC date YYYY-MM-DD");
check_limit(limit, 1, 1000);
Query q;
q.set("starting_at", starting_at);
if (limit) q.set_int("limit", limit);
if (!page.empty()) q.set("page", page);
return q;
}
bool Decimal::parse(const std::string& text, Decimal& out) {
std::size_t i = 0;
bool neg = false;
if (i < text.size() && (text[i] == '-' || text[i] == '+')) neg = text[i++] == '-';
long long whole = 0, frac = 0;
std::size_t nd = 0, fd = 0;
for (; i < text.size() && text[i] >= '0' && text[i] <= '9'; ++i, ++nd) {
if (whole > 9000000000LL) return false;
whole = whole * 10 + (text[i] - '0');
}
if (i < text.size() && text[i] == '.') {
for (++i; i < text.size() && text[i] >= '0' && text[i] <= '9'; ++i, ++fd) {
if (fd >= 9) return false;
frac = frac * 10 + (text[i] - '0');
}
}
if (i != text.size() || nd + fd == 0) return false;
for (std::size_t k = fd; k < 9; ++k) frac *= 10;
long long v = whole * 1000000000LL + frac;
out.scaled_ = neg ? -v : v;
return true;
}
Decimal& Decimal::add(const Decimal& other) {
long long r;
if (__builtin_add_overflow(scaled_, other.scaled_, &r)) throw std::overflow_error("decimal sum overflow");
scaled_ = r;
return *this;
}
std::string Decimal::str() const {
long long v = scaled_ < 0 ? -scaled_ : scaled_;
std::string frac = std::to_string(v % 1000000000LL);
frac.insert(0, 9 - frac.size(), '0');
while (frac.size() > 1 && frac.back() == '0') frac.pop_back();
return std::string(scaled_ < 0 ? "-" : "") + std::to_string(v / 1000000000LL) + "." + frac;
}
ReportPage<UsageBucket> ReportParser::usage(const Json& doc) {
ReportPage<UsageBucket> page;
paging(doc, page);
for (const Json& b : list(doc, "data")) {
UsageBucket bucket;
bucket.starting_at = str(b, "starting_at");
bucket.ending_at = str(b, "ending_at");
for (const Json& r : list(b, "results")) {
UsageResult u;
u.model = str(r, "model");
u.workspace_id = str(r, "workspace_id");
u.api_key_id = str(r, "api_key_id");
u.service_tier = str(r, "service_tier");
u.speed = str(r, "speed");
u.context_window = str(r, "context_window");
u.inference_geo = str(r, "inference_geo");
u.uncached_input = num(r, "uncached_input_tokens");
u.cache_read_input = num(r, "cache_read_input_tokens");
u.cache_creation_5m = num(sub(r, "cache_creation"), "ephemeral_5m_input_tokens");
u.cache_creation_1h = num(sub(r, "cache_creation"), "ephemeral_1h_input_tokens");
u.output = num(r, "output_tokens");
u.web_search_requests = num(sub(r, "server_tool_use"), "web_search_requests");
bucket.results.push_back(u);
}
page.items.push_back(std::move(bucket));
}
return page;
}
ReportPage<CostBucket> ReportParser::cost(const Json& doc) {
ReportPage<CostBucket> page;
paging(doc, page);
for (const Json& b : list(doc, "data")) {
CostBucket bucket;
bucket.starting_at = str(b, "starting_at");
bucket.ending_at = str(b, "ending_at");
for (const Json& r : list(b, "results")) {
CostResult c;
c.amount = str(r, "amount");
c.currency = str(r, "currency");
c.description = str(r, "description");
c.cost_type = str(r, "cost_type");
c.model = str(r, "model");
c.token_type = str(r, "token_type");
c.workspace_id = str(r, "workspace_id");
Decimal d;
if (!Decimal::parse(c.amount, d)) shape("cost amount is not a decimal string");
bucket.results.push_back(c);
}
page.items.push_back(std::move(bucket));
}
return page;
}
ReportPage<ClaudeCodeRecord> ReportParser::claude_code(const Json& doc) {
ReportPage<ClaudeCodeRecord> page;
paging(doc, page);
for (const Json& r : list(doc, "data")) {
ClaudeCodeRecord c;
const Json& actor = sub(r, "actor");
c.actor_type = str(actor, "type");
c.actor = c.actor_type == "user_actor" ? str(actor, "email_address") : str(actor, "api_key_name");
c.date = str(r, "date");
c.customer_type = str(r, "customer_type");
c.terminal_type = str(r, "terminal_type");
c.subscription_type = str(r, "subscription_type");
const Json* remote = r.find("is_remote");
c.is_remote = remote && remote->is_bool() && remote->as_bool();
const Json& core = sub(r, "core_metrics");
c.sessions = num(core, "num_sessions");
c.commits = num(core, "commits_by_claude_code");
c.pull_requests = num(core, "pull_requests_by_claude_code");
c.lines_added = num(sub(core, "lines_of_code"), "added");
c.lines_removed = num(sub(core, "lines_of_code"), "removed");
for (const Json& m : list(r, "model_breakdown")) {
c.tokens_input += num(sub(m, "tokens"), "input");
c.tokens_output += num(sub(m, "tokens"), "output");
}
for (const auto& [tool, v] : sub(r, "tool_actions").as_object()) {
c.accepted[tool] = num(v, "accepted");
c.rejected[tool] = num(v, "rejected");
}
page.items.push_back(std::move(c));
}
return page;
}
UsageResult ReportParser::sum(const std::vector<UsageBucket>& buckets) {
UsageResult t;
for (const auto& b : buckets)
for (const auto& r : b.results) {
t.uncached_input += r.uncached_input;
t.cache_read_input += r.cache_read_input;
t.cache_creation_5m += r.cache_creation_5m;
t.cache_creation_1h += r.cache_creation_1h;
t.output += r.output;
t.web_search_requests += r.web_search_requests;
}
return t;
}
Decimal ReportParser::sum(const std::vector<CostBucket>& buckets) {
Decimal total;
for (const auto& b : buckets)
for (const auto& r : b.results) {
Decimal d;
if (Decimal::parse(r.amount, d)) total.add(d);
}
return total;
}
ReportPage<UsageBucket> Reports::messages(const MessagesUsageQuery& q) const {
return ReportParser::usage(usage_.messages(q.to_query()));
}
ReportPage<ClaudeCodeRecord> Reports::claude_code(const ClaudeCodeQuery& q) const {
return ReportParser::claude_code(usage_.claude_code(q.to_query()));
}
ReportPage<CostBucket> Reports::cost(const CostQuery& q) const {
return ReportParser::cost(cost_.get(q.to_query()));
}
std::vector<UsageBucket> Reports::all_messages(MessagesUsageQuery q, std::size_t max_pages,
bool& truncated) const {
if (max_pages == 0 || max_pages > Caps::kMaxPagesHard) bad("max_pages out of range");
std::vector<UsageBucket> out;
truncated = false;
for (std::size_t n = 0; n < max_pages; ++n) {
ReportPage<UsageBucket> p = messages(q);
for (auto& b : p.items) out.push_back(std::move(b));
if (!p.has_more || p.next_page.empty()) return out;
q.page = p.next_page;
}
truncated = true;
return out;
}
} // namespace molo::anthropic::admin
+130
View File
@@ -0,0 +1,130 @@
#pragma once
// Usage and cost reports (Usage and Cost API): query builders that enforce
// the documented ranges locally, typed parsing of the documented response
// shapes, exact decimal totals, and a capped page walk. The three endpoints
// are documented in the API reference but present in no SDK (SPEC.md).
#include <map>
#include <string>
#include <vector>
#include "anthropic/admin/query.h"
#include "anthropic/admin/services/reports.h"
#include "clients/body/json.h"
namespace molo::anthropic::admin {
// RFC 3339 UTC timestamp "YYYY-MM-DDTHH:MM:SSZ" (offsets allowed) / date "YYYY-MM-DD".
bool valid_rfc3339(const std::string& s);
bool valid_date(const std::string& s);
// Time-bucket granularity and the documented bucket limits.
struct BucketWidth {
static long default_limit(const std::string& width); // 1d:7 1h:24 1m:60
static long max_limit(const std::string& width); // 1d:31 1h:168 1m:1440
static bool valid(const std::string& width);
};
class MessagesUsageQuery {
public:
std::string starting_at; // required, RFC 3339
std::string ending_at; // optional
std::string bucket_width = "1d"; // 1d | 1h | 1m
long limit = 0; // 0: server default
std::string page;
std::vector<std::string> group_by, models, workspace_ids, api_key_ids, account_ids,
service_account_ids, service_tiers, context_window, inference_geos, speeds;
Query to_query() const; // throws llm::ApiError::invalid
};
class CostQuery {
public:
std::string starting_at; // required, RFC 3339
std::string ending_at;
long limit = 0; // 1..31
std::string page;
std::vector<std::string> group_by; // description, workspace_id
Query to_query() const;
};
class ClaudeCodeQuery {
public:
std::string starting_at; // required, YYYY-MM-DD (one UTC day)
long limit = 0; // 1..1000
std::string page;
Query to_query() const;
};
// Exact fixed-point decimal (9 fractional digits) for cost amounts such as
// "123.78912" (lowest currency units as a decimal string).
class Decimal {
public:
static bool parse(const std::string& text, Decimal& out);
Decimal& add(const Decimal& other); // throws std::overflow_error
std::string str() const;
long long scaled() const { return scaled_; }
private:
long long scaled_ = 0;
};
struct UsageResult {
std::string model, workspace_id, api_key_id, service_tier, speed, context_window, inference_geo;
long long uncached_input = 0, cache_read_input = 0, cache_creation_5m = 0, cache_creation_1h = 0,
output = 0, web_search_requests = 0;
long long input_total() const { return uncached_input + cache_read_input + cache_creation_5m + cache_creation_1h; }
};
struct UsageBucket {
std::string starting_at, ending_at;
std::vector<UsageResult> results;
};
struct CostResult {
std::string amount, currency, description, cost_type, model, token_type, workspace_id;
};
struct CostBucket {
std::string starting_at, ending_at;
std::vector<CostResult> results;
};
struct ClaudeCodeRecord {
std::string actor_type, actor, date, customer_type, terminal_type, subscription_type;
long long sessions = 0, commits = 0, pull_requests = 0, lines_added = 0, lines_removed = 0;
bool is_remote = false;
long long tokens_input = 0, tokens_output = 0;
std::map<std::string, long long> accepted, rejected; // by tool
};
template <typename T>
struct ReportPage {
std::vector<T> items;
bool has_more = false;
std::string next_page;
};
class ReportParser {
public:
// Throw llm::ApiError BAD_RESPONSE on a shape that is not the documented one.
static ReportPage<UsageBucket> usage(const clients::body::Json& doc);
static ReportPage<CostBucket> cost(const clients::body::Json& doc);
static ReportPage<ClaudeCodeRecord> claude_code(const clients::body::Json& doc);
static UsageResult sum(const std::vector<UsageBucket>& buckets); // totals of all results
static Decimal sum(const std::vector<CostBucket>& buckets);
};
// The three report endpoints with validated queries and typed pages.
class Reports {
public:
explicit Reports(std::shared_ptr<Gateway> gateway)
: usage_(gateway), cost_(gateway) {}
ReportPage<UsageBucket> messages(const MessagesUsageQuery& q) const;
ReportPage<ClaudeCodeRecord> claude_code(const ClaudeCodeQuery& q) const;
ReportPage<CostBucket> cost(const CostQuery& q) const;
// Walks pages (capped) and returns every bucket; `truncated` is set loudly.
std::vector<UsageBucket> all_messages(MessagesUsageQuery q, std::size_t max_pages, bool& truncated) const;
private:
UsageReports usage_;
CostReports cost_;
};
} // namespace molo::anthropic::admin
+213
View File
@@ -0,0 +1,213 @@
#include "anthropic/admin/request.h"
#include <cstdlib>
#include "anthropic/admin/caps.h"
#include "clients/url.h"
#include "llm/api_client.h"
#include "llm/error.h"
namespace molo::anthropic::admin {
using clients::body::Json;
namespace {
constexpr const char* kVendor = "anthropic";
[[noreturn]] void bad(const std::string& why) { throw llm::ApiError::invalid(kVendor, why); }
std::string base_of(const std::string& name) {
if (name.size() > 2 && name.compare(name.size() - 2, 2, "[]") == 0) return name.substr(0, name.size() - 2);
return name;
}
bool has_control(const std::string& s) {
for (unsigned char c : s)
if (c < 0x20 || c == 0x7f) return true;
return false;
}
std::string encode_pair(const std::string& k, const std::string& v) {
return clients::Url::encode_component(k) + "=" + clients::Url::encode_component(v);
}
void check_workspace(const CallSpec& spec, const std::string& workspace_id,
std::map<std::string, std::string>& headers) {
if (!spec.workspace || workspace_id.empty()) return;
if (!llm::Service::valid_id(workspace_id)) bad("bad workspace id");
headers["anthropic-workspace-id"] = workspace_id;
}
} // namespace
std::vector<std::string> RequestBuilder::names(const char* list) {
std::vector<std::string> out;
std::string cur;
for (const char* p = list; *p; ++p) {
if (*p == ',') {
if (!cur.empty()) out.push_back(cur);
cur.clear();
} else {
cur += *p;
}
}
if (!cur.empty()) out.push_back(cur);
return out;
}
bool RequestBuilder::contains(const char* list, const std::string& name) {
for (const std::string& n : names(list))
if (n == name) return true;
return false;
}
std::string RequestBuilder::path_of(Call call, const std::vector<std::string>& ids) {
const CallSpec& spec = spec_of(call);
std::string tmpl = spec.path;
std::string out;
std::size_t used = 0;
for (std::size_t i = 0; i < tmpl.size(); ++i) {
if (tmpl[i] != '{') {
out += tmpl[i];
continue;
}
std::size_t close = tmpl.find('}', i);
if (close == std::string::npos) bad("malformed path template");
std::string label = tmpl.substr(i + 1, close - i - 1);
if (used >= ids.size()) bad("missing " + label);
if (ids[used].size() > Caps::kMaxIdBytes || !llm::Service::valid_id(ids[used])) bad("bad " + label);
out += ids[used++];
i = close;
}
if (used != ids.size()) bad("too many ids for " + std::string(spec.name));
return out;
}
PreparedRequest RequestBuilder::prepare(Call call, const std::vector<std::string>& ids,
const Query* query, const Json* body,
const std::string& workspace_id) {
const CallSpec& spec = spec_of(call);
if (spec.wire == Wire::kMultipart) bad(std::string(spec.name) + " is a multipart upload");
PreparedRequest out;
out.call = call;
out.method = method_of(call);
out.path = path_of(call, ids);
// --- body -----------------------------------------------------------------
const std::vector<std::string> body_fields = names(spec.body);
if (body_fields.empty()) {
if (body) bad(std::string(spec.name) + " takes no body");
} else {
Json doc = body ? *body : Json::object();
if (!doc.is_object()) bad("body must be a JSON object");
for (const auto& [key, value] : doc.as_object()) {
(void)value;
bool known = false;
for (const std::string& f : body_fields)
if (f == key) known = true;
if (!known) bad("unknown field " + key + " for " + spec.name);
}
for (const std::string& r : names(spec.required)) {
if (!contains(spec.body, r)) continue;
const Json* v = doc.find(r);
if (!v || v->is_null()) bad(r + " is required");
}
if (doc.dump().size() > Caps::kMaxBodyBytes) bad("body over the byte cap");
out.body = std::move(doc);
}
// --- query and header parameters --------------------------------------------
const std::vector<std::string> query_params = names(spec.query);
const std::vector<std::string> header_params = names(spec.headers);
std::vector<std::pair<std::string, std::string>> wire; // name, value
std::map<std::string, std::size_t> counts;
std::size_t total = 0;
if (query) {
for (const auto& [raw_name, value] : query->items()) {
const std::string name = base_of(raw_name);
bool array = false, found = false;
for (const std::string& p : query_params) {
if (base_of(p) == name) {
found = true;
array = p != name;
}
}
std::string header_name;
for (const std::string& h : header_params) {
std::size_t eq = h.find('=');
if (eq != std::string::npos && h.substr(0, eq) == name) header_name = h.substr(eq + 1);
}
if (!found && header_name.empty()) bad("unknown parameter " + name + " for " + spec.name);
if (value.size() > Caps::kMaxQueryValueBytes) bad(name + " is over the size cap");
if (has_control(value)) bad(name + " has control characters");
std::size_t n = ++counts[name];
if (n > Caps::kMaxQueryValues) bad(name + " has too many values");
if (!array && n > 1) bad(name + " takes one value");
if (name == "limit") {
char* end = nullptr;
long lim = std::strtol(value.c_str(), &end, 10);
if (value.empty() || *end || lim < 1 || lim > Caps::kMaxLimit)
bad("limit must be 1.." + std::to_string(Caps::kMaxLimit));
}
if (!header_name.empty()) {
out.headers[header_name] = value;
continue;
}
std::string pair = encode_pair(array ? name + "[]" : name, value);
total += pair.size() + 1;
if (total > Caps::kMaxQueryBytes) bad("query is over the size cap");
wire.emplace_back(name, pair);
}
}
for (const std::string& r : names(spec.required)) {
if (contains(spec.body, r)) continue;
const std::string name = base_of(r);
if (!counts.count(name)) bad(name + " is required");
}
out.target = out.path;
char sep = '?';
for (const auto& w : wire) {
out.target += sep;
out.target += w.second;
sep = '&';
}
// --- headers ------------------------------------------------------------------
if (spec.beta[0]) out.headers["anthropic-beta"] = spec.beta;
check_workspace(spec, workspace_id, out.headers);
return out;
}
PreparedRequest RequestBuilder::prepare_form(Call call, const std::vector<std::string>& ids,
const std::vector<std::string>& part_names,
std::size_t total_bytes,
const std::string& workspace_id) {
const CallSpec& spec = spec_of(call);
if (spec.wire != Wire::kMultipart) bad(std::string(spec.name) + " is not a multipart upload");
PreparedRequest out;
out.call = call;
out.method = method_of(call);
out.path = path_of(call, ids);
out.target = out.path;
if (part_names.size() > Caps::kMaxFormParts) bad("too many form parts");
if (total_bytes > Caps::kMaxFormBytes) bad("upload over the byte cap");
const std::vector<std::string> allowed = names(spec.body);
for (const std::string& part : part_names) {
bool known = false;
for (const std::string& a : allowed)
if (a == part) known = true;
if (!known) bad("unknown form part " + part + " for " + spec.name);
}
for (const std::string& r : names(spec.required)) {
bool present = false;
for (const std::string& part : part_names)
if (part == r) present = true;
if (!present) bad("form part " + r + " is required");
}
if (spec.beta[0]) out.headers["anthropic-beta"] = spec.beta;
check_workspace(spec, workspace_id, out.headers);
return out;
}
} // namespace molo::anthropic::admin
+51
View File
@@ -0,0 +1,51 @@
#pragma once
// RequestBuilder: turns a call-table row plus ids, query and body into the
// exact request that would go on the wire, without touching the network.
// Every local rule lives here: ids are validated before a path is built,
// unknown and missing fields are rejected loudly, sizes and counts are
// capped. Tests and the demo's 422 path run on this alone.
#include <map>
#include <optional>
#include <string>
#include <vector>
#include "anthropic/admin/calls.h"
#include "anthropic/admin/query.h"
#include "clients/body/json.h"
#include "clients/request.h"
namespace molo::anthropic::admin {
struct PreparedRequest {
Call call;
clients::Method method;
std::string path; // /v1/organizations/invites/invite_01
std::string target; // path plus ?query, ready for llm::ApiClient
std::map<std::string, std::string> headers;
std::optional<clients::body::Json> body;
};
class RequestBuilder {
public:
// Throws llm::ApiError::invalid (vendor "anthropic") on any local violation.
// `workspace_id` becomes the anthropic-workspace-id header for calls that
// accept it; empty means none.
static PreparedRequest prepare(Call call, const std::vector<std::string>& ids,
const Query* query, const clients::body::Json* body,
const std::string& workspace_id = "");
// Multipart rows: checks part names against the table. Returns the target.
static PreparedRequest prepare_form(Call call, const std::vector<std::string>& ids,
const std::vector<std::string>& part_names,
std::size_t total_bytes,
const std::string& workspace_id = "");
// Names in a comma list from the call table.
static std::vector<std::string> names(const char* list);
static bool contains(const char* list, const std::string& name);
static std::string path_of(Call call, const std::vector<std::string>& ids);
};
} // namespace molo::anthropic::admin
+86
View File
@@ -0,0 +1,86 @@
#include "anthropic/admin/resource.h"
#include <stdexcept>
#include "llm/error.h"
namespace molo::anthropic::admin {
Resource::Resource(std::shared_ptr<Gateway> gateway, Auth auth)
: llm::Service(gateway->primary_client(auth)), gateway_(std::move(gateway)), auth_(auth) {}
const CallSpec& Resource::checked(Call call) const {
const CallSpec& spec = spec_of(call);
if (spec.auth != auth_)
throw std::logic_error(std::string(spec.name) + " does not belong to this resource's credential class");
return spec;
}
Json Resource::do_json(Call call, const std::vector<std::string>& ids, const Query* query,
const Json* body) const {
checked(call);
PreparedRequest p = RequestBuilder::prepare(call, ids, query, body, gateway_->workspace_id());
auto client = gateway_->client_for(auth_);
return client->request(p.method, p.target, p.body ? &*p.body : nullptr, p.headers);
}
llm::RawResponse Resource::do_raw(Call call, const std::vector<std::string>& ids,
const Query* query) const {
checked(call);
PreparedRequest p = RequestBuilder::prepare(call, ids, query, nullptr, gateway_->workspace_id());
auto client = gateway_->client_for(auth_);
return client->request_raw(p.method, p.target, nullptr, "", p.headers);
}
Json Resource::do_form(Call call, const std::vector<std::string>& ids,
const clients::body::MultipartBody& form) const {
checked(call);
std::vector<std::string> names;
for (const auto& part : form.parts()) names.push_back(part.name);
PreparedRequest p = RequestBuilder::prepare_form(call, ids, names, form.encoded_size(),
gateway_->workspace_id());
auto client = gateway_->client_for(auth_);
return client->post_multipart(p.target, form, p.headers);
}
void Resource::do_stream(Call call, const std::vector<std::string>& ids, const Query* query,
const EventSink& sink) const {
checked(call);
PreparedRequest p = RequestBuilder::prepare(call, ids, query, nullptr, gateway_->workspace_id());
gateway_->stream_get(auth_, p.target, p.headers, sink, Caps::kMaxStreamEvents);
}
Walk Resource::do_walk(Call call, const std::vector<std::string>& ids, const Query& query,
std::size_t max_pages) const {
const CallSpec& spec = checked(call);
if (spec.page == Page::kNone) throw std::logic_error(std::string(spec.name) + " is not paginated");
if (max_pages == 0 || max_pages > Caps::kMaxPagesHard)
throw llm::ApiError::invalid("anthropic",
"max_pages must be 1.." + std::to_string(Caps::kMaxPagesHard));
Walk out;
Query q = query;
while (true) {
Json page = do_json(call, ids, &q, nullptr);
++out.pages;
for (const Json& item : Pager::items_of(page)) {
if (out.size() >= Caps::kMaxItems) {
out.truncated = true;
out.reason = "item_cap";
return out;
}
out.items.push(item);
}
Query next = q;
if (!Pager::advance(spec.page, page, next)) return out;
out.next_page = next.get("page");
if (out.pages >= max_pages) {
out.truncated = true;
out.reason = "page_cap";
return out;
}
out.next_page.clear();
q = std::move(next);
}
}
} // namespace molo::anthropic::admin
+57
View File
@@ -0,0 +1,57 @@
#pragma once
// Resource: base of every generated service class (services/*.h). One class
// per resource group, one method per call-table row. Each method validates
// locally first (RequestBuilder: ids, fields, sizes), then needs the right
// credential lane (Gateway), then sends. Destructive and mutating methods are
// separate, explicit methods with no default behavior.
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include "anthropic/admin/caps.h"
#include "anthropic/admin/gateway.h"
#include "anthropic/admin/pager.h"
#include "anthropic/admin/query.h"
#include "anthropic/admin/request.h"
#include "clients/body/form.h"
#include "llm/api_client.h"
namespace molo::anthropic::admin {
using Json = clients::body::Json;
using EventSink = llm::SseDecoder::Sink;
class Resource : public llm::Service {
public:
Resource(std::shared_ptr<Gateway> gateway, Auth auth);
Auth auth() const { return auth_; }
// True when a call of this class could be sent now (credential present).
bool ready() const { return gateway_->ready(auth_); }
const Gateway& gateway() const { return *gateway_; }
protected:
Json do_json(Call call, const std::vector<std::string>& ids, const Query* query,
const Json* body) const;
llm::RawResponse do_raw(Call call, const std::vector<std::string>& ids,
const Query* query) const;
Json do_form(Call call, const std::vector<std::string>& ids,
const clients::body::MultipartBody& form) const;
// Streams GET server-sent events; at most Caps::kMaxStreamEvents events.
void do_stream(Call call, const std::vector<std::string>& ids, const Query* query,
const EventSink& sink) const;
// Walks every page of a list call, capped in pages and items.
Walk do_walk(Call call, const std::vector<std::string>& ids, const Query& query,
std::size_t max_pages) const;
private:
const CallSpec& checked(Call call) const;
std::shared_ptr<Gateway> gateway_;
Auth auth_;
};
} // namespace molo::anthropic::admin
+171
View File
@@ -0,0 +1,171 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/access.h"
namespace molo::anthropic::admin {
Json FederationIssuers::archive(const std::string& federation_issuer_id) const {
return do_json(Call::kFederationIssuersArchive, {federation_issuer_id}, nullptr, nullptr);
}
Json FederationIssuers::create(const Json& body) const {
return do_json(Call::kFederationIssuersCreate, {}, nullptr, &body);
}
Json FederationIssuers::list(const Query& query) const {
return do_json(Call::kFederationIssuersList, {}, &query, nullptr);
}
Walk FederationIssuers::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kFederationIssuersList, {}, query, max_pages);
}
Json FederationIssuers::get(const std::string& federation_issuer_id) const {
return do_json(Call::kFederationIssuersRetrieve, {federation_issuer_id}, nullptr, nullptr);
}
Json FederationIssuers::update(const std::string& federation_issuer_id, const Json& body) const {
return do_json(Call::kFederationIssuersUpdate, {federation_issuer_id}, nullptr, &body);
}
Json FederationRules::archive(const std::string& federation_rule_id) const {
return do_json(Call::kFederationRulesArchive, {federation_rule_id}, nullptr, nullptr);
}
Json FederationRules::create(const Json& body) const {
return do_json(Call::kFederationRulesCreate, {}, nullptr, &body);
}
Json FederationRules::list(const Query& query) const {
return do_json(Call::kFederationRulesList, {}, &query, nullptr);
}
Walk FederationRules::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kFederationRulesList, {}, query, max_pages);
}
Json FederationRules::get(const std::string& federation_rule_id) const {
return do_json(Call::kFederationRulesRetrieve, {federation_rule_id}, nullptr, nullptr);
}
Json FederationRules::update(const std::string& federation_rule_id, const Json& body) const {
return do_json(Call::kFederationRulesUpdate, {federation_rule_id}, nullptr, &body);
}
Json FederationRuleWorkspaces::add(const std::string& federation_rule_id, const Json& body) const {
return do_json(Call::kFederationRulesWorkspacesAdd, {federation_rule_id}, nullptr, &body);
}
Json FederationRuleWorkspaces::list(const std::string& federation_rule_id, const Query& query) const {
return do_json(Call::kFederationRulesWorkspacesList, {federation_rule_id}, &query, nullptr);
}
Walk FederationRuleWorkspaces::list_all(const std::string& federation_rule_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kFederationRulesWorkspacesList, {federation_rule_id}, query, max_pages);
}
Json FederationRuleWorkspaces::remove(const std::string& federation_rule_id, const std::string& workspace_id) const {
return do_json(Call::kFederationRulesWorkspacesRemove, {federation_rule_id, workspace_id}, nullptr, nullptr);
}
Json RbacGroups::create(const Json& body) const {
return do_json(Call::kRbacGroupsCreate, {}, nullptr, &body);
}
Json RbacGroups::destroy(const std::string& rbac_group_id) const {
return do_json(Call::kRbacGroupsDelete, {rbac_group_id}, nullptr, nullptr);
}
Json RbacGroups::list(const Query& query) const {
return do_json(Call::kRbacGroupsList, {}, &query, nullptr);
}
Walk RbacGroups::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kRbacGroupsList, {}, query, max_pages);
}
Json RbacGroups::get(const std::string& rbac_group_id) const {
return do_json(Call::kRbacGroupsRetrieve, {rbac_group_id}, nullptr, nullptr);
}
Json RbacGroups::update(const std::string& rbac_group_id, const Json& body) const {
return do_json(Call::kRbacGroupsUpdate, {rbac_group_id}, nullptr, &body);
}
Json RbacGroupsMembers::add(const std::string& rbac_group_id, const Json& body) const {
return do_json(Call::kRbacGroupsMembersAdd, {rbac_group_id}, nullptr, &body);
}
Json RbacGroupsMembers::list(const std::string& rbac_group_id, const Query& query) const {
return do_json(Call::kRbacGroupsMembersList, {rbac_group_id}, &query, nullptr);
}
Walk RbacGroupsMembers::list_all(const std::string& rbac_group_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kRbacGroupsMembersList, {rbac_group_id}, query, max_pages);
}
Json RbacGroupsMembers::remove(const std::string& rbac_group_id, const std::string& user_id) const {
return do_json(Call::kRbacGroupsMembersRemove, {rbac_group_id, user_id}, nullptr, nullptr);
}
Json RbacRoles::list(const Query& query) const {
return do_json(Call::kRbacRolesList, {}, &query, nullptr);
}
Walk RbacRoles::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kRbacRolesList, {}, query, max_pages);
}
Json RbacRoles::get(const std::string& rbac_role_id) const {
return do_json(Call::kRbacRolesRetrieve, {rbac_role_id}, nullptr, nullptr);
}
Json RbacRolesPermissions::list(const std::string& rbac_role_id, const Query& query) const {
return do_json(Call::kRbacRolesPermissionsList, {rbac_role_id}, &query, nullptr);
}
Walk RbacRolesPermissions::list_all(const std::string& rbac_role_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kRbacRolesPermissionsList, {rbac_role_id}, query, max_pages);
}
Json ServiceAccounts::archive(const std::string& service_account_id) const {
return do_json(Call::kServiceAccountsArchive, {service_account_id}, nullptr, nullptr);
}
Json ServiceAccounts::create(const Json& body) const {
return do_json(Call::kServiceAccountsCreate, {}, nullptr, &body);
}
Json ServiceAccounts::list(const Query& query) const {
return do_json(Call::kServiceAccountsList, {}, &query, nullptr);
}
Walk ServiceAccounts::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kServiceAccountsList, {}, query, max_pages);
}
Json ServiceAccounts::get(const std::string& service_account_id) const {
return do_json(Call::kServiceAccountsRetrieve, {service_account_id}, nullptr, nullptr);
}
Json ServiceAccounts::update(const std::string& service_account_id, const Json& body) const {
return do_json(Call::kServiceAccountsUpdate, {service_account_id}, nullptr, &body);
}
Json ServiceAccountWorkspaces::add(const std::string& service_account_id, const Json& body) const {
return do_json(Call::kServiceAccountsWorkspacesAdd, {service_account_id}, nullptr, &body);
}
Json ServiceAccountWorkspaces::list(const std::string& service_account_id, const Query& query) const {
return do_json(Call::kServiceAccountsWorkspacesList, {service_account_id}, &query, nullptr);
}
Walk ServiceAccountWorkspaces::list_all(const std::string& service_account_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kServiceAccountsWorkspacesList, {service_account_id}, query, max_pages);
}
Json ServiceAccountWorkspaces::remove(const std::string& service_account_id, const std::string& workspace_id) const {
return do_json(Call::kServiceAccountsWorkspacesRemove, {service_account_id, workspace_id}, nullptr, nullptr);
}
} // namespace molo::anthropic::admin
+201
View File
@@ -0,0 +1,201 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// access calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group federation.issuers
class FederationIssuers : public Resource {
public:
explicit FederationIssuers(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kOAuth) {}
// POST /v1/organizations/federation_issuers/{federation_issuer_id}/archive DESTRUCTIVE
Json archive(const std::string& federation_issuer_id) const;
// POST /v1/organizations/federation_issuers MUTATES
Json create(const Json& body) const;
// GET /v1/organizations/federation_issuers
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/federation_issuers/{federation_issuer_id}
Json get(const std::string& federation_issuer_id) const;
// POST /v1/organizations/federation_issuers/{federation_issuer_id} MUTATES
Json update(const std::string& federation_issuer_id, const Json& body) const;
};
// group federation.rules
class FederationRules : public Resource {
public:
explicit FederationRules(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kOAuth) {}
// POST /v1/organizations/federation_rules/{federation_rule_id}/archive DESTRUCTIVE
Json archive(const std::string& federation_rule_id) const;
// POST /v1/organizations/federation_rules MUTATES
Json create(const Json& body) const;
// GET /v1/organizations/federation_rules
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/federation_rules/{federation_rule_id}
Json get(const std::string& federation_rule_id) const;
// POST /v1/organizations/federation_rules/{federation_rule_id} MUTATES
Json update(const std::string& federation_rule_id, const Json& body) const;
};
// group federation.rules.workspaces
class FederationRuleWorkspaces : public Resource {
public:
explicit FederationRuleWorkspaces(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kOAuth) {}
// POST /v1/organizations/federation_rules/{federation_rule_id}/workspaces MUTATES
Json add(const std::string& federation_rule_id, const Json& body) const;
// GET /v1/organizations/federation_rules/{federation_rule_id}/workspaces
Json list(const std::string& federation_rule_id, const Query& query = Query()) const;
Walk list_all(const std::string& federation_rule_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/federation_rules/{federation_rule_id}/workspaces/{workspace_id} DESTRUCTIVE
Json remove(const std::string& federation_rule_id, const std::string& workspace_id) const;
};
// group rbac_groups
class RbacGroups : public Resource {
public:
explicit RbacGroups(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/rbac_groups MUTATES
Json create(const Json& body) const;
// DELETE /v1/organizations/rbac_groups/{rbac_group_id} DESTRUCTIVE
Json destroy(const std::string& rbac_group_id) const;
// GET /v1/organizations/rbac_groups
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/rbac_groups/{rbac_group_id}
Json get(const std::string& rbac_group_id) const;
// POST /v1/organizations/rbac_groups/{rbac_group_id} MUTATES
Json update(const std::string& rbac_group_id, const Json& body) const;
};
// group rbac_groups.members
class RbacGroupsMembers : public Resource {
public:
explicit RbacGroupsMembers(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/rbac_groups/{rbac_group_id}/members MUTATES
Json add(const std::string& rbac_group_id, const Json& body) const;
// GET /v1/organizations/rbac_groups/{rbac_group_id}/members
Json list(const std::string& rbac_group_id, const Query& query = Query()) const;
Walk list_all(const std::string& rbac_group_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id} DESTRUCTIVE
Json remove(const std::string& rbac_group_id, const std::string& user_id) const;
};
// group rbac_roles
class RbacRoles : public Resource {
public:
explicit RbacRoles(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/rbac_roles
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/rbac_roles/{rbac_role_id}
Json get(const std::string& rbac_role_id) const;
};
// group rbac_roles.permissions
class RbacRolesPermissions : public Resource {
public:
explicit RbacRolesPermissions(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/rbac_roles/{rbac_role_id}/permissions
Json list(const std::string& rbac_role_id, const Query& query = Query()) const;
Walk list_all(const std::string& rbac_role_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group service_accounts
class ServiceAccounts : public Resource {
public:
explicit ServiceAccounts(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kOAuth) {}
// POST /v1/organizations/service_accounts/{service_account_id}/archive DESTRUCTIVE
Json archive(const std::string& service_account_id) const;
// POST /v1/organizations/service_accounts MUTATES
Json create(const Json& body) const;
// GET /v1/organizations/service_accounts
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/service_accounts/{service_account_id}
Json get(const std::string& service_account_id) const;
// POST /v1/organizations/service_accounts/{service_account_id} MUTATES
Json update(const std::string& service_account_id, const Json& body) const;
};
// group service_accounts.workspaces
class ServiceAccountWorkspaces : public Resource {
public:
explicit ServiceAccountWorkspaces(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kOAuth) {}
// POST /v1/organizations/service_accounts/{service_account_id}/workspaces MUTATES
Json add(const std::string& service_account_id, const Json& body) const;
// GET /v1/organizations/service_accounts/{service_account_id}/workspaces
Json list(const std::string& service_account_id, const Query& query = Query()) const;
Walk list_all(const std::string& service_account_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/service_accounts/{service_account_id}/workspaces/{workspace_id} DESTRUCTIVE
Json remove(const std::string& service_account_id, const std::string& workspace_id) const;
};
} // namespace molo::anthropic::admin
+39
View File
@@ -0,0 +1,39 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/agents.h"
namespace molo::anthropic::admin {
Json Agents::archive(const std::string& agent_id) const {
return do_json(Call::kAgentsArchive, {agent_id}, nullptr, nullptr);
}
Json Agents::create(const Json& body) const {
return do_json(Call::kAgentsCreate, {}, nullptr, &body);
}
Json Agents::list(const Query& query) const {
return do_json(Call::kAgentsList, {}, &query, nullptr);
}
Walk Agents::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAgentsList, {}, query, max_pages);
}
Json Agents::get(const std::string& agent_id, const Query& query) const {
return do_json(Call::kAgentsRetrieve, {agent_id}, &query, nullptr);
}
Json Agents::update(const std::string& agent_id, const Json& body) const {
return do_json(Call::kAgentsUpdate, {agent_id}, nullptr, &body);
}
Json AgentsVersions::list(const std::string& agent_id, const Query& query) const {
return do_json(Call::kAgentsVersionsList, {agent_id}, &query, nullptr);
}
Walk AgentsVersions::list_all(const std::string& agent_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAgentsVersionsList, {agent_id}, query, max_pages);
}
} // namespace molo::anthropic::admin
+53
View File
@@ -0,0 +1,53 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// agents calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group agents
class Agents : public Resource {
public:
explicit Agents(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/agents/{agent_id}/archive DESTRUCTIVE
Json archive(const std::string& agent_id) const;
// POST /v1/agents MUTATES
Json create(const Json& body) const;
// GET /v1/agents
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/agents/{agent_id}
Json get(const std::string& agent_id, const Query& query = Query()) const;
// POST /v1/agents/{agent_id} MUTATES
Json update(const std::string& agent_id, const Json& body) const;
};
// group agents.versions
class AgentsVersions : public Resource {
public:
explicit AgentsVersions(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// GET /v1/agents/{agent_id}/versions
Json list(const std::string& agent_id, const Query& query = Query()) const;
Walk list_all(const std::string& agent_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
} // namespace molo::anthropic::admin
+111
View File
@@ -0,0 +1,111 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/analytics.h"
namespace molo::anthropic::admin {
Json AnalyticsAppsChatProjects::list(const Query& query) const {
return do_json(Call::kAnalyticsAppsChatProjectsList, {}, &query, nullptr);
}
Walk AnalyticsAppsChatProjects::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsAppsChatProjectsList, {}, query, max_pages);
}
Json AnalyticsArtifacts::list(const Query& query) const {
return do_json(Call::kAnalyticsArtifactsList, {}, &query, nullptr);
}
Walk AnalyticsArtifacts::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsArtifactsList, {}, query, max_pages);
}
Json AnalyticsConnectors::list(const Query& query) const {
return do_json(Call::kAnalyticsConnectorsList, {}, &query, nullptr);
}
Walk AnalyticsConnectors::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsConnectorsList, {}, query, max_pages);
}
Json AnalyticsCost::list(const Query& query) const {
return do_json(Call::kAnalyticsCostList, {}, &query, nullptr);
}
Walk AnalyticsCost::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsCostList, {}, query, max_pages);
}
Json AnalyticsCostReport::list(const Query& query) const {
return do_json(Call::kAnalyticsCostReportList, {}, &query, nullptr);
}
Walk AnalyticsCostReport::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsCostReportList, {}, query, max_pages);
}
Json AnalyticsPlugins::list(const Query& query) const {
return do_json(Call::kAnalyticsPluginsList, {}, &query, nullptr);
}
Walk AnalyticsPlugins::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsPluginsList, {}, query, max_pages);
}
Json AnalyticsSkills::list(const Query& query) const {
return do_json(Call::kAnalyticsSkillsList, {}, &query, nullptr);
}
Walk AnalyticsSkills::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsSkillsList, {}, query, max_pages);
}
Json AnalyticsSummaries::list(const Query& query) const {
return do_json(Call::kAnalyticsSummariesList, {}, &query, nullptr);
}
Walk AnalyticsSummaries::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsSummariesList, {}, query, max_pages);
}
Json AnalyticsUsage::list(const Query& query) const {
return do_json(Call::kAnalyticsUsageList, {}, &query, nullptr);
}
Walk AnalyticsUsage::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsUsageList, {}, query, max_pages);
}
Json AnalyticsUsageReport::list(const Query& query) const {
return do_json(Call::kAnalyticsUsageReportList, {}, &query, nullptr);
}
Walk AnalyticsUsageReport::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsUsageReportList, {}, query, max_pages);
}
Json AnalyticsUserCostReport::list(const Query& query) const {
return do_json(Call::kAnalyticsUserCostReportList, {}, &query, nullptr);
}
Walk AnalyticsUserCostReport::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsUserCostReportList, {}, query, max_pages);
}
Json AnalyticsUserUsageReport::list(const Query& query) const {
return do_json(Call::kAnalyticsUserUsageReportList, {}, &query, nullptr);
}
Walk AnalyticsUserUsageReport::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsUserUsageReportList, {}, query, max_pages);
}
Json AnalyticsUsers::list(const Query& query) const {
return do_json(Call::kAnalyticsUsersList, {}, &query, nullptr);
}
Walk AnalyticsUsers::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kAnalyticsUsersList, {}, query, max_pages);
}
} // namespace molo::anthropic::admin
+184
View File
@@ -0,0 +1,184 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// analytics calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group analytics.apps.chat.projects
class AnalyticsAppsChatProjects : public Resource {
public:
explicit AnalyticsAppsChatProjects(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/apps/chat/projects
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.artifacts
class AnalyticsArtifacts : public Resource {
public:
explicit AnalyticsArtifacts(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/artifacts
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.connectors
class AnalyticsConnectors : public Resource {
public:
explicit AnalyticsConnectors(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/connectors
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.cost
class AnalyticsCost : public Resource {
public:
explicit AnalyticsCost(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/cost
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.cost_report
class AnalyticsCostReport : public Resource {
public:
explicit AnalyticsCostReport(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/cost_report
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.plugins
class AnalyticsPlugins : public Resource {
public:
explicit AnalyticsPlugins(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/plugins
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.skills
class AnalyticsSkills : public Resource {
public:
explicit AnalyticsSkills(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/skills
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.summaries
class AnalyticsSummaries : public Resource {
public:
explicit AnalyticsSummaries(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/summaries
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.usage
class AnalyticsUsage : public Resource {
public:
explicit AnalyticsUsage(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/usage
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.usage_report
class AnalyticsUsageReport : public Resource {
public:
explicit AnalyticsUsageReport(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/usage_report
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.user_cost_report
class AnalyticsUserCostReport : public Resource {
public:
explicit AnalyticsUserCostReport(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/user_cost_report
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.user_usage_report
class AnalyticsUserUsageReport : public Resource {
public:
explicit AnalyticsUserUsageReport(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/user_usage_report
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group analytics.users
class AnalyticsUsers : public Resource {
public:
explicit AnalyticsUsers(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/analytics/users
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,79 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/claude_tag.h"
namespace molo::anthropic::admin {
Json ClaudeTagBundles::list(const Query& query) const {
return do_json(Call::kClaudeTagBundlesList, {}, &query, nullptr);
}
Walk ClaudeTagBundles::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kClaudeTagBundlesList, {}, query, max_pages);
}
Json ClaudeTagBundles::get(const std::string& bundle_id) const {
return do_json(Call::kClaudeTagBundlesRetrieve, {bundle_id}, nullptr, nullptr);
}
Json ClaudeTagBundlesTargets::create(const std::string& bundle_id) const {
return do_json(Call::kClaudeTagBundlesTargetsCreate, {bundle_id}, nullptr, nullptr);
}
Json ClaudeTagBundlesTargets::destroy(const std::string& bundle_id, const std::string& target_id) const {
return do_json(Call::kClaudeTagBundlesTargetsDelete, {bundle_id, target_id}, nullptr, nullptr);
}
Json ClaudeTagBundlesTargets::list(const std::string& bundle_id, const Query& query) const {
return do_json(Call::kClaudeTagBundlesTargetsList, {bundle_id}, &query, nullptr);
}
Walk ClaudeTagBundlesTargets::list_all(const std::string& bundle_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kClaudeTagBundlesTargetsList, {bundle_id}, query, max_pages);
}
Json ClaudeTagBundlesTargets::get(const std::string& bundle_id, const std::string& target_id) const {
return do_json(Call::kClaudeTagBundlesTargetsRetrieve, {bundle_id, target_id}, nullptr, nullptr);
}
Json ClaudeTagSlackChannels::create(const Json& body) const {
return do_json(Call::kClaudeTagSlackChannelsCreate, {}, nullptr, &body);
}
Json ClaudeTagSlackChannels::destroy(const std::string& id) const {
return do_json(Call::kClaudeTagSlackChannelsDelete, {id}, nullptr, nullptr);
}
Json ClaudeTagSlackChannels::list(const Query& query) const {
return do_json(Call::kClaudeTagSlackChannelsList, {}, &query, nullptr);
}
Walk ClaudeTagSlackChannels::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kClaudeTagSlackChannelsList, {}, query, max_pages);
}
Json ClaudeTagSlackChannels::get(const std::string& id, const Query& query) const {
return do_json(Call::kClaudeTagSlackChannelsRetrieve, {id}, &query, nullptr);
}
Json ClaudeTagSlackChannels::update(const std::string& id, const Json& body) const {
return do_json(Call::kClaudeTagSlackChannelsUpdate, {id}, nullptr, &body);
}
Json ClaudeTagSlackWorkspaces::list(const Query& query) const {
return do_json(Call::kClaudeTagSlackWorkspacesList, {}, &query, nullptr);
}
Walk ClaudeTagSlackWorkspaces::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kClaudeTagSlackWorkspacesList, {}, query, max_pages);
}
Json ClaudeTagSlackWorkspaces::get(const std::string& id, const Query& query) const {
return do_json(Call::kClaudeTagSlackWorkspacesRetrieve, {id}, &query, nullptr);
}
Json ClaudeTagSlackWorkspaces::update(const std::string& id, const Json& body) const {
return do_json(Call::kClaudeTagSlackWorkspacesUpdate, {id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
+97
View File
@@ -0,0 +1,97 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// claude_tag calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group claude_tag.bundles
class ClaudeTagBundles : public Resource {
public:
explicit ClaudeTagBundles(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/claude_tag/bundles
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/claude_tag/bundles/{bundle_id}
Json get(const std::string& bundle_id) const;
};
// group claude_tag.bundles.targets
class ClaudeTagBundlesTargets : public Resource {
public:
explicit ClaudeTagBundlesTargets(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/claude_tag/bundles/{bundle_id}/targets MUTATES
Json create(const std::string& bundle_id) const;
// DELETE /v1/organizations/claude_tag/bundles/{bundle_id}/targets/{target_id} DESTRUCTIVE
Json destroy(const std::string& bundle_id, const std::string& target_id) const;
// GET /v1/organizations/claude_tag/bundles/{bundle_id}/targets
Json list(const std::string& bundle_id, const Query& query = Query()) const;
Walk list_all(const std::string& bundle_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/claude_tag/bundles/{bundle_id}/targets/{target_id}
Json get(const std::string& bundle_id, const std::string& target_id) const;
};
// group claude_tag.slack_channels
class ClaudeTagSlackChannels : public Resource {
public:
explicit ClaudeTagSlackChannels(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/claude_tag/slack_channels MUTATES
Json create(const Json& body) const;
// DELETE /v1/organizations/claude_tag/slack_channels/{id} DESTRUCTIVE
Json destroy(const std::string& id) const;
// GET /v1/organizations/claude_tag/slack_channels
Json list(const Query& query) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/claude_tag/slack_channels/{id}
Json get(const std::string& id, const Query& query = Query()) const;
// POST /v1/organizations/claude_tag/slack_channels/{id} MUTATES
Json update(const std::string& id, const Json& body) const;
};
// group claude_tag.slack_workspaces
class ClaudeTagSlackWorkspaces : public Resource {
public:
explicit ClaudeTagSlackWorkspaces(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/claude_tag/slack_workspaces
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/claude_tag/slack_workspaces/{id}
Json get(const std::string& id, const Query& query = Query()) const;
// POST /v1/organizations/claude_tag/slack_workspaces/{id} MUTATES
Json update(const std::string& id, const Json& body) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,55 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/deployments.h"
namespace molo::anthropic::admin {
Json DeploymentRuns::list(const Query& query) const {
return do_json(Call::kDeploymentRunsList, {}, &query, nullptr);
}
Walk DeploymentRuns::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kDeploymentRunsList, {}, query, max_pages);
}
Json DeploymentRuns::get(const std::string& deployment_run_id) const {
return do_json(Call::kDeploymentRunsRetrieve, {deployment_run_id}, nullptr, nullptr);
}
Json Deployments::archive(const std::string& deployment_id) const {
return do_json(Call::kDeploymentsArchive, {deployment_id}, nullptr, nullptr);
}
Json Deployments::create(const Json& body) const {
return do_json(Call::kDeploymentsCreate, {}, nullptr, &body);
}
Json Deployments::list(const Query& query) const {
return do_json(Call::kDeploymentsList, {}, &query, nullptr);
}
Walk Deployments::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kDeploymentsList, {}, query, max_pages);
}
Json Deployments::pause(const std::string& deployment_id) const {
return do_json(Call::kDeploymentsPause, {deployment_id}, nullptr, nullptr);
}
Json Deployments::get(const std::string& deployment_id) const {
return do_json(Call::kDeploymentsRetrieve, {deployment_id}, nullptr, nullptr);
}
Json Deployments::run(const std::string& deployment_id) const {
return do_json(Call::kDeploymentsRun, {deployment_id}, nullptr, nullptr);
}
Json Deployments::unpause(const std::string& deployment_id) const {
return do_json(Call::kDeploymentsUnpause, {deployment_id}, nullptr, nullptr);
}
Json Deployments::update(const std::string& deployment_id, const Json& body) const {
return do_json(Call::kDeploymentsUpdate, {deployment_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
@@ -0,0 +1,65 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// deployments calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group deployment_runs
class DeploymentRuns : public Resource {
public:
explicit DeploymentRuns(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// GET /v1/deployment_runs
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/deployment_runs/{deployment_run_id}
Json get(const std::string& deployment_run_id) const;
};
// group deployments
class Deployments : public Resource {
public:
explicit Deployments(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/deployments/{deployment_id}/archive DESTRUCTIVE
Json archive(const std::string& deployment_id) const;
// POST /v1/deployments MUTATES
Json create(const Json& body) const;
// GET /v1/deployments
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// POST /v1/deployments/{deployment_id}/pause DESTRUCTIVE
Json pause(const std::string& deployment_id) const;
// GET /v1/deployments/{deployment_id}
Json get(const std::string& deployment_id) const;
// POST /v1/deployments/{deployment_id}/run MUTATES
Json run(const std::string& deployment_id) const;
// POST /v1/deployments/{deployment_id}/unpause MUTATES
Json unpause(const std::string& deployment_id) const;
// POST /v1/deployments/{deployment_id} MUTATES
Json update(const std::string& deployment_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
+31
View File
@@ -0,0 +1,31 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/dreams.h"
namespace molo::anthropic::admin {
Json Dreams::archive(const std::string& dream_id) const {
return do_json(Call::kDreamsArchive, {dream_id}, nullptr, nullptr);
}
Json Dreams::cancel(const std::string& dream_id) const {
return do_json(Call::kDreamsCancel, {dream_id}, nullptr, nullptr);
}
Json Dreams::create(const Json& body) const {
return do_json(Call::kDreamsCreate, {}, nullptr, &body);
}
Json Dreams::list(const Query& query) const {
return do_json(Call::kDreamsList, {}, &query, nullptr);
}
Walk Dreams::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kDreamsList, {}, query, max_pages);
}
Json Dreams::get(const std::string& dream_id) const {
return do_json(Call::kDreamsRetrieve, {dream_id}, nullptr, nullptr);
}
} // namespace molo::anthropic::admin
+40
View File
@@ -0,0 +1,40 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// dreams calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group dreams
class Dreams : public Resource {
public:
explicit Dreams(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/dreams/{dream_id}/archive DESTRUCTIVE
Json archive(const std::string& dream_id) const;
// POST /v1/dreams/{dream_id}/cancel DESTRUCTIVE
Json cancel(const std::string& dream_id) const;
// POST /v1/dreams MUTATES
Json create(const Json& body) const;
// GET /v1/dreams
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/dreams/{dream_id}
Json get(const std::string& dream_id) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,71 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/environments.h"
namespace molo::anthropic::admin {
Json Environments::archive(const std::string& environment_id) const {
return do_json(Call::kEnvironmentsArchive, {environment_id}, nullptr, nullptr);
}
Json Environments::create(const Json& body) const {
return do_json(Call::kEnvironmentsCreate, {}, nullptr, &body);
}
Json Environments::destroy(const std::string& environment_id) const {
return do_json(Call::kEnvironmentsDelete, {environment_id}, nullptr, nullptr);
}
Json Environments::list(const Query& query) const {
return do_json(Call::kEnvironmentsList, {}, &query, nullptr);
}
Walk Environments::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kEnvironmentsList, {}, query, max_pages);
}
Json Environments::get(const std::string& environment_id) const {
return do_json(Call::kEnvironmentsRetrieve, {environment_id}, nullptr, nullptr);
}
Json Environments::update(const std::string& environment_id, const Json& body) const {
return do_json(Call::kEnvironmentsUpdate, {environment_id}, nullptr, &body);
}
Json EnvironmentsWork::ack(const std::string& environment_id, const std::string& work_id) const {
return do_json(Call::kEnvironmentsWorkAck, {environment_id, work_id}, nullptr, nullptr);
}
Json EnvironmentsWork::heartbeat(const std::string& environment_id, const std::string& work_id, const Query& query) const {
return do_json(Call::kEnvironmentsWorkHeartbeat, {environment_id, work_id}, &query, nullptr);
}
Json EnvironmentsWork::list(const std::string& environment_id, const Query& query) const {
return do_json(Call::kEnvironmentsWorkList, {environment_id}, &query, nullptr);
}
Walk EnvironmentsWork::list_all(const std::string& environment_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kEnvironmentsWorkList, {environment_id}, query, max_pages);
}
Json EnvironmentsWork::poll(const std::string& environment_id, const Query& query) const {
return do_json(Call::kEnvironmentsWorkPoll, {environment_id}, &query, nullptr);
}
Json EnvironmentsWork::get(const std::string& environment_id, const std::string& work_id) const {
return do_json(Call::kEnvironmentsWorkRetrieve, {environment_id, work_id}, nullptr, nullptr);
}
Json EnvironmentsWork::stats(const std::string& environment_id) const {
return do_json(Call::kEnvironmentsWorkStats, {environment_id}, nullptr, nullptr);
}
Json EnvironmentsWork::stop(const std::string& environment_id, const std::string& work_id, const Json& body) const {
return do_json(Call::kEnvironmentsWorkStop, {environment_id, work_id}, nullptr, &body);
}
Json EnvironmentsWork::update(const std::string& environment_id, const std::string& work_id, const Json& body) const {
return do_json(Call::kEnvironmentsWorkUpdate, {environment_id, work_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
@@ -0,0 +1,77 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// environments calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group environments
class Environments : public Resource {
public:
explicit Environments(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/environments/{environment_id}/archive DESTRUCTIVE
Json archive(const std::string& environment_id) const;
// POST /v1/environments MUTATES
Json create(const Json& body) const;
// DELETE /v1/environments/{environment_id} DESTRUCTIVE
Json destroy(const std::string& environment_id) const;
// GET /v1/environments
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/environments/{environment_id}
Json get(const std::string& environment_id) const;
// POST /v1/environments/{environment_id} MUTATES
Json update(const std::string& environment_id, const Json& body) const;
};
// group environments.work
class EnvironmentsWork : public Resource {
public:
explicit EnvironmentsWork(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/environments/{environment_id}/work/{work_id}/ack MUTATES
Json ack(const std::string& environment_id, const std::string& work_id) const;
// POST /v1/environments/{environment_id}/work/{work_id}/heartbeat MUTATES
Json heartbeat(const std::string& environment_id, const std::string& work_id, const Query& query = Query()) const;
// GET /v1/environments/{environment_id}/work
Json list(const std::string& environment_id, const Query& query = Query()) const;
Walk list_all(const std::string& environment_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/environments/{environment_id}/work/poll
Json poll(const std::string& environment_id, const Query& query = Query()) const;
// GET /v1/environments/{environment_id}/work/{work_id}
Json get(const std::string& environment_id, const std::string& work_id) const;
// GET /v1/environments/{environment_id}/work/stats
Json stats(const std::string& environment_id) const;
// POST /v1/environments/{environment_id}/work/{work_id}/stop DESTRUCTIVE
Json stop(const std::string& environment_id, const std::string& work_id, const Json& body) const;
// POST /v1/environments/{environment_id}/work/{work_id} MUTATES
Json update(const std::string& environment_id, const std::string& work_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
+111
View File
@@ -0,0 +1,111 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/identity.h"
namespace molo::anthropic::admin {
Json ApiKeys::list(const Query& query) const {
return do_json(Call::kApiKeysList, {}, &query, nullptr);
}
Walk ApiKeys::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kApiKeysList, {}, query, max_pages);
}
Json ApiKeys::get(const std::string& api_key_id) const {
return do_json(Call::kApiKeysRetrieve, {api_key_id}, nullptr, nullptr);
}
Json ApiKeys::update(const std::string& api_key_id, const Json& body) const {
return do_json(Call::kApiKeysUpdate, {api_key_id}, nullptr, &body);
}
Json ComplianceSettings::get() const {
return do_json(Call::kComplianceSettingsRetrieve, {}, nullptr, nullptr);
}
Json ComplianceSettings::update(const Json& body) const {
return do_json(Call::kComplianceSettingsUpdate, {}, nullptr, &body);
}
Json ExternalKeys::create(const Json& body) const {
return do_json(Call::kExternalKeysCreate, {}, nullptr, &body);
}
Json ExternalKeys::destroy(const std::string& external_key_id) const {
return do_json(Call::kExternalKeysDelete, {external_key_id}, nullptr, nullptr);
}
Json ExternalKeys::list(const Query& query) const {
return do_json(Call::kExternalKeysList, {}, &query, nullptr);
}
Walk ExternalKeys::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kExternalKeysList, {}, query, max_pages);
}
Json ExternalKeys::get(const std::string& external_key_id) const {
return do_json(Call::kExternalKeysRetrieve, {external_key_id}, nullptr, nullptr);
}
Json ExternalKeys::update(const std::string& external_key_id, const Json& body) const {
return do_json(Call::kExternalKeysUpdate, {external_key_id}, nullptr, &body);
}
Json ExternalKeys::validate(const std::string& external_key_id) const {
return do_json(Call::kExternalKeysValidate, {external_key_id}, nullptr, nullptr);
}
Json Invites::create(const Json& body) const {
return do_json(Call::kInvitesCreate, {}, nullptr, &body);
}
Json Invites::destroy(const std::string& invite_id) const {
return do_json(Call::kInvitesDelete, {invite_id}, nullptr, nullptr);
}
Json Invites::list(const Query& query) const {
return do_json(Call::kInvitesList, {}, &query, nullptr);
}
Walk Invites::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kInvitesList, {}, query, max_pages);
}
Json Invites::get(const std::string& invite_id) const {
return do_json(Call::kInvitesRetrieve, {invite_id}, nullptr, nullptr);
}
Json Organization::get() const {
return do_json(Call::kOrganizationRetrieve, {}, nullptr, nullptr);
}
Json RateLimits::list(const Query& query) const {
return do_json(Call::kRateLimitsList, {}, &query, nullptr);
}
Walk RateLimits::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kRateLimitsList, {}, query, max_pages);
}
Json Users::list(const Query& query) const {
return do_json(Call::kUsersList, {}, &query, nullptr);
}
Walk Users::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kUsersList, {}, query, max_pages);
}
Json Users::remove(const std::string& user_id) const {
return do_json(Call::kUsersRemove, {user_id}, nullptr, nullptr);
}
Json Users::get(const std::string& user_id) const {
return do_json(Call::kUsersRetrieve, {user_id}, nullptr, nullptr);
}
Json Users::update(const std::string& user_id, const Json& body) const {
return do_json(Call::kUsersUpdate, {user_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
+144
View File
@@ -0,0 +1,144 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// identity calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group api_keys
class ApiKeys : public Resource {
public:
explicit ApiKeys(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/api_keys
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/api_keys/{api_key_id}
Json get(const std::string& api_key_id) const;
// POST /v1/organizations/api_keys/{api_key_id} MUTATES
Json update(const std::string& api_key_id, const Json& body) const;
};
// group compliance_settings
class ComplianceSettings : public Resource {
public:
explicit ComplianceSettings(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/compliance_settings
Json get() const;
// POST /v1/organizations/compliance_settings MUTATES
Json update(const Json& body) const;
};
// group external_keys
class ExternalKeys : public Resource {
public:
explicit ExternalKeys(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/external_keys MUTATES
Json create(const Json& body) const;
// DELETE /v1/organizations/external_keys/{external_key_id} DESTRUCTIVE
Json destroy(const std::string& external_key_id) const;
// GET /v1/organizations/external_keys
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/external_keys/{external_key_id}
Json get(const std::string& external_key_id) const;
// POST /v1/organizations/external_keys/{external_key_id} MUTATES
Json update(const std::string& external_key_id, const Json& body) const;
// POST /v1/organizations/external_keys/{external_key_id}/validate MUTATES
Json validate(const std::string& external_key_id) const;
};
// group invites
class Invites : public Resource {
public:
explicit Invites(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/invites MUTATES
Json create(const Json& body) const;
// DELETE /v1/organizations/invites/{invite_id} DESTRUCTIVE
Json destroy(const std::string& invite_id) const;
// GET /v1/organizations/invites
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/invites/{invite_id}
Json get(const std::string& invite_id) const;
};
// group organization
class Organization : public Resource {
public:
explicit Organization(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/me
Json get() const;
};
// group rate_limits
class RateLimits : public Resource {
public:
explicit RateLimits(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/rate_limits
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group users
class Users : public Resource {
public:
explicit Users(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/users
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/users/{user_id} DESTRUCTIVE
Json remove(const std::string& user_id) const;
// GET /v1/organizations/users/{user_id}
Json get(const std::string& user_id) const;
// POST /v1/organizations/users/{user_id} MUTATES
Json update(const std::string& user_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
+75
View File
@@ -0,0 +1,75 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/memory.h"
namespace molo::anthropic::admin {
Json MemoryStores::archive(const std::string& memory_store_id) const {
return do_json(Call::kMemoryStoresArchive, {memory_store_id}, nullptr, nullptr);
}
Json MemoryStores::create(const Json& body) const {
return do_json(Call::kMemoryStoresCreate, {}, nullptr, &body);
}
Json MemoryStores::destroy(const std::string& memory_store_id) const {
return do_json(Call::kMemoryStoresDelete, {memory_store_id}, nullptr, nullptr);
}
Json MemoryStores::list(const Query& query) const {
return do_json(Call::kMemoryStoresList, {}, &query, nullptr);
}
Walk MemoryStores::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kMemoryStoresList, {}, query, max_pages);
}
Json MemoryStores::get(const std::string& memory_store_id) const {
return do_json(Call::kMemoryStoresRetrieve, {memory_store_id}, nullptr, nullptr);
}
Json MemoryStores::update(const std::string& memory_store_id, const Json& body) const {
return do_json(Call::kMemoryStoresUpdate, {memory_store_id}, nullptr, &body);
}
Json MemoryStoresMemories::create(const std::string& memory_store_id, const Json& body, const Query& query) const {
return do_json(Call::kMemoryStoresMemoriesCreate, {memory_store_id}, &query, &body);
}
Json MemoryStoresMemories::destroy(const std::string& memory_store_id, const std::string& memory_id, const Query& query) const {
return do_json(Call::kMemoryStoresMemoriesDelete, {memory_store_id, memory_id}, &query, nullptr);
}
Json MemoryStoresMemories::list(const std::string& memory_store_id, const Query& query) const {
return do_json(Call::kMemoryStoresMemoriesList, {memory_store_id}, &query, nullptr);
}
Walk MemoryStoresMemories::list_all(const std::string& memory_store_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kMemoryStoresMemoriesList, {memory_store_id}, query, max_pages);
}
Json MemoryStoresMemories::get(const std::string& memory_store_id, const std::string& memory_id, const Query& query) const {
return do_json(Call::kMemoryStoresMemoriesRetrieve, {memory_store_id, memory_id}, &query, nullptr);
}
Json MemoryStoresMemories::update(const std::string& memory_store_id, const std::string& memory_id, const Json& body, const Query& query) const {
return do_json(Call::kMemoryStoresMemoriesUpdate, {memory_store_id, memory_id}, &query, &body);
}
Json MemoryStoresMemoryVersions::list(const std::string& memory_store_id, const Query& query) const {
return do_json(Call::kMemoryStoresMemoryVersionsList, {memory_store_id}, &query, nullptr);
}
Walk MemoryStoresMemoryVersions::list_all(const std::string& memory_store_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kMemoryStoresMemoryVersionsList, {memory_store_id}, query, max_pages);
}
Json MemoryStoresMemoryVersions::redact(const std::string& memory_store_id, const std::string& memory_version_id) const {
return do_json(Call::kMemoryStoresMemoryVersionsRedact, {memory_store_id, memory_version_id}, nullptr, nullptr);
}
Json MemoryStoresMemoryVersions::get(const std::string& memory_store_id, const std::string& memory_version_id, const Query& query) const {
return do_json(Call::kMemoryStoresMemoryVersionsRetrieve, {memory_store_id, memory_version_id}, &query, nullptr);
}
} // namespace molo::anthropic::admin
+87
View File
@@ -0,0 +1,87 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// memory calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group memory_stores
class MemoryStores : public Resource {
public:
explicit MemoryStores(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/memory_stores/{memory_store_id}/archive DESTRUCTIVE
Json archive(const std::string& memory_store_id) const;
// POST /v1/memory_stores MUTATES
Json create(const Json& body) const;
// DELETE /v1/memory_stores/{memory_store_id} DESTRUCTIVE
Json destroy(const std::string& memory_store_id) const;
// GET /v1/memory_stores
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/memory_stores/{memory_store_id}
Json get(const std::string& memory_store_id) const;
// POST /v1/memory_stores/{memory_store_id} MUTATES
Json update(const std::string& memory_store_id, const Json& body) const;
};
// group memory_stores.memories
class MemoryStoresMemories : public Resource {
public:
explicit MemoryStoresMemories(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/memory_stores/{memory_store_id}/memories MUTATES
Json create(const std::string& memory_store_id, const Json& body, const Query& query = Query()) const;
// DELETE /v1/memory_stores/{memory_store_id}/memories/{memory_id} DESTRUCTIVE
Json destroy(const std::string& memory_store_id, const std::string& memory_id, const Query& query = Query()) const;
// GET /v1/memory_stores/{memory_store_id}/memories
Json list(const std::string& memory_store_id, const Query& query = Query()) const;
Walk list_all(const std::string& memory_store_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/memory_stores/{memory_store_id}/memories/{memory_id}
Json get(const std::string& memory_store_id, const std::string& memory_id, const Query& query = Query()) const;
// POST /v1/memory_stores/{memory_store_id}/memories/{memory_id} MUTATES
Json update(const std::string& memory_store_id, const std::string& memory_id, const Json& body, const Query& query = Query()) const;
};
// group memory_stores.memory_versions
class MemoryStoresMemoryVersions : public Resource {
public:
explicit MemoryStoresMemoryVersions(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// GET /v1/memory_stores/{memory_store_id}/memory_versions
Json list(const std::string& memory_store_id, const Query& query = Query()) const;
Walk list_all(const std::string& memory_store_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// POST /v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact DESTRUCTIVE
Json redact(const std::string& memory_store_id, const std::string& memory_version_id) const;
// GET /v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}
Json get(const std::string& memory_store_id, const std::string& memory_version_id, const Query& query = Query()) const;
};
} // namespace molo::anthropic::admin
+99
View File
@@ -0,0 +1,99 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/plugins.h"
namespace molo::anthropic::admin {
Json PluginMarketplaces::list(const Query& query) const {
return do_json(Call::kPluginMarketplacesList, {}, &query, nullptr);
}
Walk PluginMarketplaces::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kPluginMarketplacesList, {}, query, max_pages);
}
Json PluginMarketplaces::get(const std::string& marketplace_id, const Query& query) const {
return do_json(Call::kPluginMarketplacesRetrieve, {marketplace_id}, &query, nullptr);
}
Json PluginMarketplaces::update(const std::string& marketplace_id, const Json& body) const {
return do_json(Call::kPluginMarketplacesUpdate, {marketplace_id}, nullptr, &body);
}
Json PluginMarketplaces::validate_archive(const clients::body::MultipartBody& form) const {
return do_form(Call::kPluginMarketplacesValidateArchive, {}, form);
}
Json PluginMarketplaces::validate_repository(const Json& body) const {
return do_json(Call::kPluginMarketplacesValidateRepository, {}, nullptr, &body);
}
Json Plugins::create(const clients::body::MultipartBody& form) const {
return do_form(Call::kPluginsCreate, {}, form);
}
Json Plugins::destroy(const std::string& plugin_id) const {
return do_json(Call::kPluginsDelete, {plugin_id}, nullptr, nullptr);
}
Json Plugins::list(const Query& query) const {
return do_json(Call::kPluginsList, {}, &query, nullptr);
}
Walk Plugins::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kPluginsList, {}, query, max_pages);
}
Json Plugins::get(const std::string& plugin_id, const Query& query) const {
return do_json(Call::kPluginsRetrieve, {plugin_id}, &query, nullptr);
}
Json Plugins::update(const std::string& plugin_id, const Json& body) const {
return do_json(Call::kPluginsUpdate, {plugin_id}, nullptr, &body);
}
Json PluginsInstallationSettings::list(const std::string& plugin_id, const Query& query) const {
return do_json(Call::kPluginsInstallationSettingsList, {plugin_id}, &query, nullptr);
}
Walk PluginsInstallationSettings::list_all(const std::string& plugin_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kPluginsInstallationSettingsList, {plugin_id}, query, max_pages);
}
Json PluginsInstallationSettings::remove(const std::string& plugin_id, const std::string& target) const {
return do_json(Call::kPluginsInstallationSettingsRemove, {plugin_id, target}, nullptr, nullptr);
}
Json PluginsInstallationSettings::set_limit(const std::string& plugin_id, const std::string& target, const Json& body) const {
return do_json(Call::kPluginsInstallationSettingsSet, {plugin_id, target}, nullptr, &body);
}
Json PluginsShares::list(const std::string& plugin_id, const Query& query) const {
return do_json(Call::kPluginsSharesList, {plugin_id}, &query, nullptr);
}
Walk PluginsShares::list_all(const std::string& plugin_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kPluginsSharesList, {plugin_id}, query, max_pages);
}
Json PluginsVersions::create(const std::string& plugin_id, const clients::body::MultipartBody& form) const {
return do_form(Call::kPluginsVersionsCreate, {plugin_id}, form);
}
llm::RawResponse PluginsVersions::download(const std::string& plugin_id, const std::string& version, const Query& query) const {
return do_raw(Call::kPluginsVersionsDownload, {plugin_id, version}, &query);
}
Json PluginsVersions::list(const std::string& plugin_id, const Query& query) const {
return do_json(Call::kPluginsVersionsList, {plugin_id}, &query, nullptr);
}
Walk PluginsVersions::list_all(const std::string& plugin_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kPluginsVersionsList, {plugin_id}, query, max_pages);
}
Json PluginsVersions::get(const std::string& plugin_id, const std::string& version, const Query& query) const {
return do_json(Call::kPluginsVersionsRetrieve, {plugin_id, version}, &query, nullptr);
}
} // namespace molo::anthropic::admin
+119
View File
@@ -0,0 +1,119 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// plugins calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group plugin_marketplaces
class PluginMarketplaces : public Resource {
public:
explicit PluginMarketplaces(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/plugin_marketplaces
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/plugin_marketplaces/{marketplace_id}
Json get(const std::string& marketplace_id, const Query& query = Query()) const;
// POST /v1/organizations/plugin_marketplaces/{marketplace_id} MUTATES
Json update(const std::string& marketplace_id, const Json& body) const;
// POST /v1/organizations/plugin_marketplaces/validate_archive MUTATES
Json validate_archive(const clients::body::MultipartBody& form) const;
// POST /v1/organizations/plugin_marketplaces/validate_repository MUTATES
Json validate_repository(const Json& body) const;
};
// group plugins
class Plugins : public Resource {
public:
explicit Plugins(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/plugins MUTATES
Json create(const clients::body::MultipartBody& form) const;
// DELETE /v1/organizations/plugins/{plugin_id} DESTRUCTIVE
Json destroy(const std::string& plugin_id) const;
// GET /v1/organizations/plugins
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/plugins/{plugin_id}
Json get(const std::string& plugin_id, const Query& query = Query()) const;
// POST /v1/organizations/plugins/{plugin_id} MUTATES
Json update(const std::string& plugin_id, const Json& body) const;
};
// group plugins.installation_settings
class PluginsInstallationSettings : public Resource {
public:
explicit PluginsInstallationSettings(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/plugins/{plugin_id}/installation_settings
Json list(const std::string& plugin_id, const Query& query = Query()) const;
Walk list_all(const std::string& plugin_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/plugins/{plugin_id}/installation_settings/{target} DESTRUCTIVE
Json remove(const std::string& plugin_id, const std::string& target) const;
// POST /v1/organizations/plugins/{plugin_id}/installation_settings/{target} MUTATES
Json set_limit(const std::string& plugin_id, const std::string& target, const Json& body) const;
};
// group plugins.shares
class PluginsShares : public Resource {
public:
explicit PluginsShares(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/plugins/{plugin_id}/shares
Json list(const std::string& plugin_id, const Query& query = Query()) const;
Walk list_all(const std::string& plugin_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group plugins.versions
class PluginsVersions : public Resource {
public:
explicit PluginsVersions(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/plugins/{plugin_id}/versions MUTATES
Json create(const std::string& plugin_id, const clients::body::MultipartBody& form) const;
// GET /v1/organizations/plugins/{plugin_id}/versions/{version}/content
llm::RawResponse download(const std::string& plugin_id, const std::string& version, const Query& query = Query()) const;
// GET /v1/organizations/plugins/{plugin_id}/versions
Json list(const std::string& plugin_id, const Query& query = Query()) const;
Walk list_all(const std::string& plugin_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/plugins/{plugin_id}/versions/{version}
Json get(const std::string& plugin_id, const std::string& version, const Query& query = Query()) const;
};
} // namespace molo::anthropic::admin
+31
View File
@@ -0,0 +1,31 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/reports.h"
namespace molo::anthropic::admin {
Json CostReports::get(const Query& query) const {
return do_json(Call::kCostReportRetrieve, {}, &query, nullptr);
}
Walk CostReports::get_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kCostReportRetrieve, {}, query, max_pages);
}
Json UsageReports::claude_code(const Query& query) const {
return do_json(Call::kUsageReportRetrieveClaudeCode, {}, &query, nullptr);
}
Walk UsageReports::claude_code_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kUsageReportRetrieveClaudeCode, {}, query, max_pages);
}
Json UsageReports::messages(const Query& query) const {
return do_json(Call::kUsageReportRetrieveMessages, {}, &query, nullptr);
}
Walk UsageReports::messages_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kUsageReportRetrieveMessages, {}, query, max_pages);
}
} // namespace molo::anthropic::admin
+46
View File
@@ -0,0 +1,46 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// reports calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group cost_report
class CostReports : public Resource {
public:
explicit CostReports(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/cost_report
Json get(const Query& query) const;
Walk get_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group usage_report
class UsageReports : public Resource {
public:
explicit UsageReports(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/usage_report/claude_code
Json claude_code(const Query& query) const;
Walk claude_code_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/usage_report/messages
Json messages(const Query& query) const;
Walk messages_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
} // namespace molo::anthropic::admin
+103
View File
@@ -0,0 +1,103 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/sessions.h"
namespace molo::anthropic::admin {
Json Sessions::archive(const std::string& session_id) const {
return do_json(Call::kSessionsArchive, {session_id}, nullptr, nullptr);
}
Json Sessions::create(const Json& body) const {
return do_json(Call::kSessionsCreate, {}, nullptr, &body);
}
Json Sessions::destroy(const std::string& session_id) const {
return do_json(Call::kSessionsDelete, {session_id}, nullptr, nullptr);
}
Json Sessions::list(const Query& query) const {
return do_json(Call::kSessionsList, {}, &query, nullptr);
}
Walk Sessions::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSessionsList, {}, query, max_pages);
}
Json Sessions::get(const std::string& session_id) const {
return do_json(Call::kSessionsRetrieve, {session_id}, nullptr, nullptr);
}
Json Sessions::update(const std::string& session_id, const Json& body) const {
return do_json(Call::kSessionsUpdate, {session_id}, nullptr, &body);
}
Json SessionsEvents::list(const std::string& session_id, const Query& query) const {
return do_json(Call::kSessionsEventsList, {session_id}, &query, nullptr);
}
Walk SessionsEvents::list_all(const std::string& session_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSessionsEventsList, {session_id}, query, max_pages);
}
Json SessionsEvents::send(const std::string& session_id, const Json& body) const {
return do_json(Call::kSessionsEventsSend, {session_id}, nullptr, &body);
}
void SessionsEvents::stream(const std::string& session_id, const EventSink& sink, const Query& query) const {
do_stream(Call::kSessionsEventsStream, {session_id}, &query, sink);
}
Json SessionsResources::add(const std::string& session_id, const Json& body) const {
return do_json(Call::kSessionsResourcesAdd, {session_id}, nullptr, &body);
}
Json SessionsResources::destroy(const std::string& session_id, const std::string& resource_id) const {
return do_json(Call::kSessionsResourcesDelete, {session_id, resource_id}, nullptr, nullptr);
}
Json SessionsResources::list(const std::string& session_id, const Query& query) const {
return do_json(Call::kSessionsResourcesList, {session_id}, &query, nullptr);
}
Walk SessionsResources::list_all(const std::string& session_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSessionsResourcesList, {session_id}, query, max_pages);
}
Json SessionsResources::get(const std::string& session_id, const std::string& resource_id) const {
return do_json(Call::kSessionsResourcesRetrieve, {session_id, resource_id}, nullptr, nullptr);
}
Json SessionsResources::update(const std::string& session_id, const std::string& resource_id, const Json& body) const {
return do_json(Call::kSessionsResourcesUpdate, {session_id, resource_id}, nullptr, &body);
}
Json SessionsThreads::archive(const std::string& session_id, const std::string& thread_id) const {
return do_json(Call::kSessionsThreadsArchive, {session_id, thread_id}, nullptr, nullptr);
}
Json SessionsThreads::list(const std::string& session_id, const Query& query) const {
return do_json(Call::kSessionsThreadsList, {session_id}, &query, nullptr);
}
Walk SessionsThreads::list_all(const std::string& session_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSessionsThreadsList, {session_id}, query, max_pages);
}
Json SessionsThreads::get(const std::string& session_id, const std::string& thread_id) const {
return do_json(Call::kSessionsThreadsRetrieve, {session_id, thread_id}, nullptr, nullptr);
}
Json SessionsThreadsEvents::list(const std::string& session_id, const std::string& thread_id, const Query& query) const {
return do_json(Call::kSessionsThreadsEventsList, {session_id, thread_id}, &query, nullptr);
}
Walk SessionsThreadsEvents::list_all(const std::string& session_id, const std::string& thread_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSessionsThreadsEventsList, {session_id, thread_id}, query, max_pages);
}
void SessionsThreadsEvents::stream(const std::string& session_id, const std::string& thread_id, const EventSink& sink, const Query& query) const {
do_stream(Call::kSessionsThreadsEventsStream, {session_id, thread_id}, &query, sink);
}
} // namespace molo::anthropic::admin
+122
View File
@@ -0,0 +1,122 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// sessions calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group sessions
class Sessions : public Resource {
public:
explicit Sessions(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/sessions/{session_id}/archive DESTRUCTIVE
Json archive(const std::string& session_id) const;
// POST /v1/sessions MUTATES
Json create(const Json& body) const;
// DELETE /v1/sessions/{session_id} DESTRUCTIVE
Json destroy(const std::string& session_id) const;
// GET /v1/sessions
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/sessions/{session_id}
Json get(const std::string& session_id) const;
// POST /v1/sessions/{session_id} MUTATES
Json update(const std::string& session_id, const Json& body) const;
};
// group sessions.events
class SessionsEvents : public Resource {
public:
explicit SessionsEvents(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// GET /v1/sessions/{session_id}/events
Json list(const std::string& session_id, const Query& query = Query()) const;
Walk list_all(const std::string& session_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// POST /v1/sessions/{session_id}/events MUTATES
Json send(const std::string& session_id, const Json& body) const;
// GET /v1/sessions/{session_id}/events/stream
void stream(const std::string& session_id, const EventSink& sink, const Query& query = Query()) const;
};
// group sessions.resources
class SessionsResources : public Resource {
public:
explicit SessionsResources(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/sessions/{session_id}/resources MUTATES
Json add(const std::string& session_id, const Json& body) const;
// DELETE /v1/sessions/{session_id}/resources/{resource_id} DESTRUCTIVE
Json destroy(const std::string& session_id, const std::string& resource_id) const;
// GET /v1/sessions/{session_id}/resources
Json list(const std::string& session_id, const Query& query = Query()) const;
Walk list_all(const std::string& session_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/sessions/{session_id}/resources/{resource_id}
Json get(const std::string& session_id, const std::string& resource_id) const;
// POST /v1/sessions/{session_id}/resources/{resource_id} MUTATES
Json update(const std::string& session_id, const std::string& resource_id, const Json& body) const;
};
// group sessions.threads
class SessionsThreads : public Resource {
public:
explicit SessionsThreads(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/sessions/{session_id}/threads/{thread_id}/archive DESTRUCTIVE
Json archive(const std::string& session_id, const std::string& thread_id) const;
// GET /v1/sessions/{session_id}/threads
Json list(const std::string& session_id, const Query& query = Query()) const;
Walk list_all(const std::string& session_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/sessions/{session_id}/threads/{thread_id}
Json get(const std::string& session_id, const std::string& thread_id) const;
};
// group sessions.threads.events
class SessionsThreadsEvents : public Resource {
public:
explicit SessionsThreadsEvents(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// GET /v1/sessions/{session_id}/threads/{thread_id}/events
Json list(const std::string& session_id, const std::string& thread_id, const Query& query = Query()) const;
Walk list_all(const std::string& session_id, const std::string& thread_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/sessions/{session_id}/threads/{thread_id}/stream
void stream(const std::string& session_id, const std::string& thread_id, const EventSink& sink, const Query& query = Query()) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,55 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/spend_limits.h"
namespace molo::anthropic::admin {
Json SpendLimits::destroy(const std::string& spend_limit_id) const {
return do_json(Call::kSpendLimitsDelete, {spend_limit_id}, nullptr, nullptr);
}
Json SpendLimits::list(const Query& query) const {
return do_json(Call::kSpendLimitsList, {}, &query, nullptr);
}
Walk SpendLimits::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSpendLimitsList, {}, query, max_pages);
}
Json SpendLimits::get(const std::string& spend_limit_id) const {
return do_json(Call::kSpendLimitsRetrieve, {spend_limit_id}, nullptr, nullptr);
}
Json SpendLimits::set_limit(const Json& body) const {
return do_json(Call::kSpendLimitsSet, {}, nullptr, &body);
}
Json SpendLimitsEffective::list(const Query& query) const {
return do_json(Call::kSpendLimitsEffectiveList, {}, &query, nullptr);
}
Walk SpendLimitsEffective::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSpendLimitsEffectiveList, {}, query, max_pages);
}
Json SpendLimitsIncreaseRequests::approve(const std::string& spend_limit_increase_request_id, const Json& body) const {
return do_json(Call::kSpendLimitsIncreaseRequestsApprove, {spend_limit_increase_request_id}, nullptr, &body);
}
Json SpendLimitsIncreaseRequests::deny(const std::string& spend_limit_increase_request_id, const Json& body) const {
return do_json(Call::kSpendLimitsIncreaseRequestsDeny, {spend_limit_increase_request_id}, nullptr, &body);
}
Json SpendLimitsIncreaseRequests::list(const Query& query) const {
return do_json(Call::kSpendLimitsIncreaseRequestsList, {}, &query, nullptr);
}
Walk SpendLimitsIncreaseRequests::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kSpendLimitsIncreaseRequestsList, {}, query, max_pages);
}
Json SpendLimitsIncreaseRequests::get(const std::string& spend_limit_increase_request_id) const {
return do_json(Call::kSpendLimitsIncreaseRequestsRetrieve, {spend_limit_increase_request_id}, nullptr, nullptr);
}
} // namespace molo::anthropic::admin
@@ -0,0 +1,72 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// spend_limits calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group spend_limits
class SpendLimits : public Resource {
public:
explicit SpendLimits(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// DELETE /v1/organizations/spend_limits/{spend_limit_id} DESTRUCTIVE
Json destroy(const std::string& spend_limit_id) const;
// GET /v1/organizations/spend_limits
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/spend_limits/{spend_limit_id}
Json get(const std::string& spend_limit_id) const;
// POST /v1/organizations/spend_limits MUTATES
Json set_limit(const Json& body) const;
};
// group spend_limits.effective
class SpendLimitsEffective : public Resource {
public:
explicit SpendLimitsEffective(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/spend_limits/effective
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
};
// group spend_limits.increase_requests
class SpendLimitsIncreaseRequests : public Resource {
public:
explicit SpendLimitsIncreaseRequests(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve DESTRUCTIVE
Json approve(const std::string& spend_limit_increase_request_id, const Json& body) const;
// POST /v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/deny DESTRUCTIVE
Json deny(const std::string& spend_limit_increase_request_id, const Json& body) const;
// GET /v1/organizations/spend_limit_increase_requests
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}
Json get(const std::string& spend_limit_increase_request_id) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,79 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/telemetry.h"
namespace molo::anthropic::admin {
Json TelemetryDestinations::create(const Json& body) const {
return do_json(Call::kTelemetryDestinationsCreate, {}, nullptr, &body);
}
Json TelemetryDestinations::destroy(const std::string& destination_id) const {
return do_json(Call::kTelemetryDestinationsDelete, {destination_id}, nullptr, nullptr);
}
Json TelemetryDestinations::list(const Query& query) const {
return do_json(Call::kTelemetryDestinationsList, {}, &query, nullptr);
}
Walk TelemetryDestinations::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kTelemetryDestinationsList, {}, query, max_pages);
}
Json TelemetryDestinations::get(const std::string& destination_id) const {
return do_json(Call::kTelemetryDestinationsRetrieve, {destination_id}, nullptr, nullptr);
}
Json TelemetryDestinations::test(const std::string& destination_id) const {
return do_json(Call::kTelemetryDestinationsTest, {destination_id}, nullptr, nullptr);
}
Json TelemetryDestinations::update(const std::string& destination_id, const Json& body) const {
return do_json(Call::kTelemetryDestinationsUpdate, {destination_id}, nullptr, &body);
}
Json TelemetryDestinationsWorkspaces::add(const std::string& destination_id, const std::string& workspace_id) const {
return do_json(Call::kTelemetryDestinationsWorkspacesAdd, {destination_id, workspace_id}, nullptr, nullptr);
}
Json TelemetryDestinationsWorkspaces::list(const std::string& destination_id, const Query& query) const {
return do_json(Call::kTelemetryDestinationsWorkspacesList, {destination_id}, &query, nullptr);
}
Walk TelemetryDestinationsWorkspaces::list_all(const std::string& destination_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kTelemetryDestinationsWorkspacesList, {destination_id}, query, max_pages);
}
Json TelemetryDestinationsWorkspaces::remove(const std::string& destination_id, const std::string& workspace_id) const {
return do_json(Call::kTelemetryDestinationsWorkspacesRemove, {destination_id, workspace_id}, nullptr, nullptr);
}
Json Webhooks::create(const Json& body) const {
return do_json(Call::kWebhooksCreate, {}, nullptr, &body);
}
Json Webhooks::destroy(const std::string& webhook_endpoint_id) const {
return do_json(Call::kWebhooksDelete, {webhook_endpoint_id}, nullptr, nullptr);
}
Json Webhooks::list(const Query& query) const {
return do_json(Call::kWebhooksList, {}, &query, nullptr);
}
Walk Webhooks::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kWebhooksList, {}, query, max_pages);
}
Json Webhooks::regenerate_signing_secret(const std::string& webhook_endpoint_id) const {
return do_json(Call::kWebhooksRegenerateSigningSecret, {webhook_endpoint_id}, nullptr, nullptr);
}
Json Webhooks::get(const std::string& webhook_endpoint_id) const {
return do_json(Call::kWebhooksRetrieve, {webhook_endpoint_id}, nullptr, nullptr);
}
Json Webhooks::update(const std::string& webhook_endpoint_id, const Json& body) const {
return do_json(Call::kWebhooksUpdate, {webhook_endpoint_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
+90
View File
@@ -0,0 +1,90 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// telemetry calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group telemetry_destinations
class TelemetryDestinations : public Resource {
public:
explicit TelemetryDestinations(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/telemetry_destinations MUTATES
Json create(const Json& body) const;
// DELETE /v1/organizations/telemetry_destinations/{destination_id} DESTRUCTIVE
Json destroy(const std::string& destination_id) const;
// GET /v1/organizations/telemetry_destinations
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/telemetry_destinations/{destination_id}
Json get(const std::string& destination_id) const;
// POST /v1/organizations/telemetry_destinations/{destination_id}/test MUTATES
Json test(const std::string& destination_id) const;
// POST /v1/organizations/telemetry_destinations/{destination_id} MUTATES
Json update(const std::string& destination_id, const Json& body) const;
};
// group telemetry_destinations.workspaces
class TelemetryDestinationsWorkspaces : public Resource {
public:
explicit TelemetryDestinationsWorkspaces(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id} MUTATES
Json add(const std::string& destination_id, const std::string& workspace_id) const;
// GET /v1/organizations/telemetry_destinations/{destination_id}/workspaces
Json list(const std::string& destination_id, const Query& query = Query()) const;
Walk list_all(const std::string& destination_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/telemetry_destinations/{destination_id}/workspaces/{workspace_id} DESTRUCTIVE
Json remove(const std::string& destination_id, const std::string& workspace_id) const;
};
// group webhooks
class Webhooks : public Resource {
public:
explicit Webhooks(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/webhooks MUTATES
Json create(const Json& body) const;
// DELETE /v1/organizations/webhooks/{webhook_endpoint_id} DESTRUCTIVE
Json destroy(const std::string& webhook_endpoint_id) const;
// GET /v1/organizations/webhooks
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// POST /v1/organizations/webhooks/{webhook_endpoint_id}/regenerate_signing_secret DESTRUCTIVE
Json regenerate_signing_secret(const std::string& webhook_endpoint_id) const;
// GET /v1/organizations/webhooks/{webhook_endpoint_id}
Json get(const std::string& webhook_endpoint_id) const;
// POST /v1/organizations/webhooks/{webhook_endpoint_id} MUTATES
Json update(const std::string& webhook_endpoint_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
+99
View File
@@ -0,0 +1,99 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/tunnels.h"
namespace molo::anthropic::admin {
Json McpTunnels::archive(const std::string& tunnel_id) const {
return do_json(Call::kMcpTunnelsArchive, {tunnel_id}, nullptr, nullptr);
}
Json McpTunnels::list(const Query& query) const {
return do_json(Call::kMcpTunnelsList, {}, &query, nullptr);
}
Walk McpTunnels::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kMcpTunnelsList, {}, query, max_pages);
}
Json McpTunnels::get(const std::string& tunnel_id) const {
return do_json(Call::kMcpTunnelsRetrieve, {tunnel_id}, nullptr, nullptr);
}
Json McpTunnels::reveal_token(const std::string& tunnel_id) const {
return do_json(Call::kMcpTunnelsRevealToken, {tunnel_id}, nullptr, nullptr);
}
Json McpTunnels::rotate_token(const std::string& tunnel_id, const Json& body) const {
return do_json(Call::kMcpTunnelsRotateToken, {tunnel_id}, nullptr, &body);
}
Json McpTunnelCertificates::archive(const std::string& tunnel_id, const std::string& certificate_id) const {
return do_json(Call::kMcpTunnelsCertificatesArchive, {tunnel_id, certificate_id}, nullptr, nullptr);
}
Json McpTunnelCertificates::create(const std::string& tunnel_id, const Json& body) const {
return do_json(Call::kMcpTunnelsCertificatesCreate, {tunnel_id}, nullptr, &body);
}
Json McpTunnelCertificates::list(const std::string& tunnel_id, const Query& query) const {
return do_json(Call::kMcpTunnelsCertificatesList, {tunnel_id}, &query, nullptr);
}
Walk McpTunnelCertificates::list_all(const std::string& tunnel_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kMcpTunnelsCertificatesList, {tunnel_id}, query, max_pages);
}
Json McpTunnelCertificates::get(const std::string& tunnel_id, const std::string& certificate_id) const {
return do_json(Call::kMcpTunnelsCertificatesRetrieve, {tunnel_id, certificate_id}, nullptr, nullptr);
}
Json Tunnels::archive(const std::string& tunnel_id) const {
return do_json(Call::kTunnelsArchive, {tunnel_id}, nullptr, nullptr);
}
Json Tunnels::create(const Json& body) const {
return do_json(Call::kTunnelsCreate, {}, nullptr, &body);
}
Json Tunnels::list(const Query& query) const {
return do_json(Call::kTunnelsList, {}, &query, nullptr);
}
Walk Tunnels::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kTunnelsList, {}, query, max_pages);
}
Json Tunnels::get(const std::string& tunnel_id) const {
return do_json(Call::kTunnelsRetrieve, {tunnel_id}, nullptr, nullptr);
}
Json Tunnels::reveal_token(const std::string& tunnel_id) const {
return do_json(Call::kTunnelsRevealToken, {tunnel_id}, nullptr, nullptr);
}
Json Tunnels::rotate_token(const std::string& tunnel_id, const Json& body) const {
return do_json(Call::kTunnelsRotateToken, {tunnel_id}, nullptr, &body);
}
Json TunnelsCertificates::archive(const std::string& tunnel_id, const std::string& certificate_id) const {
return do_json(Call::kTunnelsCertificatesArchive, {tunnel_id, certificate_id}, nullptr, nullptr);
}
Json TunnelsCertificates::create(const std::string& tunnel_id, const Json& body) const {
return do_json(Call::kTunnelsCertificatesCreate, {tunnel_id}, nullptr, &body);
}
Json TunnelsCertificates::list(const std::string& tunnel_id, const Query& query) const {
return do_json(Call::kTunnelsCertificatesList, {tunnel_id}, &query, nullptr);
}
Walk TunnelsCertificates::list_all(const std::string& tunnel_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kTunnelsCertificatesList, {tunnel_id}, query, max_pages);
}
Json TunnelsCertificates::get(const std::string& tunnel_id, const std::string& certificate_id) const {
return do_json(Call::kTunnelsCertificatesRetrieve, {tunnel_id, certificate_id}, nullptr, nullptr);
}
} // namespace molo::anthropic::admin
+112
View File
@@ -0,0 +1,112 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// tunnels calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group mcp_tunnels
class McpTunnels : public Resource {
public:
explicit McpTunnels(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/tunnels/{tunnel_id}/archive DESTRUCTIVE
Json archive(const std::string& tunnel_id) const;
// GET /v1/organizations/tunnels
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/tunnels/{tunnel_id}
Json get(const std::string& tunnel_id) const;
// POST /v1/organizations/tunnels/{tunnel_id}/reveal_token RETURNS A SECRET
Json reveal_token(const std::string& tunnel_id) const;
// POST /v1/organizations/tunnels/{tunnel_id}/rotate_token DESTRUCTIVE
Json rotate_token(const std::string& tunnel_id, const Json& body) const;
};
// group mcp_tunnels.certificates
class McpTunnelCertificates : public Resource {
public:
explicit McpTunnelCertificates(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}/archive DESTRUCTIVE
Json archive(const std::string& tunnel_id, const std::string& certificate_id) const;
// POST /v1/organizations/tunnels/{tunnel_id}/certificates MUTATES
Json create(const std::string& tunnel_id, const Json& body) const;
// GET /v1/organizations/tunnels/{tunnel_id}/certificates
Json list(const std::string& tunnel_id, const Query& query = Query()) const;
Walk list_all(const std::string& tunnel_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}
Json get(const std::string& tunnel_id, const std::string& certificate_id) const;
};
// group tunnels
class Tunnels : public Resource {
public:
explicit Tunnels(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/tunnels/{tunnel_id}/archive DESTRUCTIVE
Json archive(const std::string& tunnel_id) const;
// POST /v1/tunnels MUTATES
Json create(const Json& body) const;
// GET /v1/tunnels
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/tunnels/{tunnel_id}
Json get(const std::string& tunnel_id) const;
// POST /v1/tunnels/{tunnel_id}/reveal_token RETURNS A SECRET
Json reveal_token(const std::string& tunnel_id) const;
// POST /v1/tunnels/{tunnel_id}/rotate_token DESTRUCTIVE
Json rotate_token(const std::string& tunnel_id, const Json& body) const;
};
// group tunnels.certificates
class TunnelsCertificates : public Resource {
public:
explicit TunnelsCertificates(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive DESTRUCTIVE
Json archive(const std::string& tunnel_id, const std::string& certificate_id) const;
// POST /v1/tunnels/{tunnel_id}/certificates MUTATES
Json create(const std::string& tunnel_id, const Json& body) const;
// GET /v1/tunnels/{tunnel_id}/certificates
Json list(const std::string& tunnel_id, const Query& query = Query()) const;
Walk list_all(const std::string& tunnel_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/tunnels/{tunnel_id}/certificates/{certificate_id}
Json get(const std::string& tunnel_id, const std::string& certificate_id) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,67 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/user_profiles.h"
namespace molo::anthropic::admin {
Json UserProfiles::create(const Json& body) const {
return do_json(Call::kUserProfilesCreate, {}, nullptr, &body);
}
Json UserProfiles::createBeta(const Json& body) const {
return do_json(Call::kUserProfilesCreateBeta, {}, nullptr, &body);
}
Json UserProfiles::create_enrollment_url(const std::string& user_profile_id) const {
return do_json(Call::kUserProfilesCreateEnrollmentUrl, {user_profile_id}, nullptr, nullptr);
}
Json UserProfiles::destroy(const std::string& user_profile_id) const {
return do_json(Call::kUserProfilesDelete, {user_profile_id}, nullptr, nullptr);
}
Json UserProfiles::destroyBeta(const std::string& user_profile_id) const {
return do_json(Call::kUserProfilesDeleteBeta, {user_profile_id}, nullptr, nullptr);
}
Json UserProfiles::list(const Query& query) const {
return do_json(Call::kUserProfilesList, {}, &query, nullptr);
}
Walk UserProfiles::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kUserProfilesList, {}, query, max_pages);
}
Json UserProfiles::listBeta(const Query& query) const {
return do_json(Call::kUserProfilesListBeta, {}, &query, nullptr);
}
Walk UserProfiles::listBeta_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kUserProfilesListBeta, {}, query, max_pages);
}
Json UserProfiles::get(const std::string& user_profile_id) const {
return do_json(Call::kUserProfilesRetrieve, {user_profile_id}, nullptr, nullptr);
}
Json UserProfiles::getBeta(const std::string& user_profile_id) const {
return do_json(Call::kUserProfilesRetrieveBeta, {user_profile_id}, nullptr, nullptr);
}
Json UserProfiles::update(const std::string& user_profile_id, const Json& body) const {
return do_json(Call::kUserProfilesUpdate, {user_profile_id}, nullptr, &body);
}
Json UserProfiles::updateBeta(const std::string& user_profile_id, const Json& body) const {
return do_json(Call::kUserProfilesUpdateBeta, {user_profile_id}, nullptr, &body);
}
Json UserProfilesActionUrls::create(const std::string& user_profile_id, const Json& body) const {
return do_json(Call::kUserProfilesActionUrlsCreate, {user_profile_id}, nullptr, &body);
}
Json UserProfilesActionUrls::createBeta(const std::string& user_profile_id, const Json& body) const {
return do_json(Call::kUserProfilesActionUrlsCreateBeta, {user_profile_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
@@ -0,0 +1,74 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// user_profiles calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group user_profiles
class UserProfiles : public Resource {
public:
explicit UserProfiles(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/user_profiles MUTATES
Json create(const Json& body) const;
// POST /v1/user_profiles MUTATES
Json createBeta(const Json& body) const;
// POST /v1/user_profiles/{user_profile_id}/enrollment_url MUTATES
Json create_enrollment_url(const std::string& user_profile_id) const;
// DELETE /v1/user_profiles/{user_profile_id} DESTRUCTIVE
Json destroy(const std::string& user_profile_id) const;
// DELETE /v1/user_profiles/{user_profile_id} DESTRUCTIVE
Json destroyBeta(const std::string& user_profile_id) const;
// GET /v1/user_profiles
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/user_profiles
Json listBeta(const Query& query = Query()) const;
Walk listBeta_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/user_profiles/{user_profile_id}
Json get(const std::string& user_profile_id) const;
// GET /v1/user_profiles/{user_profile_id}
Json getBeta(const std::string& user_profile_id) const;
// POST /v1/user_profiles/{user_profile_id} MUTATES
Json update(const std::string& user_profile_id, const Json& body) const;
// POST /v1/user_profiles/{user_profile_id} MUTATES
Json updateBeta(const std::string& user_profile_id, const Json& body) const;
};
// group user_profiles.action_urls
class UserProfilesActionUrls : public Resource {
public:
explicit UserProfilesActionUrls(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/user_profiles/{user_profile_id}/action_urls MUTATES
Json create(const std::string& user_profile_id, const Json& body) const;
// POST /v1/user_profiles/{user_profile_id}/action_urls MUTATES
Json createBeta(const std::string& user_profile_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
+67
View File
@@ -0,0 +1,67 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/vaults.h"
namespace molo::anthropic::admin {
Json Vaults::archive(const std::string& vault_id) const {
return do_json(Call::kVaultsArchive, {vault_id}, nullptr, nullptr);
}
Json Vaults::create(const Json& body) const {
return do_json(Call::kVaultsCreate, {}, nullptr, &body);
}
Json Vaults::destroy(const std::string& vault_id) const {
return do_json(Call::kVaultsDelete, {vault_id}, nullptr, nullptr);
}
Json Vaults::list(const Query& query) const {
return do_json(Call::kVaultsList, {}, &query, nullptr);
}
Walk Vaults::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kVaultsList, {}, query, max_pages);
}
Json Vaults::get(const std::string& vault_id) const {
return do_json(Call::kVaultsRetrieve, {vault_id}, nullptr, nullptr);
}
Json Vaults::update(const std::string& vault_id, const Json& body) const {
return do_json(Call::kVaultsUpdate, {vault_id}, nullptr, &body);
}
Json VaultsCredentials::archive(const std::string& vault_id, const std::string& credential_id) const {
return do_json(Call::kVaultsCredentialsArchive, {vault_id, credential_id}, nullptr, nullptr);
}
Json VaultsCredentials::create(const std::string& vault_id, const Json& body) const {
return do_json(Call::kVaultsCredentialsCreate, {vault_id}, nullptr, &body);
}
Json VaultsCredentials::destroy(const std::string& vault_id, const std::string& credential_id) const {
return do_json(Call::kVaultsCredentialsDelete, {vault_id, credential_id}, nullptr, nullptr);
}
Json VaultsCredentials::list(const std::string& vault_id, const Query& query) const {
return do_json(Call::kVaultsCredentialsList, {vault_id}, &query, nullptr);
}
Walk VaultsCredentials::list_all(const std::string& vault_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kVaultsCredentialsList, {vault_id}, query, max_pages);
}
Json VaultsCredentials::mcp_oauth_validate(const std::string& vault_id, const std::string& credential_id) const {
return do_json(Call::kVaultsCredentialsMcpOauthValidate, {vault_id, credential_id}, nullptr, nullptr);
}
Json VaultsCredentials::get(const std::string& vault_id, const std::string& credential_id) const {
return do_json(Call::kVaultsCredentialsRetrieve, {vault_id, credential_id}, nullptr, nullptr);
}
Json VaultsCredentials::update(const std::string& vault_id, const std::string& credential_id, const Json& body) const {
return do_json(Call::kVaultsCredentialsUpdate, {vault_id, credential_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
+74
View File
@@ -0,0 +1,74 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// vaults calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group vaults
class Vaults : public Resource {
public:
explicit Vaults(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/vaults/{vault_id}/archive DESTRUCTIVE
Json archive(const std::string& vault_id) const;
// POST /v1/vaults MUTATES
Json create(const Json& body) const;
// DELETE /v1/vaults/{vault_id} DESTRUCTIVE
Json destroy(const std::string& vault_id) const;
// GET /v1/vaults
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/vaults/{vault_id}
Json get(const std::string& vault_id) const;
// POST /v1/vaults/{vault_id} MUTATES
Json update(const std::string& vault_id, const Json& body) const;
};
// group vaults.credentials
class VaultsCredentials : public Resource {
public:
explicit VaultsCredentials(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kPlatform) {}
// POST /v1/vaults/{vault_id}/credentials/{credential_id}/archive DESTRUCTIVE
Json archive(const std::string& vault_id, const std::string& credential_id) const;
// POST /v1/vaults/{vault_id}/credentials MUTATES
Json create(const std::string& vault_id, const Json& body) const;
// DELETE /v1/vaults/{vault_id}/credentials/{credential_id} DESTRUCTIVE
Json destroy(const std::string& vault_id, const std::string& credential_id) const;
// GET /v1/vaults/{vault_id}/credentials
Json list(const std::string& vault_id, const Query& query = Query()) const;
Walk list_all(const std::string& vault_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// POST /v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate MUTATES
Json mcp_oauth_validate(const std::string& vault_id, const std::string& credential_id) const;
// GET /v1/vaults/{vault_id}/credentials/{credential_id}
Json get(const std::string& vault_id, const std::string& credential_id) const;
// POST /v1/vaults/{vault_id}/credentials/{credential_id} MUTATES
Json update(const std::string& vault_id, const std::string& credential_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
@@ -0,0 +1,91 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#include "anthropic/admin/services/workspaces.h"
namespace molo::anthropic::admin {
Json Workspaces::archive(const std::string& workspace_id) const {
return do_json(Call::kWorkspacesArchive, {workspace_id}, nullptr, nullptr);
}
Json Workspaces::create(const Json& body) const {
return do_json(Call::kWorkspacesCreate, {}, nullptr, &body);
}
Json Workspaces::list(const Query& query) const {
return do_json(Call::kWorkspacesList, {}, &query, nullptr);
}
Walk Workspaces::list_all(const Query& query, std::size_t max_pages) const {
return do_walk(Call::kWorkspacesList, {}, query, max_pages);
}
Json Workspaces::get(const std::string& workspace_id) const {
return do_json(Call::kWorkspacesRetrieve, {workspace_id}, nullptr, nullptr);
}
Json Workspaces::update(const std::string& workspace_id, const Json& body) const {
return do_json(Call::kWorkspacesUpdate, {workspace_id}, nullptr, &body);
}
Json WorkspaceMembers::add(const std::string& workspace_id, const Json& body) const {
return do_json(Call::kWorkspacesMembersAdd, {workspace_id}, nullptr, &body);
}
Json WorkspaceMembers::list(const std::string& workspace_id, const Query& query) const {
return do_json(Call::kWorkspacesMembersList, {workspace_id}, &query, nullptr);
}
Walk WorkspaceMembers::list_all(const std::string& workspace_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kWorkspacesMembersList, {workspace_id}, query, max_pages);
}
Json WorkspaceMembers::remove(const std::string& workspace_id, const std::string& user_id) const {
return do_json(Call::kWorkspacesMembersRemove, {workspace_id, user_id}, nullptr, nullptr);
}
Json WorkspaceMembers::get(const std::string& workspace_id, const std::string& user_id) const {
return do_json(Call::kWorkspacesMembersRetrieve, {workspace_id, user_id}, nullptr, nullptr);
}
Json WorkspaceMembers::update(const std::string& workspace_id, const std::string& user_id, const Json& body) const {
return do_json(Call::kWorkspacesMembersUpdate, {workspace_id, user_id}, nullptr, &body);
}
Json WorkspaceRateLimits::list(const std::string& workspace_id, const Query& query) const {
return do_json(Call::kWorkspacesRateLimitsList, {workspace_id}, &query, nullptr);
}
Walk WorkspaceRateLimits::list_all(const std::string& workspace_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kWorkspacesRateLimitsList, {workspace_id}, query, max_pages);
}
Json WorkspaceRateLimits::update(const std::string& workspace_id, const std::string& rate_limit_id, const Json& body) const {
return do_json(Call::kWorkspacesRateLimitsUpdate, {workspace_id, rate_limit_id}, nullptr, &body);
}
Json WorkspaceServiceAccounts::add(const std::string& workspace_id, const Json& body) const {
return do_json(Call::kWorkspacesServiceAccountsAdd, {workspace_id}, nullptr, &body);
}
Json WorkspaceServiceAccounts::list(const std::string& workspace_id, const Query& query) const {
return do_json(Call::kWorkspacesServiceAccountsList, {workspace_id}, &query, nullptr);
}
Walk WorkspaceServiceAccounts::list_all(const std::string& workspace_id, const Query& query, std::size_t max_pages) const {
return do_walk(Call::kWorkspacesServiceAccountsList, {workspace_id}, query, max_pages);
}
Json WorkspaceServiceAccounts::remove(const std::string& workspace_id, const std::string& service_account_id) const {
return do_json(Call::kWorkspacesServiceAccountsRemove, {workspace_id, service_account_id}, nullptr, nullptr);
}
Json WorkspaceServiceAccounts::get(const std::string& workspace_id, const std::string& service_account_id) const {
return do_json(Call::kWorkspacesServiceAccountsRetrieve, {workspace_id, service_account_id}, nullptr, nullptr);
}
Json WorkspaceServiceAccounts::update(const std::string& workspace_id, const std::string& service_account_id, const Json& body) const {
return do_json(Call::kWorkspacesServiceAccountsUpdate, {workspace_id, service_account_id}, nullptr, &body);
}
} // namespace molo::anthropic::admin
+106
View File
@@ -0,0 +1,106 @@
// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:
// the table is verified against the SDK source and the reference pages.
#pragma once
// workspaces calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
// group workspaces
class Workspaces : public Resource {
public:
explicit Workspaces(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/workspaces/{workspace_id}/archive DESTRUCTIVE
Json archive(const std::string& workspace_id) const;
// POST /v1/organizations/workspaces MUTATES
Json create(const Json& body) const;
// GET /v1/organizations/workspaces
Json list(const Query& query = Query()) const;
Walk list_all(const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// GET /v1/organizations/workspaces/{workspace_id}
Json get(const std::string& workspace_id) const;
// POST /v1/organizations/workspaces/{workspace_id} MUTATES
Json update(const std::string& workspace_id, const Json& body) const;
};
// group workspaces.members
class WorkspaceMembers : public Resource {
public:
explicit WorkspaceMembers(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// POST /v1/organizations/workspaces/{workspace_id}/members MUTATES
Json add(const std::string& workspace_id, const Json& body) const;
// GET /v1/organizations/workspaces/{workspace_id}/members
Json list(const std::string& workspace_id, const Query& query = Query()) const;
Walk list_all(const std::string& workspace_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/workspaces/{workspace_id}/members/{user_id} DESTRUCTIVE
Json remove(const std::string& workspace_id, const std::string& user_id) const;
// GET /v1/organizations/workspaces/{workspace_id}/members/{user_id}
Json get(const std::string& workspace_id, const std::string& user_id) const;
// POST /v1/organizations/workspaces/{workspace_id}/members/{user_id} MUTATES
Json update(const std::string& workspace_id, const std::string& user_id, const Json& body) const;
};
// group workspaces.rate_limits
class WorkspaceRateLimits : public Resource {
public:
explicit WorkspaceRateLimits(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kAdmin) {}
// GET /v1/organizations/workspaces/{workspace_id}/rate_limits
Json list(const std::string& workspace_id, const Query& query = Query()) const;
Walk list_all(const std::string& workspace_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// POST /v1/organizations/workspaces/{workspace_id}/rate_limits/{rate_limit_id} MUTATES
Json update(const std::string& workspace_id, const std::string& rate_limit_id, const Json& body) const;
};
// group workspaces.service_accounts
class WorkspaceServiceAccounts : public Resource {
public:
explicit WorkspaceServiceAccounts(std::shared_ptr<Gateway> gateway)
: Resource(std::move(gateway), Auth::kOAuth) {}
// POST /v1/organizations/workspaces/{workspace_id}/service_accounts MUTATES
Json add(const std::string& workspace_id, const Json& body) const;
// GET /v1/organizations/workspaces/{workspace_id}/service_accounts
Json list(const std::string& workspace_id, const Query& query = Query()) const;
Walk list_all(const std::string& workspace_id, const Query& query = Query(), std::size_t max_pages = Caps::kMaxPages) const;
// DELETE /v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id} DESTRUCTIVE
Json remove(const std::string& workspace_id, const std::string& service_account_id) const;
// GET /v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id}
Json get(const std::string& workspace_id, const std::string& service_account_id) const;
// POST /v1/organizations/workspaces/{workspace_id}/service_accounts/{service_account_id} MUTATES
Json update(const std::string& workspace_id, const std::string& service_account_id, const Json& body) const;
};
} // namespace molo::anthropic::admin
+939
View File
@@ -0,0 +1,939 @@
#!/usr/bin/env python3
"""Check (and regenerate) the Anthropic admin call table against its sources.
Anthropic does not publish an OpenAPI document any more: the official SDKs
carry a `.stats.yml` with `configured_endpoints` only, no `openapi_spec_url`
(read 2026-10-24, python SDK commit pinned below). The machine-readable
sources used instead are, in order of authority:
1. the official Python SDK source at a pinned commit: every resource method
(HTTP verb, path, body keys, query keys, header params, beta header,
pagination class, return type) and the TypedDict `*_params.py` files;
2. the published API reference pages (platform.claude.com/docs/en/api/**.md):
`**VERB** path`, path, query, body parameters and the credential note;
3. the Claude Tag guide for the endpoints that have no reference page yet.
Three operations are documented but absent from every SDK (messages usage
report, Claude Code usage report, cost report) and the organization-level MCP
tunnel views: they are "docs only" rows, listed in DOCS_ONLY below.
python3 -I src/anthropic/admin/tools/check_spec.py # verify
python3 -I src/anthropic/admin/tools/check_spec.py --emit # regenerate
Verify fails (exit 1) when
* a committed generated file differs from what the sources generate now;
* a table row disagrees with the SDK (verb, path, fields, required, query,
headers, beta header, pagination) or with its reference page (verb, path,
every body / query parameter, credential class);
* an SDK operation is neither in the table nor in EXCLUDED (the Messages,
Batches, Models, Files and Skills families belong to src/anthropic/core).
Python 3 stdlib only. No credentials. Network: codeload.github.com (SDK
tarball, one request) and platform.claude.com (reference pages).
`--sdk-tar FILE` and `--pages-dir DIR` reuse local copies (the pages dir is
filled when missing).
"""
import ast
import concurrent.futures as cf
import io
import os
import re
import sys
import tarfile
import urllib.request
HERE = os.path.dirname(os.path.abspath(__file__))
ADMIN = os.path.abspath(os.path.join(HERE, ".."))
SDK_SHA = "202db72c87d7c6eaa72129c67ce67fd343a3a20c" # anthropic-sdk-python 2.3.0
SDK_URL = "https://codeload.github.com/anthropics/anthropic-sdk-python/tar.gz/" + SDK_SHA
DOCS_URL = "https://platform.claude.com/docs/en/%s.md"
UA = {"User-Agent": "curl/8.5.0"}
# SDK resource files (relative to src/anthropic/resources) owned by this package.
SCOPES = ["organization", "user_profiles", "beta/organization", "beta/agents", "beta/environments",
"beta/sessions", "beta/vaults", "beta/memory_stores", "beta/tunnels", "beta/user_profiles",
"beta/deployments.py", "beta/deployment_runs.py", "beta/dreams.py"]
# Everything else in the SDK belongs to src/anthropic/core (or has no endpoint).
EXCLUDED = ("/v1/messages", "/v1/models", "/v1/files", "/v1/skills")
VERBS = {"_get": "GET", "_post": "POST", "_delete": "DELETE", "_patch": "PATCH", "_put": "PUT",
"_get_api_list": "GET", "_post_api_list": "POST"}
PAGES = {"SyncPage": "kIds", "SyncPageCursor": "kCursor", "SyncReportPageCursor": "kReport",
"SyncBidirectionalPageCursor": "kBidirectional"}
DESTRUCTIVE_NAMES = {"archive", "delete", "remove", "cancel", "stop", "redact", "rotate_token",
"regenerate_signing_secret", "deny", "approve", "pause"}
# Calls that move a secret out: not destructive, but never run without confirm.
SECRET_NAMES = {"reveal_token"}
# Operations documented (reference page) but present in no SDK. fields come from the page.
DOCS_ONLY = [
# (sdk-style op id, verb, path, docs slug, response, pagination)
("organization.usage_report.retrieve_messages", "GET", "/v1/organizations/usage_report/messages",
"api/beta/organization/usage_report/retrieve_messages", "BetaMessagesUsageReport", "kReport"),
("organization.usage_report.retrieve_claude_code", "GET", "/v1/organizations/usage_report/claude_code",
"api/beta/organization/usage_report/retrieve_claude_code", "BetaClaudeCodeUsageReport", "kReport"),
("organization.cost_report.retrieve", "GET", "/v1/organizations/cost_report",
"api/beta/organization/cost_report/retrieve", "BetaCostReport", "kReport"),
("organization.mcp_tunnels.list", "GET", "/v1/organizations/tunnels",
"api/beta/organization/mcp_tunnels/list", "BetaMcpTunnel", "kCursor"),
("organization.mcp_tunnels.retrieve", "GET", "/v1/organizations/tunnels/{tunnel_id}",
"api/beta/organization/mcp_tunnels/retrieve", "BetaMcpTunnel", "kNone"),
("organization.mcp_tunnels.archive", "POST", "/v1/organizations/tunnels/{tunnel_id}/archive",
"api/beta/organization/mcp_tunnels/archive", "BetaMcpTunnel", "kNone"),
("organization.mcp_tunnels.reveal_token", "POST", "/v1/organizations/tunnels/{tunnel_id}/reveal_token",
"api/beta/organization/mcp_tunnels/reveal_token", "BetaMcpTunnelToken", "kNone"),
("organization.mcp_tunnels.rotate_token", "POST", "/v1/organizations/tunnels/{tunnel_id}/rotate_token",
"api/beta/organization/mcp_tunnels/rotate_token", "BetaMcpTunnelToken", "kNone"),
("organization.mcp_tunnels.certificates.list", "GET", "/v1/organizations/tunnels/{tunnel_id}/certificates",
"api/beta/organization/mcp_tunnels/tunnel_certificates/list", "BetaMcpTunnelCertificate", "kCursor"),
("organization.mcp_tunnels.certificates.retrieve", "GET",
"/v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}",
"api/beta/organization/mcp_tunnels/tunnel_certificates/retrieve", "BetaMcpTunnelCertificate", "kNone"),
("organization.mcp_tunnels.certificates.create", "POST", "/v1/organizations/tunnels/{tunnel_id}/certificates",
"api/beta/organization/mcp_tunnels/tunnel_certificates/create", "BetaMcpTunnelCertificate", "kNone"),
("organization.mcp_tunnels.certificates.archive", "POST",
"/v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}/archive",
"api/beta/organization/mcp_tunnels/tunnel_certificates/archive", "BetaMcpTunnelCertificate", "kNone"),
]
# Beta header of docs-only rows (read from the reference page's prose / SDK twin); "" = none.
DOCS_ONLY_BETA = {"organization.mcp_tunnels": "mcp-tunnels-2026-06-22"}
# SDK operations whose reference page does not exist yet: checked against a guide.
GUIDE_DOCS = {"claude_tag": "guide:manage-claude/claude-tag-api"}
# SDK operations with neither a reference page nor a guide (single source: SDK).
SDK_ONLY = {"/v1/organizations/analytics/usage", "/v1/organizations/analytics/cost"}
# Body fields a reference page documents but the pinned SDK does not have yet.
DOCS_EXTRA_BODY = {}
# Resource groups the credential note says take only an org:admin OAuth token.
OAUTH_MARKERS = ("/federation_issuers", "/federation_rules", "/service_accounts")
AREA = {
"organization": "identity", "users": "identity", "invites": "identity", "api_keys": "identity",
"external_keys": "identity", "rate_limits": "identity", "compliance_settings": "identity",
"workspaces": "workspaces", "service_accounts": "access", "federation": "access",
"rbac_groups": "access", "rbac_roles": "access", "analytics": "analytics",
"usage_report": "reports", "cost_report": "reports", "spend_limits": "spend_limits",
"plugins": "plugins", "plugin_marketplaces": "plugins", "telemetry_destinations": "telemetry",
"webhooks": "telemetry", "claude_tag": "claude_tag", "mcp_tunnels": "tunnels", "tunnels": "tunnels",
"agents": "agents", "environments": "environments", "sessions": "sessions",
"deployments": "deployments", "deployment_runs": "deployments", "vaults": "vaults",
"memory_stores": "memory", "user_profiles": "user_profiles", "dreams": "dreams",
}
CLASS_NAME = {
"organization": "Organization", "workspaces.members": "WorkspaceMembers",
"workspaces.rate_limits": "WorkspaceRateLimits", "workspaces.service_accounts": "WorkspaceServiceAccounts",
"service_accounts.workspaces": "ServiceAccountWorkspaces", "federation.rules.workspaces": "FederationRuleWorkspaces",
"mcp_tunnels.certificates": "McpTunnelCertificates", "usage_report": "UsageReports",
"cost_report": "CostReports", "mcp_tunnels": "McpTunnels",
}
METHOD_NAME = {"retrieve": "get", "delete": "destroy", "retrieve_messages": "messages",
"retrieve_claude_code": "claude_code", "set": "set_limit"}
def camel(s):
return "".join(p[:1].upper() + p[1:] for p in re.split(r"[_.]", s) if p)
def fetch(url, headers=None):
req = urllib.request.Request(url, headers=headers or UA)
with urllib.request.urlopen(req, timeout=120) as r:
return r.read()
# --- SDK extraction -------------------------------------------------------------------------
class Sdk:
def __init__(self, tar_path=None):
data = open(tar_path, "rb").read() if tar_path else fetch(SDK_URL)
self.files = {}
with tarfile.open(fileobj=io.BytesIO(data), mode="r:gz") as t:
for m in t.getmembers():
if m.isfile() and m.name.endswith((".py", ".yml")):
self.files[m.name.split("/", 1)[1]] = t.extractfile(m).read().decode("utf-8", "replace")
self.res = "src/anthropic/resources/"
def resource_files(self, scope_only=True):
out = []
for name in sorted(self.files):
if not name.startswith(self.res) or name.endswith("__init__.py"):
continue
rel = name[len(self.res):]
if scope_only and not any(rel == s or rel.startswith(s + "/") for s in SCOPES):
continue
out.append(name)
return out
def op_id(rel):
parts = rel[:-3].split("/")
if len(parts) > 1 and parts[-1] == parts[-2]:
parts = parts[:-1]
return parts
def types_dir(rel):
parts = rel[:-3].split("/")
parent = parts[:-1]
if parent and parts[-1] == parent[-1]:
parent = parent[:-1]
return "src/anthropic/types/" + "/".join(parent) + ("/" if parent else "")
def singulars(word):
out = [word]
if word.endswith("ies"):
out.append(word[:-3] + "y")
if word.endswith("s"):
out.append(word[:-1])
return out
def is_array(ann):
return bool(ann) and re.search(r"\b(List|SequenceNotStr|Iterable|Sequence)\[", ann) is not None
def analyze(fn, src):
a = fn.args
pos = [x.arg for x in a.args if x.arg != "self"]
kw = {}
for x, d in zip(a.kwonlyargs, a.kw_defaults):
kw[x.arg] = {"req": d is None, "ann": ast.unparse(x.annotation) if x.annotation else ""}
ret = ast.unparse(fn.returns) if fn.returns else ""
out = {"name": fn.name, "pos": pos, "kw": kw, "ret": ret, "calls": [], "beta": "", "ws": "workspace_id" in kw,
"headers": {}}
seg = ast.get_source_segment(src, fn) or ""
m = re.search(r'extra_headers = \{"anthropic-beta": "([^"]+)"', seg)
out["beta"] = m.group(1) if m else ""
# header params: strip_not_given({...}) dicts of the extra_headers assignment
for node in ast.walk(fn):
if isinstance(node, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "extra_headers" for t in node.targets):
if isinstance(node.value, ast.Dict):
for k, v in zip(node.value.keys, node.value.values):
if k is None and isinstance(v, ast.Call) and v.args and isinstance(v.args[0], ast.Dict):
d = v.args[0]
for hk, hv in zip(d.keys, d.values):
if isinstance(hk, ast.Constant) and hk.value not in ("anthropic-beta", "anthropic-workspace-id"):
if isinstance(hv, ast.Name):
out["headers"][hv.id] = hk.value
for node in ast.walk(fn):
if isinstance(node, ast.Call) and isinstance(node.func, ast.Attribute) and isinstance(node.func.value, ast.Name) \
and node.func.value.id == "self" and node.func.attr in VERBS:
c = {"verb": VERBS[node.func.attr], "path": ast.unparse(node.args[0]), "body": None, "query": None,
"stream": False, "files": False, "raw": "BinaryAPIResponse" in ast.unparse(node)}
for k in node.keywords:
if k.arg == "body" and isinstance(k.value, ast.Dict):
c["body"] = {kk.value: (vv.id if isinstance(vv, ast.Name) else None)
for kk, vv in zip(k.value.keys, k.value.values)}
if k.arg == "stream":
c["stream"] = True
if k.arg == "files":
c["files"] = True
if k.arg == "options":
for k2 in k.value.keywords:
if k2.arg == "query" and isinstance(k2.value, ast.Dict):
c["query"] = {kk.value: (vv.id if isinstance(vv, ast.Name) else None)
for kk, vv in zip(k2.value.keys, k2.value.values)}
out["calls"].append(c)
if "extract_files" in seg and "'files'" not in seg and '"files"' in seg:
pass
if "extract_files(" in seg:
for c in out["calls"]:
c["files"] = True
return out
def extract_ops(sdk, scope_only=True):
ops = []
for name in sdk.resource_files(scope_only):
rel = name[len(sdk.res):]
src = sdk.files[name]
tree = ast.parse(src)
for cls in tree.body:
if not isinstance(cls, ast.ClassDef) or cls.name.startswith("Async") or "Raw" in cls.name \
or "Streaming" in cls.name:
continue
for fn in cls.body:
if not isinstance(fn, ast.FunctionDef) or fn.name.startswith("_") or not fn.args.kwonlyargs:
continue
if fn.name in ("with_raw_response", "with_streaming_response"):
continue
r = analyze(fn, src)
if not r["calls"]:
continue
r["file"] = rel
r["ident"] = op_id(rel) + [fn.name]
r["tdir"] = types_dir(rel)
ops.append(r)
return ops
def row_from_op(sdk, r):
c = r["calls"][0]
pm = re.match(r"path_template\(\s*'([^']+)'", c["path"], re.S)
path = pm.group(1) if pm else c["path"].strip("'\"")
ids = re.findall(r"\{(\w+)\}", path)
body = c["body"] or {}
# kw names behind query keys, to know which are arrays
q = c["query"] or {}
query, qarr = [], {}
for key, var in q.items():
arr = is_array(r["kw"].get(var, {}).get("ann", ""))
query.append(key + ("[]" if arr else ""))
req = [k for k, v in r["kw"].items() if v["req"] and (k in body or any(vv == k for vv in body.values()))]
# body keys that map to required kw
required = []
for key, var in body.items():
if var and r["kw"].get(var, {}).get("req"):
required.append(key)
for key, var in q.items():
if var and r["kw"].get(var, {}).get("req"):
required.append(key + ("[]" if is_array(r["kw"][var]["ann"]) else ""))
if c["files"]:
# multipart: the file parameters are parts named `files[]` / `archive`
body = {}
for k, v in r["kw"].items():
if k in ("betas", "workspace_id", "extra_headers", "extra_query", "extra_body", "timeout"):
continue
if "FileTypes" in v["ann"]:
nm = k + ("[]" if "SequenceNotStr" in v["ann"] else "")
body[nm] = k
if v["req"]:
required.append(nm)
elif k not in ids:
body[k] = k
if v["req"]:
required.append(k)
ret = r["ret"]
pg = "kNone"
for k, v in PAGES.items():
if re.search(r"\b" + k + r"\[", ret):
pg = v
mresp = re.search(r"\[(\w+)\]", ret)
resp = mresp.group(1) if mresp else re.sub(r"Optional\[(\w+)\]", r"\1", ret)
if c["raw"]:
resp = "Binary"
# request schema: SDK params module for this operation
schema, schema_file = "", ""
stem_parts = r["ident"][-2]
for s in singulars(stem_parts):
cand = r["tdir"] + "%s_%s_params.py" % (s, r["ident"][-1])
if cand in sdk.files:
schema = camel(os.path.basename(cand)[:-3])
schema_file = cand
break
return {
"ident": r["ident"], "verb": c["verb"], "path": path, "ids": ids,
"body": list(body.keys()) if not c["files"] else list(body.keys()),
"required": required, "query": query, "headers": dict(r["headers"]),
"beta": r["beta"], "ws": r["ws"], "page": pg, "resp": resp, "schema": schema, "schema_file": schema_file,
"stream": c["stream"], "files": c["files"], "raw": c["raw"], "file": r["file"],
"kwargs": r["kw"], "src": "sdk",
}
def merge_twins(rows):
"""GA (non-beta) and beta variants of one verb+path: one row when the shapes agree."""
groups = {}
for r in rows:
groups.setdefault((r["verb"], r["path"]), []).append(r)
out = []
for key, vs in sorted(groups.items(), key=lambda kv: kv[1][0]["ident"]):
ga = [v for v in vs if v["ident"][0] != "beta"]
be = [v for v in vs if v["ident"][0] == "beta"]
def compatible(g, b):
return (g["beta"] == b["beta"] and g["page"] == b["page"] and set(g["body"]) <= set(b["body"])
and set(g["query"]) <= set(b["query"]) and set(g["required"]) == set(b["required"]))
if ga and be and compatible(ga[0], be[0]):
be[0]["twin"] = ga[0]["ident"]
be[0]["ident"] = ga[0]["ident"]
be[0]["schema_files"] = [f for f in (ga[0]["schema_file"], be[0]["schema_file"]) if f]
be[0]["schema"] = ga[0]["schema"] or be[0]["schema"]
out.append(be[0])
elif ga and be:
# different generations of one endpoint: two rows, the beta-header form is suffixed
be[0]["suffix"] = "Beta"
ga[0]["twin"] = None
out.extend([ga[0], be[0]])
else:
out.append((ga or be)[0])
return out
# --- reference pages ------------------------------------------------------------------------
class Pages:
def __init__(self, cache):
self.cache = cache
self.mem = {}
def get(self, slug):
if slug in self.mem:
return self.mem[slug]
text = None
path = os.path.join(self.cache, slug.replace("/", "_") + ".md") if self.cache else None
if path and os.path.exists(path) and os.path.getsize(path) > 200:
text = open(path, encoding="utf-8").read()
else:
try:
text = fetch(DOCS_URL % slug).decode("utf-8", "replace")
except Exception as e: # noqa
text = "ERROR " + str(e)
if path and not text.startswith("ERROR"):
os.makedirs(self.cache, exist_ok=True)
open(path, "w", encoding="utf-8").write(text)
self.mem[slug] = text
return text
def prefetch(self, slugs):
with cf.ThreadPoolExecutor(8) as ex:
list(ex.map(self.get, slugs))
def docs_slug(row):
ident = row["ident"]
if row.get("docs"):
return row["docs"]
parts = list(ident)
beta = parts[0] == "beta"
if beta:
parts = parts[1:]
last = parts[-1]
group = parts[:-1]
# SDK group names that differ from the reference URL
group = ["mcp_tunnels" if g == "tunnels" and group[0] == "organization" else g for g in group]
return "api/" + ("beta/" if beta or parts[0] != "organization" and parts[0] != "user_profiles" else "") + \
"/".join(group + [last])
def section(text, names):
"""Top-level bullet parameter names under the first heading whose text is in names."""
out, active = [], False
for line in text.splitlines():
h = re.match(r"^#{2,3} (.+)$", line)
if h:
active = h.group(1).strip().lower() in names
continue
if active:
m = re.match(r"^- `\"?([^`:\"]+)\"?(?::|`)", line)
if m:
out.append(m.group(1))
return out
def doc_params(text):
return {
"path": section(text, ("path parameters",)),
"query": section(text, ("query parameters",)),
"body": section(text, ("body parameters",)),
"headers": section(text, ("headers",)),
}
def doc_method_path(text):
m = re.search(r"\*\*(GET|POST|DELETE|PATCH|PUT)\*\* `([^`]+)`", text)
return (m.group(1), m.group(2)) if m else (None, None)
# --- table rows -----------------------------------------------------------------------------
def auth_of(path):
if any(m in path for m in OAUTH_MARKERS):
return "kOAuth"
if path.startswith("/v1/organizations"):
return "kAdmin"
return "kPlatform"
def kind_of(verb, name):
if name in DESTRUCTIVE_NAMES or verb == "DELETE":
return "kDestructive"
if verb == "GET":
return "kRead"
return "kWrite"
def transport_of(row):
if row["files"]:
return "kMultipart"
if row["raw"]:
return "kRaw"
if row["stream"] or row["ident"][-1] == "stream":
return "kSse"
return "kJson"
def enum_name(row):
parts = list(row["ident"])
if parts[0] == "beta":
parts = parts[1:]
if parts[0] == "organization" and len(parts) > 2:
parts = parts[1:]
return "k" + camel(".".join(parts)) + row.get("suffix", "")
def group_of(row):
parts = list(row["ident"][:-1])
if parts and parts[0] == "beta":
parts = parts[1:]
if parts and parts[0] == "organization" and len(parts) > 1:
parts = parts[1:]
return ".".join(parts)
def area_of(row):
g = group_of(row).split(".")[0]
return AREA[g]
def method_name(row):
n = row["ident"][-1]
return METHOD_NAME.get(n, n)
def build_rows(sdk, pages, use_docs):
ops = extract_ops(sdk)
rows = [row_from_op(sdk, r) for r in ops]
rows = merge_twins(rows)
for r in rows:
for f in DOCS_EXTRA_BODY.get((r["verb"], r["path"]), []):
if f not in r["body"]:
r["body"].append(f)
r["auth"] = auth_of(r["path"])
r["docs"] = ""
for r in rows:
g = group_of(r).split(".")[0]
if g in GUIDE_DOCS:
r["docs"] = GUIDE_DOCS[g]
elif r["path"] in SDK_ONLY:
r["docs"] = ""
else:
r["docs"] = docs_slug(r)
# docs-only rows
for ident, verb, path, slug, resp, pg in DOCS_ONLY:
text = pages.get(slug)
if text.startswith("ERROR"):
raise SystemExit("docs-only page missing: " + slug + " " + text)
p = doc_params(text)
# required = bullets without "optional"
req_q = sorted(n for n in p["query"] if re.search(r"^- `" + re.escape(n) + r"(\[\])?: (?!optional)", text, re.M))
req_b = sorted(n for n in p["body"] if re.search(r"^- `" + re.escape(n) + r": (?!optional)", text, re.M))
arrays = set()
for n in p["query"]:
if re.search(r"^- `" + re.escape(n) + r": (optional )?array of", text, re.M):
arrays.add(n)
parts = ident.split(".")
beta = ""
for k, v in DOCS_ONLY_BETA.items():
if ident.startswith(k):
beta = v
rows.append({
"ident": ["beta"] + parts, "verb": verb, "path": path,
"ids": re.findall(r"\{(\w+)\}", path),
"body": p["body"], "required": [n + ("[]" if n in arrays else "") for n in req_q] + req_b,
"query": [n + ("[]" if n in arrays else "") for n in p["query"]],
"headers": {}, "beta": beta, "ws": False, "page": pg, "resp": resp, "schema": "",
"stream": False, "files": False, "raw": False, "file": "", "kwargs": {}, "src": "docs",
"auth": auth_of(path), "docs": slug, "twin": None,
})
rows.sort(key=lambda r: (r["auth"], enum_name(r)))
return rows
# --- emit -----------------------------------------------------------------------------------
HDR = ("// GENERATED by src/anthropic/admin/tools/check_spec.py --emit. Do not edit by hand:\n"
"// the table is verified against the SDK source and the reference pages.\n")
def csv(items):
return ",".join(items)
def emit_calls(rows):
enum = ",\n ".join(enum_name(r) for r in rows)
h = HDR + """#pragma once
// The ONE table of REST calls this package makes. Every row is checked by
// tools/check_spec.py against the official SDK source and the API reference.
// Code builds every URL from this table, never from a literal.
#include <cstddef>
#include "clients/request.h"
namespace molo::anthropic::admin {
enum class Call {
%s,
};
// Which credential a call needs.
enum class Auth {
kAdmin, // Admin API key (sk-ant-admin..., x-api-key) or an org:admin OAuth token
kOAuth, // only an org:admin OAuth bearer token (service accounts, federation)
kPlatform, // standard workspace API key (managed agents surface)
};
enum class Kind { kRead, kWrite, kDestructive };
enum class Page { kNone, kIds, kCursor, kReport, kBidirectional };
enum class Wire { kJson, kSse, kMultipart, kRaw };
struct CallSpec {
Call call;
const char* name; // SDK-style operation id, e.g. organization.invites.create
const char* http; // GET POST PATCH DELETE
const char* path; // /v1/organizations/invites/{invite_id}
const char* docs; // reference page slug, guide:<page>, or "" (SDK only)
const char* request; // SDK request schema (TypedDict) or ""
const char* response; // SDK response type
const char* body; // comma list: JSON body fields (multipart: part names)
const char* required; // comma list: required body fields and query parameters
const char* query; // comma list: query parameters; `name[]` is sent repeated
const char* headers; // comma list: arg=Header-Name request header parameters
const char* beta; // anthropic-beta value the call needs, or ""
Auth auth;
Kind kind;
Page page;
Wire wire;
bool workspace; // accepts the anthropic-workspace-id header
bool docs_only; // not in any SDK: reference page is the only source
};
const CallSpec& spec_of(Call call);
clients::Method method_of(Call call);
std::size_t call_count();
const CallSpec& spec_at(std::size_t index);
} // namespace molo::anthropic::admin
""" % enum
lines = []
for r in rows:
hdrs = ",".join("%s=%s" % (k, v) for k, v in r["headers"].items())
lines.append(' {Call::%s, "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s", Auth::%s, Kind::%s, Page::%s, Wire::%s, %s, %s},'
% (enum_name(r), ".".join(r["ident"][1:] if r["ident"][0] == "beta" else r["ident"]) + r.get("suffix", "").lower(),
r["verb"], r["path"], r["docs"], r["schema"], r["resp"], csv(r["body"]), csv(r["required"]),
csv(r["query"]), hdrs, r["beta"], r["auth"], kind_of(r["verb"], r["ident"][-1]),
r["page"], transport_of(r), "true" if r["ws"] else "false",
"true" if r["src"] == "docs" else "false"))
c = HDR + """#include "anthropic/admin/calls.h"
#include <stdexcept>
namespace molo::anthropic::admin {
// CALLS-BEGIN (parsed by tools/check_spec.py; one row per line)
static const CallSpec kCalls[] = {
%s
};
// CALLS-END
std::size_t call_count() { return sizeof(kCalls) / sizeof(kCalls[0]); }
const CallSpec& spec_at(std::size_t index) {
if (index >= call_count()) throw std::out_of_range("call index");
return kCalls[index];
}
const CallSpec& spec_of(Call call) {
for (const CallSpec& s : kCalls)
if (s.call == call) return s;
throw std::out_of_range("unknown call");
}
clients::Method method_of(Call call) {
const std::string m = spec_of(call).http;
if (m == "GET") return clients::Method::kGet;
if (m == "POST") return clients::Method::kPost;
if (m == "DELETE") return clients::Method::kDelete;
if (m == "PATCH") return clients::Method::kPatch;
return clients::Method::kPut;
}
} // namespace molo::anthropic::admin
""" % "\n".join(lines)
return {"calls.h": h, "calls.cpp": c}
def groups_of(rows):
g = {}
for r in rows:
g.setdefault(group_of(r), []).append(r)
return g
def class_name(group):
return CLASS_NAME.get(group) or camel(group)
def accessor(group):
return re.sub(r"\W", "_", {"organization": "organization"}.get(group, group))
def cxx_sig(r):
"""(declaration args, call-site expression pieces)."""
args = ["const std::string& %s" % i for i in r["ids"]]
has_body = bool(r["body"]) and not r["files"]
has_query = bool(r["query"]) or bool(r["headers"])
q_required = any(n in r["query"] for n in r["required"] if n not in r["body"])
if r["files"]:
args.append("const clients::body::MultipartBody& form")
elif has_body:
args.append("const Json& body")
if has_query:
args.append("const Query& query" + ("" if q_required else " = Query()"))
return args, has_body, has_query
def emit_service(area, rows):
groups = groups_of(rows)
decl, impl = [], []
for g in sorted(groups):
cname = class_name(g)
auths = {r["auth"] for r in groups[g]}
if len(auths) != 1:
raise SystemExit("group %s mixes credentials %s" % (g, auths))
auth = auths.pop()
decl.append("// group %s\nclass %s : public Resource {\n public:\n explicit %s(std::shared_ptr<Gateway> gateway)\n : Resource(std::move(gateway), Auth::%s) {}\n"
% (g, cname, cname, auth))
for r in sorted(groups[g], key=lambda r: r["ident"][-1]):
args, has_body, has_query = cxx_sig(r)
mname = method_name(r) + r.get("suffix", "")
ce = "Call::" + enum_name(r)
ids = "{" + ", ".join(r["ids"]) + "}"
kind = kind_of(r["verb"], r["ident"][-1])
tag = {"kRead": "", "kWrite": " MUTATES", "kDestructive": " DESTRUCTIVE"}[kind]
if r["ident"][-1] in SECRET_NAMES:
tag = " RETURNS A SECRET"
comment = " // %s %s%s" % (r["verb"], r["path"], tag)
qexpr = "&query" if has_query else "nullptr"
bexpr = "&body" if has_body else "nullptr"
w = transport_of(r)
if w == "kSse":
sig = ", ".join([a for a in args if not a.startswith("const Query&")] + ["const EventSink& sink"] + [a for a in args if a.startswith("const Query&")])
decl.append("%s\n void %s(%s) const;\n" % (comment, mname, sig))
impl.append("void %s::%s(%s) const {\n do_stream(%s, %s, %s, sink);\n}\n"
% (cname, mname, sig.replace(" = Query()", ""), ce, ids, qexpr if has_query else "nullptr"))
elif w == "kMultipart":
sig = ", ".join(args)
decl.append("%s\n Json %s(%s) const;\n" % (comment, mname, sig))
impl.append("Json %s::%s(%s) const {\n return do_form(%s, %s, form);\n}\n"
% (cname, mname, sig.replace(" = Query()", ""), ce, ids))
elif w == "kRaw":
sig = ", ".join(args)
decl.append("%s\n llm::RawResponse %s(%s) const;\n" % (comment, mname, sig))
impl.append("llm::RawResponse %s::%s(%s) const {\n return do_raw(%s, %s, %s);\n}\n"
% (cname, mname, sig.replace(" = Query()", ""), ce, ids, qexpr))
else:
sig = ", ".join(args)
decl.append("%s\n Json %s(%s) const;\n" % (comment, mname, sig))
impl.append("Json %s::%s(%s) const {\n return do_json(%s, %s, %s, %s);\n}\n"
% (cname, mname, sig.replace(" = Query()", ""), ce, ids, qexpr, bexpr))
if r["page"] != "kNone":
wargs = ", ".join([a for a in args if not a.startswith("const Query&")] + ["const Query& query = Query()", "std::size_t max_pages = Caps::kMaxPages"])
decl.append(" Walk %s_all(%s) const;\n" % (mname, wargs))
impl.append("Walk %s::%s_all(%s) const {\n return do_walk(%s, %s, query, max_pages);\n}\n"
% (cname, mname, wargs.replace(" = Query()", "").replace(" = Caps::kMaxPages", ""), ce, ids))
decl.append("};\n")
guard = "ANTHROPIC_ADMIN_SERVICES_%s_H" % area.upper()
h = HDR + """#pragma once
// %s calls of the Anthropic API (one class per resource group). Every
// method is one row of calls.cpp; mutating and destructive ones are marked.
#include <memory>
#include <string>
#include "anthropic/admin/resource.h"
namespace molo::anthropic::admin {
%s
} // namespace molo::anthropic::admin
""" % (area, "\n".join(decl))
c = HDR + """#include "anthropic/admin/services/%s.h"
namespace molo::anthropic::admin {
%s
} // namespace molo::anthropic::admin
""" % (area, "\n".join(impl))
return {"services/%s.h" % area: h, "services/%s.cpp" % area: c}
def emit_all(rows):
files = emit_calls(rows)
areas = {}
for r in rows:
areas.setdefault(area_of(r), []).append(r)
for a, rs in sorted(areas.items()):
files.update(emit_service(a, rs))
classes = []
for a, rs in sorted(areas.items()):
for g in sorted(groups_of(rs)):
classes.append((a, g))
# facade: one accessor per class
inc = "\n".join('#include "anthropic/admin/services/%s.h"' % a for a in sorted(areas))
members = "\n".join(" %s %s_;" % (class_name(g), accessor(g)) for a, g in classes)
acc = "\n".join(" const %s& %s() const { return %s_; }" % (class_name(g), accessor(g), accessor(g)) for a, g in classes)
init = ",\n ".join("%s_(gateway_)" % accessor(g) for a, g in classes)
files["api.h"] = HDR + """#pragma once
// AdminApi: every resource group of the package behind one object. Build it
// from the environment (ANTHROPIC_ADMIN_KEY, ANTHROPIC_ADMIN_TOKEN,
// ANTHROPIC_API_KEY) or from an explicit Gateway.
#include <memory>
#include "anthropic/admin/gateway.h"
%s
namespace molo::anthropic::admin {
class AdminApi {
public:
explicit AdminApi(std::shared_ptr<Gateway> gateway)
: gateway_(std::move(gateway)),
%s {}
static AdminApi from_env() { return AdminApi(Gateway::from_env()); }
const Gateway& gateway() const { return *gateway_; }
%s
private:
std::shared_ptr<Gateway> gateway_;
%s
};
} // namespace molo::anthropic::admin
""" % (inc, init, acc, members)
return files
# --- verify ---------------------------------------------------------------------------------
def parse_table(path):
text = open(path, encoding="utf-8").read()
a = text.index("// CALLS-BEGIN")
b = text.index("// CALLS-END")
rows = []
for line in text[a:b].splitlines()[1:]:
m = re.match(r'^\s*\{Call::(\w+), (.*), Auth::(\w+), Kind::(\w+), Page::(\w+), Wire::(\w+), (\w+), (\w+)\},$', line)
if not m:
continue
strs = re.findall(r'"([^"]*)"', m.group(2))
rows.append({"enum": m.group(1), "strs": strs, "auth": m.group(3), "kind": m.group(4),
"page": m.group(5), "wire": m.group(6)})
return rows
def verify(sdk, pages, rows, no_docs):
bad = []
# 1. committed generated files equal fresh generation
fresh = emit_all(rows)
for rel, text in fresh.items():
p = os.path.join(ADMIN, rel)
if not os.path.exists(p):
bad.append("generated file missing: " + rel)
elif open(p, encoding="utf-8").read() != text:
bad.append("generated file stale: " + rel)
committed = parse_table(os.path.join(ADMIN, "calls.cpp"))
if len(committed) != len(rows):
bad.append("table has %d rows, sources define %d" % (len(committed), len(rows)))
# 2. every SDK operation (whole SDK) is in the table or excluded
all_ops = extract_ops(sdk, scope_only=False)
table_keys = {(r["verb"], r["path"]) for r in rows}
sdk_ops = 0
for r in all_ops:
for c in r["calls"]:
pm = re.match(r"path_template\(\s*'([^']+)'", c["path"], re.S)
path = pm.group(1) if pm else c["path"].strip("'\"")
sdk_ops += 1
if (c["verb"], path) in table_keys:
continue
if path.startswith(EXCLUDED) or not path.startswith("/v1/"):
if not path.startswith("/v1/") and not r["file"].startswith(("messages/", "beta/messages/")):
bad.append("SDK operation with a computed path outside core: %s (%s)" % (path, r["file"]))
continue
bad.append("SDK operation neither in table nor excluded: %s %s (%s)" % (c["verb"], path, r["file"]))
# 3. SDK params module (TypedDict) check: a third source for the fields
for r in rows:
files = r.get("schema_files") or ([r["schema_file"]] if r.get("schema_file") else [])
if r["src"] != "sdk" or not files:
continue
text = "\n".join(sdk.files[f] for f in files)
fields = set(re.findall(r"^ (\w+): ", text, re.M)) | set(re.findall(r'alias="([^"]+)"', text))
want = [x for x in r["body"] if not r["files"]] + [q.removesuffix("[]") for q in r["query"]]
for f in want:
if f in DOCS_EXTRA_BODY.get((r["verb"], r["path"]), []):
continue
base = re.sub(r"\[(gt|gte|lt|lte)\]$", r"_\1", f)
if f not in fields and base not in fields:
bad.append("%s: field %s not in %s" % (".".join(r["ident"]), f, r["schema"]))
# 4. reference pages
docs_checked = 0
if not no_docs:
slugs = [r["docs"] for r in rows if r["docs"] and not r["docs"].startswith("guide:")]
pages.prefetch(slugs + sorted({g[len("guide:"):] for g in GUIDE_DOCS.values()}))
for r in rows:
name = ".".join(r["ident"])
if r["docs"].startswith("guide:"):
text = pages.get(r["docs"][len("guide:"):])
if (r["verb"] + " " + r["path"]) not in text:
bad.append("%s: %s %s not in guide %s" % (name, r["verb"], r["path"], r["docs"]))
docs_checked += 1
continue
if not r["docs"]:
continue
text = pages.get(r["docs"])
if text.startswith("ERROR"):
bad.append("%s: reference page %s: %s" % (name, r["docs"], text[:80]))
continue
docs_checked += 1
verb, path = doc_method_path(text)
if (verb, path) != (r["verb"], r["path"]):
bad.append("%s: page says %s %s, table says %s %s" % (name, verb, path, r["verb"], r["path"]))
p = doc_params(text)
for f in r["body"]:
if not r["files"] and f not in p["body"]:
bad.append("%s: body field %s absent on page" % (name, f))
for q in r["query"]:
q0 = q[:-2] if q.endswith("[]") else q
if q0 not in p["query"] and not any(x == q0 for x in p["query"]):
bad.append("%s: query param %s absent on page" % (name, q0))
for f in p["body"]:
if not r["files"] and f not in r["body"]:
bad.append("%s: page documents body field %s the table lacks" % (name, f))
for f in p["query"]:
if f not in [q.replace("[]", "") for q in r["query"]]:
bad.append("%s: page documents query param %s the table lacks" % (name, f))
oauth_note = "Admin API keys are not accepted" in text
if oauth_note != (r["auth"] == "kOAuth"):
bad.append("%s: credential class %s disagrees with the page (oauth note: %s)" % (name, r["auth"], oauth_note))
return bad, sdk_ops, docs_checked
def main(argv):
emit = "--emit" in argv
no_docs = "--no-docs" in argv
tar = argv[argv.index("--sdk-tar") + 1] if "--sdk-tar" in argv else None
cache = argv[argv.index("--pages-dir") + 1] if "--pages-dir" in argv else None
sdk = Sdk(tar)
pages = Pages(cache)
rows = build_rows(sdk, pages, not no_docs)
if emit:
for rel, text in emit_all(rows).items():
p = os.path.join(ADMIN, rel)
os.makedirs(os.path.dirname(p), exist_ok=True)
open(p, "w", encoding="utf-8").write(text)
print("emitted %d calls" % len(rows))
return 0
bad, sdk_ops, docs_checked = verify(sdk, pages, rows, no_docs)
for b in bad:
print("FAIL", b)
print("sdk %s: %d operations scanned, %d table rows (%d docs-only), %d reference pages checked, %d failures"
% (SDK_SHA[:10], sdk_ops, len(rows), sum(1 for r in rows if r["src"] == "docs"), docs_checked, len(bad)))
return 1 if bad else 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
+102
View File
@@ -0,0 +1,102 @@
#include "anthropic/admin/webhook.h"
#include <wolfssl/options.h>
#include <wolfssl/wolfcrypt/hmac.h>
#include <cctype>
#include <cstdlib>
#include "anthropic/admin/caps.h"
#include "llm/error.h"
#include "security/crypto/Base64.h"
namespace molo::anthropic::admin {
namespace {
std::string lower(std::string s) {
for (char& c : s) c = static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
return s;
}
std::string header(const std::map<std::string, std::string>& h, const char* name) {
for (const auto& [k, v] : h)
if (lower(k) == name) return v;
return "";
}
std::string hmac_sha256(const std::string& key, const std::string& msg) {
Hmac h;
unsigned char out[WC_SHA256_DIGEST_SIZE];
if (wc_HmacInit(&h, nullptr, INVALID_DEVID) != 0) return "";
std::string result;
if (wc_HmacSetKey(&h, WC_SHA256, reinterpret_cast<const unsigned char*>(key.data()),
static_cast<word32>(key.size())) == 0 &&
wc_HmacUpdate(&h, reinterpret_cast<const unsigned char*>(msg.data()), static_cast<word32>(msg.size())) == 0 &&
wc_HmacFinal(&h, out) == 0)
result.assign(reinterpret_cast<char*>(out), sizeof(out));
wc_HmacFree(&h);
return result;
}
bool equal_const(const std::string& a, const std::string& b) {
if (a.size() != b.size()) return false;
unsigned char d = 0;
for (std::size_t i = 0; i < a.size(); ++i) d |= static_cast<unsigned char>(a[i] ^ b[i]);
return d == 0;
}
} // namespace
WebhookVerifier::WebhookVerifier(const std::string& signing_key) {
std::string k = signing_key;
if (k.rfind("whsec_", 0) == 0) k = k.substr(6);
if (k.empty() || !security::crypto::Base64::decode(k, key_) || key_.empty())
throw llm::ApiError::invalid("anthropic", "webhook signing key must be whsec_<base64>");
}
std::string WebhookVerifier::sign(const std::string& id, long timestamp, const std::string& payload) const {
std::string mac = hmac_sha256(key_, id + "." + std::to_string(timestamp) + "." + payload);
return "v1," + security::crypto::Base64::encode(mac);
}
bool WebhookVerifier::verify(const std::string& payload, const std::map<std::string, std::string>& headers,
long now, std::string* why) const {
auto fail = [&](const char* m) {
if (why) *why = m;
return false;
};
if (payload.size() > Caps::kMaxWebhookPayloadBytes) return fail("payload over the byte cap");
std::string id = header(headers, "webhook-id");
std::string ts = header(headers, "webhook-timestamp");
std::string sigs = header(headers, "webhook-signature");
if (id.empty() || ts.empty() || sigs.empty()) return fail("missing webhook headers");
char* end = nullptr;
long t = std::strtol(ts.c_str(), &end, 10);
if (*end || ts.empty()) return fail("bad webhook-timestamp");
long skew = now > t ? now - t : t - now;
if (skew > Caps::kWebhookToleranceSeconds) return fail("timestamp outside the tolerance");
std::string want = sign(id, t, payload).substr(3);
std::size_t pos = 0;
while (pos < sigs.size()) {
std::size_t sp = sigs.find(' ', pos);
std::string part = sigs.substr(pos, sp == std::string::npos ? std::string::npos : sp - pos);
pos = sp == std::string::npos ? sigs.size() : sp + 1;
if (part.rfind("v1,", 0) == 0 && equal_const(part.substr(3), want)) return true;
}
return fail("no matching signature");
}
clients::body::Json WebhookVerifier::unwrap(const std::string& payload,
const std::map<std::string, std::string>& headers,
long now) const {
std::string why;
if (!verify(payload, headers, now, &why)) throw llm::ApiError("anthropic", 400, "invalid_signature", why);
try {
return clients::body::Json::parse(payload);
} catch (const std::exception& e) {
throw llm::ApiError("anthropic", 400, "invalid_payload", e.what());
}
}
} // namespace molo::anthropic::admin
+37
View File
@@ -0,0 +1,37 @@
#pragma once
// Webhook signature verification for Managed Agents and organization
// webhooks. Scheme: Standard Webhooks (what the official SDK's `unwrap`
// delegates to): headers webhook-id, webhook-timestamp, webhook-signature;
// signature = base64(HMAC-SHA256(key, "<id>.<timestamp>.<payload>")),
// header value "v1,<sig>[ v1,<sig>...]"; key is "whsec_<base64>". Timestamp
// tolerance is capped (Caps::kWebhookToleranceSeconds).
#include <map>
#include <string>
#include "clients/body/json.h"
namespace molo::anthropic::admin {
class WebhookVerifier {
public:
explicit WebhookVerifier(const std::string& signing_key);
// Signature header value for a message (used by tests and by senders).
std::string sign(const std::string& id, long timestamp, const std::string& payload) const;
// True when some v1 signature matches and |now - timestamp| is within the
// tolerance. `headers` keys are matched case-insensitively. Never throws.
bool verify(const std::string& payload, const std::map<std::string, std::string>& headers,
long now, std::string* why = nullptr) const;
// Verifies, then parses the payload. Throws llm::ApiError on failure.
clients::body::Json unwrap(const std::string& payload,
const std::map<std::string, std::string>& headers, long now) const;
private:
std::string key_;
};
} // namespace molo::anthropic::admin