Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

scripting changedcli-sdks-libraries/cli/scripting

Nearest release: v2.1.334, published 11 hours before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+3added
Lines−3removed
From line 96 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits15to this page, all time

The whole hunk

from line 96, old and new numbered
/
lines
from line 96
9696 
9797## Use the CLI from Claude Code
9898 
99[Claude Code](https://code.claude.com/docs/en/overview) can use the `ant` CLI out of the box. With the CLI installed and authenticated, you can ask Claude Code to operate on your API resources directly. For example:
99[Claude Code](https://code.claude.com/docs/en/overview) can run the `ant` CLI for you. With the CLI [installed and authenticated](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart), you can ask Claude Code to operate on your API resources directly. For example:
100100 
101101* “List my recent agent sessions and summarize which ones errored.”
102102* “Upload every PDF in `./reports` to the Files API and print the resulting IDs.”
103103* “Pull the events for session `session_01...` and tell me where the agent got stuck.”
104104 
105Claude Code runs `ant` commands, parses the structured output, and reasons over the results (no custom integration code required).
105Claude Code runs `ant` commands, parses the structured output, and uses the results to complete your request (no custom integration code required).
106106 
107107## Authenticate curl requests with CLI credentials
108108 
109Scripts that call the API with `curl` or another HTTP client can use the credentials stored by [`ant auth login`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart#authentication) instead of a static API key. The OAuth access token goes in the `Authorization` header as a bearer token; the `x-api-key` header is only for static API keys.
109To call the API with `curl` or another HTTP client, use your [`ant auth login`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/quickstart#authentication) credentials instead of a [Developer API key](https://platform.claude.com/docs/en/manage-claude/api-keys). The OAuth access token goes in the `Authorization` header as a bearer token, and `x-api-key` is only for API keys. In CI, use [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation).
110110 
111111`ant auth print-credentials --access-token` prints the active profile’s access token, refreshing it first if it is expired or near expiry:
112112 
Feedback