From aefa6be66e1f347da37d43c39904ef7d19a4a6d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 14:35:29 +0000 Subject: [PATCH 1/4] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index e7f771c..292c280 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-a548d120cebb4d68d46c828028d51d04b4d4abb868a7bad21dad960cb72cbd18.yml -openapi_spec_hash: 2b3214760a4e23a9704779ac99bce417 -config_hash: ce2cd5d2f03228adacf04ebcceb14465 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-60c0f75dc4aee8c6a6369ca07ffa9d669a13f3f8947731902254c77d49668211.yml +openapi_spec_hash: cbccfb09a7cd5674a268825bde63b231 +config_hash: a27692815fb054f08cbc5fdf2296eee5 From ac6bf4b7c0b702d1886394a9bc4c61ab441c7354 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 18:25:21 +0000 Subject: [PATCH 2/4] chore(api): accept user profile ID's when counting tokens --- .stats.yml | 4 ++-- pkg/cmd/betamessage.go | 5 +++++ pkg/cmd/betamessage_test.go | 3 +++ pkg/cmd/message.go | 5 +++++ pkg/cmd/message_test.go | 3 +++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 292c280..cc048f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-60c0f75dc4aee8c6a6369ca07ffa9d669a13f3f8947731902254c77d49668211.yml -openapi_spec_hash: cbccfb09a7cd5674a268825bde63b231 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-d9d0a13594aaf4cadc38948c5dacdf9e667560f81c32d7f3b92aed4d349bdfb1.yml +openapi_spec_hash: e21922daa56dcfb2c89443325cb979f1 config_hash: a27692815fb054f08cbc5fdf2296eee5 diff --git a/pkg/cmd/betamessage.go b/pkg/cmd/betamessage.go index e0c59eb..ed43c84 100644 --- a/pkg/cmd/betamessage.go +++ b/pkg/cmd/betamessage.go @@ -354,6 +354,11 @@ var betaMessagesCountTokens = requestflag.WithInnerFlags(cli.Command{ Usage: "Optional header to specify the beta version(s) you want to use.", HeaderPath: "anthropic-beta", }, + &requestflag.Flag[string]{ + Name: "user-profile-id", + Usage: "The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.", + HeaderPath: "anthropic-user-profile-id", + }, }, Action: handleBetaMessagesCountTokens, HideHelpCommand: true, diff --git a/pkg/cmd/betamessage_test.go b/pkg/cmd/betamessage_test.go index b53388d..a199bd2 100644 --- a/pkg/cmd/betamessage_test.go +++ b/pkg/cmd/betamessage_test.go @@ -268,6 +268,7 @@ func TestBetaMessagesCountTokens(t *testing.T) { "--tool-choice", "{type: auto, disable_parallel_tool_use: true}", "--tool", "{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}", "--beta", "message-batches-2024-09-24", + "--user-profile-id", "anthropic-user-profile-id", ) }) @@ -302,6 +303,7 @@ func TestBetaMessagesCountTokens(t *testing.T) { "--tool-choice", "{type: auto, disable_parallel_tool_use: true}", "--tool", "{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}", "--beta", "message-batches-2024-09-24", + "--user-profile-id", "anthropic-user-profile-id", ) }) @@ -411,6 +413,7 @@ func TestBetaMessagesCountTokens(t *testing.T) { "--api-key", "string", "beta:messages", "count-tokens", "--beta", "message-batches-2024-09-24", + "--user-profile-id", "anthropic-user-profile-id", ) }) } diff --git a/pkg/cmd/message.go b/pkg/cmd/message.go index 4cf999f..e728562 100644 --- a/pkg/cmd/message.go +++ b/pkg/cmd/message.go @@ -210,6 +210,11 @@ var messagesCountTokens = requestflag.WithInnerFlags(cli.Command{ Usage: "Definitions of tools that the model may use.\n\nIf you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks.\n\nThere are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).\n\nEach tool definition includes:\n\n* `name`: Name of the tool.\n* `description`: Optional, but strongly-recommended description of the tool.\n* `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks.\n\nFor example, if you defined `tools` as:\n\n```json\n[\n {\n \"name\": \"get_stock_price\",\n \"description\": \"Get the current stock price for a given ticker symbol.\",\n \"input_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"ticker\": {\n \"type\": \"string\",\n \"description\": \"The stock ticker symbol, e.g. AAPL for Apple Inc.\"\n }\n },\n \"required\": [\"ticker\"]\n }\n }\n]\n```\n\nAnd then asked the model \"What's the S&P 500 at today?\", the model might produce `tool_use` content blocks in the response like this:\n\n```json\n[\n {\n \"type\": \"tool_use\",\n \"id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"name\": \"get_stock_price\",\n \"input\": { \"ticker\": \"^GSPC\" }\n }\n]\n```\n\nYou might then run your `get_stock_price` tool with `{\"ticker\": \"^GSPC\"}` as an input, and return the following back to the model in a subsequent `user` message:\n\n```json\n[\n {\n \"type\": \"tool_result\",\n \"tool_use_id\": \"toolu_01D7FLrfh4GYq7yT1ULFeyMV\",\n \"content\": \"259.75 USD\"\n }\n]\n```\n\nTools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output.\n\nSee our [guide](https://docs.claude.com/en/docs/tool-use) for more details.", BodyPath: "tools", }, + &requestflag.Flag[string]{ + Name: "user-profile-id", + Usage: "The user profile ID to attribute this request to. Use when acting on behalf of a party other than your organization. Requires the `user-profiles` beta header.", + HeaderPath: "anthropic-user-profile-id", + }, }, Action: handleMessagesCountTokens, HideHelpCommand: true, diff --git a/pkg/cmd/message_test.go b/pkg/cmd/message_test.go index 1969a23..1ad3b4d 100644 --- a/pkg/cmd/message_test.go +++ b/pkg/cmd/message_test.go @@ -177,6 +177,7 @@ func TestMessagesCountTokens(t *testing.T) { "--thinking", "{type: adaptive, display: summarized}", "--tool-choice", "{type: auto, disable_parallel_tool_use: true}", "--tool", "{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}", + "--user-profile-id", "anthropic-user-profile-id", ) }) @@ -200,6 +201,7 @@ func TestMessagesCountTokens(t *testing.T) { "--thinking", "{type: adaptive, display: summarized}", "--tool-choice", "{type: auto, disable_parallel_tool_use: true}", "--tool", "{input_schema: {type: object, properties: {location: bar, unit: bar}, required: [location]}, name: name, allowed_callers: [direct], cache_control: {type: ephemeral, ttl: 5m}, defer_loading: true, description: Get the current weather in a given location, eager_input_streaming: true, input_examples: [{foo: bar}], strict: true, type: custom}", + "--user-profile-id", "anthropic-user-profile-id", ) }) @@ -275,6 +277,7 @@ func TestMessagesCountTokens(t *testing.T) { t, pipeData, "--api-key", "string", "messages", "count-tokens", + "--user-profile-id", "anthropic-user-profile-id", ) }) } From 77089320c047ef10a0b5a81d00d4bbfd546bcc7a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:23:05 +0000 Subject: [PATCH 3/4] chore(docs): updates to descriptions and example values --- .stats.yml | 4 ++-- pkg/cmd/betadeployment_test.go | 36 +++++++++++++++++----------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index cc048f9..6313bf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-d9d0a13594aaf4cadc38948c5dacdf9e667560f81c32d7f3b92aed4d349bdfb1.yml -openapi_spec_hash: e21922daa56dcfb2c89443325cb979f1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic/anthropic-6b10a63cce1116e5b2166c09f6bea8f6ec2c05cb030b4b16bcd290cd14406042.yml +openapi_spec_hash: b1b68cfdc57f6ce83736bd7fa8219305 config_hash: a27692815fb054f08cbc5fdf2296eee5 diff --git a/pkg/cmd/betadeployment_test.go b/pkg/cmd/betadeployment_test.go index 678c90a..029c005 100644 --- a/pkg/cmd/betadeployment_test.go +++ b/pkg/cmd/betadeployment_test.go @@ -22,7 +22,7 @@ func TestBetaDeploymentsCreate(t *testing.T) { "--description", "description", "--metadata", "{foo: string}", "--resource", "{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}", - "--schedule", "{expression: x, timezone: x, type: cron}", + "--schedule", "{expression: 0 9 * * 1-5, timezone: America/Los_Angeles, type: cron}", "--vault-id", "string", "--beta", "message-batches-2024-09-24", ) @@ -44,8 +44,8 @@ func TestBetaDeploymentsCreate(t *testing.T) { "--description", "description", "--metadata", "{foo: string}", "--resource", "{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}", - "--schedule.expression", "x", - "--schedule.timezone", "x", + "--schedule.expression", "0 9 * * 1-5", + "--schedule.timezone", "America/Los_Angeles", "--schedule.type", "cron", "--vault-id", "string", "--beta", "message-batches-2024-09-24", @@ -71,8 +71,8 @@ func TestBetaDeploymentsCreate(t *testing.T) { " type: file\n" + " mount_path: /uploads/receipt.pdf\n" + "schedule:\n" + - " expression: x\n" + - " timezone: x\n" + + " expression: 0 9 * * 1-5\n" + + " timezone: America/Los_Angeles\n" + " type: cron\n" + "vault_ids:\n" + " - string\n") @@ -92,7 +92,7 @@ func TestBetaDeploymentsRetrieve(t *testing.T) { t, "--api-key", "string", "beta:deployments", "retrieve", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) @@ -104,7 +104,7 @@ func TestBetaDeploymentsUpdate(t *testing.T) { t, "--api-key", "string", "beta:deployments", "update", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--agent", "string", "--description", "description", "--environment-id", "environment_id", @@ -112,7 +112,7 @@ func TestBetaDeploymentsUpdate(t *testing.T) { "--metadata", "{foo: string}", "--name", "name", "--resource", "[{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}]", - "--schedule", "{expression: x, timezone: x, type: cron}", + "--schedule", "{expression: 0 9 * * 1-5, timezone: America/Los_Angeles, type: cron}", "--vault-id", "[string]", "--beta", "message-batches-2024-09-24", ) @@ -127,7 +127,7 @@ func TestBetaDeploymentsUpdate(t *testing.T) { t, "--api-key", "string", "beta:deployments", "update", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--agent", "string", "--description", "description", "--environment-id", "environment_id", @@ -135,8 +135,8 @@ func TestBetaDeploymentsUpdate(t *testing.T) { "--metadata", "{foo: string}", "--name", "name", "--resource", "[{file_id: file_011CNha8iCJcU1wXNR6q4V8w, type: file, mount_path: /uploads/receipt.pdf}]", - "--schedule.expression", "x", - "--schedule.timezone", "x", + "--schedule.expression", "0 9 * * 1-5", + "--schedule.timezone", "America/Los_Angeles", "--schedule.type", "cron", "--vault-id", "[string]", "--beta", "message-batches-2024-09-24", @@ -162,8 +162,8 @@ func TestBetaDeploymentsUpdate(t *testing.T) { " type: file\n" + " mount_path: /uploads/receipt.pdf\n" + "schedule:\n" + - " expression: x\n" + - " timezone: x\n" + + " expression: 0 9 * * 1-5\n" + + " timezone: America/Los_Angeles\n" + " type: cron\n" + "vault_ids:\n" + " - string\n") @@ -171,7 +171,7 @@ func TestBetaDeploymentsUpdate(t *testing.T) { t, pipeData, "--api-key", "string", "beta:deployments", "update", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) @@ -203,7 +203,7 @@ func TestBetaDeploymentsArchive(t *testing.T) { t, "--api-key", "string", "beta:deployments", "archive", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) @@ -215,7 +215,7 @@ func TestBetaDeploymentsPause(t *testing.T) { t, "--api-key", "string", "beta:deployments", "pause", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) @@ -227,7 +227,7 @@ func TestBetaDeploymentsRun(t *testing.T) { t, "--api-key", "string", "beta:deployments", "run", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) @@ -239,7 +239,7 @@ func TestBetaDeploymentsUnpause(t *testing.T) { t, "--api-key", "string", "beta:deployments", "unpause", - "--deployment-id", "deployment_id", + "--deployment-id", "depl_011CZkZcDH3vPqd7xnEfwTai", "--beta", "message-batches-2024-09-24", ) }) From dad8cbf0858af6e2c80a50f4cf1f928645128141 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 21:23:31 +0000 Subject: [PATCH 4/4] release: 1.12.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pkg/cmd/version.go | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a80c237..1ed7be9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.12.2" + ".": "1.12.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c3037b4..0ce1f51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.12.3 (2026-06-25) + +Full Changelog: [v1.12.2...v1.12.3](https://github.com/anthropics/anthropic-cli/compare/v1.12.2...v1.12.3) + +### Chores + +* **api:** accept user profile ID's when counting tokens ([ac6bf4b](https://github.com/anthropics/anthropic-cli/commit/ac6bf4b7c0b702d1886394a9bc4c61ab441c7354)) +* **docs:** updates to descriptions and example values ([7708932](https://github.com/anthropics/anthropic-cli/commit/77089320c047ef10a0b5a81d00d4bbfd546bcc7a)) + ## 1.12.2 (2026-06-24) Full Changelog: [v1.12.1...v1.12.2](https://github.com/anthropics/anthropic-cli/compare/v1.12.1...v1.12.2) diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index e8d823c..28c1f15 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "1.12.2" // x-release-please-version +const Version = "1.12.3" // x-release-please-version