What this read moved
1–15 of 15api/overview Changed · +3 / -3 lines
from line 44
4444
4545| Header | Value | Required |
4646| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47| `x-api-key` | Your API key from Console | One of `x-api-key` or `Authorization` |
48| `Authorization` | `Bearer <token>`, where `<token>` is a short-lived access token obtained from `POST /v1/oauth/token` through [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) | One of `x-api-key` or `Authorization` |
47| `Authorization` | `Bearer <token>`, where `<token>` is your API key or a short-lived access token obtained from `POST /v1/oauth/token` through [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/workload-identity-federation) | Yes, unless `x-api-key` is set |
48| `x-api-key` | Your API key from Console. Legacy fallback for `Authorization`, still supported | No |
4949| `anthropic-workspace-id` | ID of the [workspace](https://platform.claude.com/docs/en/manage-claude/workspaces) the request runs in (for example, `wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ`). See [Select a workspace](https://platform.claude.com/docs/en/manage-claude/authentication#select-a-workspace). | Required with a multi-workspace API key. Optional for other API keys. Not used with Workload Identity Federation tokens, which select a workspace at token exchange. |
5050| `anthropic-version` | API version (for example, `2023-06-01`) | Yes |
5151| `content-type` | `application/json` | Yes |
from line 64
6464
6565**Benefits:**
6666
67* Automatic header management (`x-api-key`, `anthropic-version`, `content-type`)
67* Automatic header management (authentication, `anthropic-version`, `content-type`)
6868* Type-safe request and response handling
6969* Built-in retry logic and error handling
7070* Streaming support
cli-sdks-libraries/cli/scripting Changed · +10 / -83 lines
### Run the applied agent from the shell
from line 8
88
99## Version-controlling API resources
1010
11You can use the CLI to version control API resources such as skills, agents, environments, or deployments as YAML files in your repository and keep them in sync with the Claude API.
11To keep agents, environments, and other Claude Managed Agents resources as files in your repository, see [Manage resources as code with ant apply](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply).
1212
13<Note>
14 For more information on these resources, see [Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview).
15</Note>
13### Run the applied agent from the shell
1614
17<Steps>
18 <Step title="Define your agent">
19 Write the agent definition to `summarizer.agent.yaml`:
15Once an agent and environment exist, you can drive a session from the shell:
2016
21 ```yaml summarizer.agent.yaml
22 name: Summarizer
23 model: claude-opus-5
24 system: |
25 You are a helpful assistant that writes concise summaries.
26 tools:
27 - type: agent_toolset_20260401
28 ```
29 </Step>
30
31 <Step title="Create the agent">
32 ```bash
33 ant beta:agents create < summarizer.agent.yaml
34 ```
35
36 ```json Output
37 {
38 "id": "agent_011CYm1BLqPXpQRk5khsSXrs",
39 "version": 1,
40 "name": "Summarizer",
41 "model": "claude-opus-5"
42 /* ... */
43 }
44 ```
45
46 Note the `id` from the response. You'll pass it to the session create command in a later step.
47
48 <Tip>
49 Check `summarizer.agent.yaml` into your repository and keep it in sync with the API in your CI pipeline. The update command needs the agent ID and current version as flags:
50
51 ```bash CLI
52 ant beta:agents update --agent-id agent_011CYm1BLqPXpQRk5khsSXrs --version 1 < summarizer.agent.yaml
53 ```
54 </Tip>
55 </Step>
56
57 <Step title="Define the environment">
58 A session runs in an [environment](https://platform.claude.com/docs/en/api/cli/beta/environments), which defines the sandbox it executes in. Write the environment definition to `summarizer.environment.yaml`:
59
60 ```yaml summarizer.environment.yaml
61 name: summarizer-env
62 config:
63 type: cloud
64 networking:
65 type: unrestricted
66 ```
67 </Step>
68
69 <Step title="Create the environment">
70 ```bash
71 ant beta:environments create < summarizer.environment.yaml
72 ```
73
74 ```json Output
75 {
76 "id": "env_01595EKxaaTTGwwY3kyXdtbs",
77 "name": "summarizer-env"
78 /* ... */
79 }
80 ```
81
82 Note the `id` from the response. You'll pass it to the session create command in a later step.
83
84 <Tip>
85 Check `summarizer.environment.yaml` into your repository and keep it in sync with the API in your CI pipeline. The update command needs the environment ID as a flag:
86
87 ```bash CLI
88 ant beta:environments update --environment-id env_01595EKxaaTTGwwY3kyXdtbs < summarizer.environment.yaml
89 ```
90 </Tip>
91 </Step>
92
17<Steps>
9318 <Step title="Start a session">
94 Paste the agent `id` and environment `id` from the previous outputs into the session create command:
19 Pass the agent and environment IDs to the session create command. After `ant apply`, read them from `claude-lock.json`: each entry under `resources` has an `id`, and for the project in [Manage resources as code with ant apply](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply) the entries are `./agents/summarizer.md` and `./environments/cloud.yaml`.
9520
9621 ```bash
9722 ant beta:sessions create \
from line 45
12045 </Step>
12146
12247 <Step title="Read the conversation">
123 `--transform` runs against each listed event, so this prints the text of every message in order. `--format auto` overrides the interactive explorer that list commands open by default in a terminal:
48 Once the agent has replied, list the events. `--transform` runs against each listed event, so this prints the text of every message in order. `--format auto` overrides the interactive explorer that list commands open by default in a terminal:
12449
12550 ```bash
12651 ant beta:sessions:events list \
12752 --session-id session_01JZCh78XvmxJjiXVy3oSi7K \
128 --transform 'content.0.text' --format auto --raw-output
53 --transform 'content.0.text' \
54 --raw-output \
55 --format auto
12956 ```
13057
13158 ```text Output wrap
from line 61
13461 ```
13562
13663 <Tip>
137 To watch a session as it runs, use `ant beta:sessions:events stream --session-id session_01JZCh78XvmxJjiXVy3oSi7K`. Events are written to stdout as they arrive.
64 To watch a session as it runs, use `ant beta:sessions:events stream --session-id session_01JZCh78XvmxJjiXVy3oSi7K --format jsonl`, which writes each event to stdout as it arrives. Without `--format`, a terminal opens the interactive explorer instead.
13865 </Tip>
13966 </Step>
14067</Steps>
manage-claude/authentication Changed · +6 / -4 lines
from line 8
88
99| Method | Credential | Best for |
1010| ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
11| [API key](https://platform.claude.com/docs/en/manage-claude/authentication#api-keys) | Static `sk-ant-api...` secret in the `x-api-key` header | Local development, prototyping, scripts, and servers where you control secret storage |
11| [API key](https://platform.claude.com/docs/en/manage-claude/authentication#api-keys) | Static `sk-ant-api...` secret sent as a bearer token in the `Authorization` header | Local development, prototyping, scripts, and servers where you control secret storage |
1212| [Workload Identity Federation](https://platform.claude.com/docs/en/manage-claude/authentication#workload-identity-federation) | Short-lived bearer token exchanged from your identity provider's identity token | Production workloads on cloud platforms (AWS, Google Cloud, Azure), CI/CD pipelines, and Kubernetes, where you want to eliminate static secrets |
1313| [App Attest](https://platform.claude.com/docs/en/manage-claude/authentication#app-attest) | Short-lived access token issued to a genuine, attested installation of your registered iOS or macOS app | iOS and macOS apps distributed to end users, where the app calls the Claude API directly with no back end or proxy |
1414
from line 16
1616
1717## API keys
1818
19API keys are static secrets that you generate in the Claude Console and send on every request in the `x-api-key` header.
19API keys are static secrets that you generate in the Claude Console and send on every request as a bearer token in the `Authorization` header.
2020
2121### Key types
2222
from line 37
3737### Create and use a key
3838
3939* **Create a key:** Go to [Settings → API keys](https://platform.claude.com/settings/keys) in the Claude Console and click **Create key**. Name the key and choose an [expiration](https://platform.claude.com/docs/en/manage-claude/authentication#key-expiration). Set **Linked account** to yourself for a personal key, or to a service account for a key shared across multiple users. You can also scope the key to a specific workspace, which lets you skip setting a workspace ID manually in future requests.
40* **Use the key:** Set the `x-api-key` header on direct HTTP requests, or set the `ANTHROPIC_API_KEY` environment variable and the [client SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) pick it up automatically.
40* **Use the key:** Send it as `Authorization: Bearer <key>` on direct HTTP requests, or set the `ANTHROPIC_API_KEY` environment variable and the [client SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) pick it up automatically.
4141
4242```http
4343POST /v1/messages
44x-api-key: YOUR_API_KEY
44Authorization: Bearer YOUR_API_KEY
4545anthropic-version: 2023-06-01
4646content-type: application/json
4747```
48
49The legacy `x-api-key: YOUR_API_KEY` header is still supported in place of `Authorization`.
4850
4951Store API keys in a secrets manager, rotate them periodically, and disable or delete any key you suspect has leaked. On the [API keys page](https://platform.claude.com/settings/keys), **Disable** is reversible (the Admin API reports the key's `status` as `"inactive"`, and **Re-enable** returns it to `"active"`), while **Delete** is permanent: the key is archived and still appears in [List API Keys](https://platform.claude.com/docs/en/api/admin/api_keys/list) with `status: "archived"`. Expired keys can only be deleted. You can also set an [expiration](https://platform.claude.com/docs/en/manage-claude/authentication#key-expiration) when you create a key to limit how long a leaked credential stays usable.
5052
managed-agents/agent-setup Changed · +26 / -21 lines
from line 54
5454
5555 <MultiFileExample language="cli" label="CLI">
5656 ```bash CLI
57 agent=$(ant beta:agents create --format json < coding-assistant.agent.yaml)
58
59 AGENT_ID=$(jq -r '.id' <<< "$agent")
57 ant apply coding-assistant.md
6058 ```
6159
62 <File filename="coding-assistant.agent.yaml">
63 ```yaml
60 <File filename="coding-assistant.md">
61 ```markdown
62 ---
6463 name: Coding Assistant
65 model:
66 id: claude-opus-5
67 system: You are a helpful coding agent.
64 model: claude-opus-5
6865 tools:
6966 - type: agent_toolset_20260401
67 ---
68
69 You are a helpful coding agent.
7070 ```
7171 </File>
7272 </MultiFileExample>
from line 210
210210
211211Like `speed` and `effort`, `inference_geo` is set through the object form of `model`: pass `model` as an object and set `inference_geo` alongside `id`. The field accepts `"us"` or `"global"`. When it's unset, each model request follows the workspace's default inference geo at the time it's served. See [Data residency](https://platform.claude.com/docs/en/manage-claude/data-residency) for the workspace-level geo controls and pricing.
212212
213The following example pins an agent to US inference and prints the `inference_geo` value echoed in the response's `model` object:
213The following example pins an agent to US inference and prints the `inference_geo` value from the agent's `model` object:
214214
215215<CodeGroup defaultLanguage="CLI">
216216 ```bash cURL
from line 230
230230
231231 <MultiFileExample language="cli" label="CLI">
232232 ```bash CLI
233 agent=$(ant beta:agents create --format json < geo-pinned.agent.yaml)
234
235 echo "Inference geo: $(jq -r '.model.inference_geo' <<< "$agent")"
233 ant apply geo-pinned-assistant.md
236234 ```
237235
238 <File filename="geo-pinned.agent.yaml">
239 ```yaml
236 <File filename="geo-pinned-assistant.md">
237 ```markdown
238 ---
240239 name: Geo-pinned assistant
241240 model:
242241 id: claude-opus-5
243242 inference_geo: us
244 system: You are a helpful assistant.
243 ---
244
245 You are a helpful assistant.
245246 ```
246247 </File>
247248 </MultiFileExample>
from line 350
349350
350351Updating an agent generates a new version when the configuration changes. The `version` field is optional: supply it for optimistic concurrency (a mismatch returns a 409), or omit it to apply the update unconditionally (last write wins). Updates to archived agents are rejected.
351352
353With the CLI, edit the agent's file and run `ant apply` again; apply supplies `version` for you.
354
352355<CodeGroup defaultLanguage="CLI">
353356 ```bash cURL
354357 updated_agent=$(curl -fsSL "https://api.anthropic.com/v1/agents/$AGENT_ID" \
from line 372
369372
370373 <MultiFileExample language="cli" label="CLI">
371374 ```bash CLI
372 ant beta:agents update --agent-id "$AGENT_ID" < coding-assistant.agent.yaml
375 ant apply coding-assistant.md
373376 ```
374377
375 <File filename="coding-assistant.agent.yaml">
376 ```yaml
378 <File filename="coding-assistant.md">
379 ```markdown
380 ---
377381 name: Coding Assistant
378 model:
379 id: claude-opus-5
380 system: You are a helpful coding agent. Always write tests.
382 model: claude-opus-5
381383 tools:
382384 - type: agent_toolset_20260401
385 ---
386
387 You are a helpful coding agent. Always write tests.
383388 ```
384389 </File>
385390 </MultiFileExample>
managed-agents/environments Changed · +4 / -4 lines
from line 38
3838
3939 <MultiFileExample language="cli" label="CLI">
4040 ```bash CLI
41 ant beta:environments create < python-dev.environment.yaml
41 ant apply environment.yaml
4242 ```
4343
44 <File filename="python-dev.environment.yaml">
44 <File filename="environment.yaml">
4545 ```yaml
4646 name: python-dev
4747 config:
from line 251
251251
252252 <MultiFileExample language="cli" label="CLI">
253253 ```bash CLI
254 ant beta:environments create < environment.yaml
254 ant apply environment.yaml
255255 ```
256256
257257 <File filename="environment.yaml">
from line 429
429429
430430 <MultiFileExample language="cli" label="CLI">
431431 ```bash CLI
432 ant beta:environments create < environment.yaml
432 ant apply environment.yaml
433433 ```
434434
435435 <File filename="environment.yaml">
managed-agents/github Changed · +8 / -6 lines
from line 49
4949
5050 <MultiFileExample language="cli" label="CLI">
5151 ```bash CLI
52 AGENT_ID=$(ant beta:agents create --transform id --raw-output < code-reviewer.agent.yaml)
52 ant apply code-reviewer.md
5353 ```
5454
55 <File filename="code-reviewer.agent.yaml">
56 ```yaml
55 <File filename="code-reviewer.md">
56 ```markdown
57 ---
5758 name: Code Reviewer
58 model:
59 id: claude-opus-5
60 system: You are a code review assistant with access to GitHub.
59 model: claude-opus-5
6160 mcp_servers:
6261 - type: url
6362 name: github
from line 65
6665 - type: agent_toolset_20260401
6766 - type: mcp_toolset
6867 mcp_server_name: github
68 ---
69
70 You are a code review assistant with access to GitHub.
6971 ```
7072 </File>
7173 </MultiFileExample>
managed-agents/mcp-connector Changed · +6 / -5 lines
from line 53
5353
5454 <MultiFileExample language="cli" label="CLI">
5555 ```bash CLI
56 AGENT_ID=$(ant beta:agents create --transform id --raw-output < github-assistant.agent.yaml)
56 ant apply github-assistant.md
5757 ```
5858
59 <File filename="github-assistant.agent.yaml">
60 ```yaml
59 <File filename="github-assistant.md">
60 ```markdown
61 ---
6162 name: GitHub Assistant
62 model:
63 id: claude-opus-5
63 model: claude-opus-5
6464 mcp_servers:
6565 - type: url
6666 name: github
from line 69
6969 - type: agent_toolset_20260401
7070 - type: mcp_toolset
7171 mcp_server_name: github
72 ---
7273 ```
7374 </File>
7475 </MultiFileExample>
managed-agents/migration Changed · +13 / -9 lines
from line 302
302302
303303 <MultiFileExample language="cli" label="CLI">
304304 ```bash CLI
305 { read -r _ agent_id; read -r _ agent_version; } < <(ant beta:agents create \
306 --transform '{id,version}' --format yaml < task-runner.agent.yaml)
305 ant apply agent.md
307306
308307 session_id=$(ant beta:sessions create \
309308 --agent "{type: agent, id: $agent_id, version: $agent_version}" \
from line 317
318317 ant beta:sessions:events send \
319318 --session-id "$session_id" \
320319 --event "{type: user.message, content: [{type: text, text: \"$task\"}]}" \
321 > /dev/null
320 > /dev/null
322321
323322 # Wait for the session to go idle (grep exits at the first match)
324323 grep -m1 -x 'session.status_idle' <&"$stream" > /dev/null
from line 324
325324 exec {stream}<&-
326325 ```
327326
328 <File filename="task-runner.agent.yaml">
329 ```yaml
327 <File filename="agent.md">
328 ```markdown
329 ---
330330 name: Task Runner
331331 model: claude-opus-5
332332 tools:
333333 - type: agent_toolset_20260401
334 ---
334335 ```
335336 </File>
336337 </MultiFileExample>
from line 1335
13341335
13351336 <MultiFileExample language="cli" label="CLI">
13361337 ```bash CLI
1337 ant beta:agents update --agent-id "$AGENT_ID" < agent.yaml
1338 ant apply agent.md
13381339 ```
13391340
1340 <File filename="agent.yaml">
1341 ```yaml
1341 <File filename="agent.md">
1342 ```markdown
1343 ---
13421344 name: Task Runner
13431345 model: claude-opus-5
1344 system: You are a task automation agent. Complete the task you are given end to end.
13451346 tools:
13461347 - type: agent_toolset_20260401
1348 ---
1349
1350 You are a task automation agent. Complete the task you are given end to end.
13471351 ```
13481352 </File>
13491353 </MultiFileExample>
managed-agents/multiagent-orchestration Changed · +54 / -28 lines
from line 65
6565
6666 <MultiFileExample language="cli" label="CLI">
6767 ```bash CLI
68 ant beta:agents create < coordinator.agent.yaml
68 ant apply engineering-lead.md reviewer.md test-writer.md
6969 ```
7070
71 <File filename="coordinator.agent.yaml">
72 ```yaml
71 <File filename="engineering-lead.md">
72 ```markdown
73 ---
7374 name: Engineering Lead
7475 model: claude-opus-5
75 system: You coordinate engineering work. Delegate code review to the reviewer agent and test writing to the test agent.
7676 tools:
7777 - type: agent_toolset_20260401
7878 multiagent:
7979 type: coordinator
80 agents:
81 - type: agent
82 id: $REVIEWER_AGENT_ID # replace before running command
83 - type: agent
84 id: $TEST_WRITER_AGENT_ID # replace before running command
80 agents: # paths: ant apply substitutes {type: agent, id, version}
81 - ./reviewer.md
82 - ./test-writer.md
83 ---
84
85 You coordinate engineering work. Delegate code review to the reviewer agent and test writing to the test agent.
8586 ```
8687 </File>
88
89 <File filename="reviewer.md">
90 ```markdown
91 ---
92 name: reviewer
93 model: claude-haiku-4-5
94 ---
95
96 You are a code reviewer.
97 ```
98 </File>
99
100 <File filename="test-writer.md">
101 ```markdown
102 ---
103 name: test-writer
104 model: claude-haiku-4-5
105 ---
106
107 You write unit tests.
108 ```
109 </File>
87110 </MultiFileExample>
88111
89112 ```python Python
from line 258
235258* `{"type": "self"}` allows the coordinator to spawn copies of itself. If the session was created with [agent configuration overrides](https://platform.claude.com/docs/en/managed-agents/sessions#override-agent-configuration-for-a-session), those overrides also apply to these copies; roster entries referenced by ID are unaffected.
236259* `{"type": "advisor", "model": "<model id>"}` gives the session's primary thread an advisor it can consult mid-turn. At most one advisor entry per roster. See [Give the session an advisor](https://platform.claude.com/docs/en/managed-agents/multiagent-orchestration#give-the-session-an-advisor).
237260
261In an [`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/scripting#version-controlling-api-resources) agent file (the CLI tab), a roster entry can also be the path to another agent's file, such as `./reviewer.md`. Apply creates that agent first and replaces the path with a pinned `{"type": "agent", "id": ..., "version": ...}` reference.
262
238263The coordinator's configuration, including its `multiagent.agents` roster, is snapshotted when the coordinator is created or updated. Referenced agents stay pinned to the versions resolved at that time and do not automatically pick up later updates to their definitions. To delegate to a newer version of a referenced agent, [update the coordinator](https://platform.claude.com/docs/en/managed-agents/agent-setup#update-an-agent) so its roster references that version.
239264
240265The coordinator can only delegate to one level of agents; referencing an agent that has its own `multiagent.agents` roster fails the create or update request with a validation error. A maximum of 20 unique agents can be listed in `multiagent.agents`, but the coordinator can call multiple copies of each agent.
from line 453
428453
429454 <MultiFileExample language="cli" label="CLI">
430455 ```bash CLI
431 research_agent_id=$(ant beta:agents create --transform id --raw-output < researcher.agent.yaml)
456 ant apply coordinator.md researcher.md
432457 ```
433458
434 <File filename="researcher.agent.yaml">
435 ```yaml
459 <File filename="coordinator.md">
460 ```markdown
461 ---
462 name: coordinator
463 model: claude-opus-5
464 tools:
465 - type: agent_toolset_20260401
466 multiagent:
467 type: coordinator
468 agents: # path: ant apply substitutes {type: agent, id, version}
469 - ./researcher.md
470 ---
471 ```
472 </File>
473
474 <File filename="researcher.md">
475 ```markdown
476 ---
436477 name: researcher
437478 model: claude-haiku-4-5
438479 mcp_servers:
from line 483
442483 tools:
443484 - type: mcp_toolset
444485 mcp_server_name: github
486 ---
445487 ```
446488 </File>
447489
448 <File filename="subagent-coordinator.agent.yaml">
449 ```yaml
450 name: coordinator
451 model: claude-opus-5
452 tools:
453 - type: agent_toolset_20260401
454 multiagent:
455 type: coordinator
456 agents:
457 - type: agent
458 id: $research_agent_id # replace before running command
459 ```
460 </File>
461
462490 ```bash CLI
463 coordinator_id=$(ant beta:agents create --transform id --raw-output < subagent-coordinator.agent.yaml)
464
465491 session_id=$(ant beta:sessions create \
466492 --agent "$coordinator_id" \
467493 --environment-id "$environment_id" \
managed-agents/permission-policies Changed · +10 / -6 lines
from line 52
5252
5353 <MultiFileExample language="cli" label="CLI">
5454 ```bash CLI
55 ant beta:agents create < agent.yaml
55 ant apply agent.md
5656 ```
5757
58 <File filename="agent.yaml">
59 ```yaml
58 <File filename="agent.md">
59 ```markdown
60 ---
6061 name: Coding Assistant
6162 model: claude-opus-5
6263 tools:
from line 65
6465 default_config:
6566 permission_policy:
6667 type: always_ask
68 ---
6769 ```
6870 </File>
6971 </MultiFileExample>
from line 244
242244
243245 <MultiFileExample language="cli" label="CLI">
244246 ```bash CLI
245 ant beta:agents create < agent.yaml
247 ant apply agent.md
246248 ```
247249
248 <File filename="agent.yaml">
249 ```yaml
250 <File filename="agent.md">
251 ```markdown
252 ---
250253 name: Dev Assistant
251254 model: claude-opus-5
252255 mcp_servers:
from line 263
260263 default_config:
261264 permission_policy:
262265 type: always_allow
266 ---
263267 ```
264268 </File>
265269 </MultiFileExample>
managed-agents/quickstart Changed · +12 / -14 lines
from line 163
163163
164164 <MultiFileExample language="cli" label="CLI">
165165 ```bash CLI
166 AGENT_ID=$(ant beta:agents create --transform id --raw-output < coding-assistant.agent.yaml)
167
168 echo "Agent ID: $AGENT_ID"
166 ant apply coding-assistant.md
169167 ```
170168
171 <File filename="coding-assistant.agent.yaml">
172 ```yaml
169 <File filename="coding-assistant.md">
170 ```markdown
171 ---
173172 name: Coding Assistant
174 model:
175 id: claude-opus-5
176 system: You are a helpful coding assistant. Write clean, well-documented code.
173 model: claude-opus-5
177174 tools:
178175 - type: agent_toolset_20260401
176 ---
177
178 You are a helpful coding assistant. Write clean, well-documented code.
179179 ```
180180 </File>
181181 </MultiFileExample>
from line 336
336336
337337 The `agent_toolset_20260401` tool type enables the full set of pre-built agent tools (bash, file operations, web search, and more). See [Tools](https://platform.claude.com/docs/en/managed-agents/tools) for the complete list and per-tool configuration options.
338338
339 Save the returned `agent.id`. You'll reference it in every session you create.
339 Save the returned `agent.id` (the CLI's [`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/scripting#version-controlling-api-resources) prints it and records it in `claude-lock.json`). You'll reference it in every session you create.
340340 </Step>
341341
342342 <Step title="Create an environment">
from line 368
368368
369369 <MultiFileExample language="cli" label="CLI">
370370 ```bash CLI
371 ENVIRONMENT_ID=$(ant beta:environments create --transform id --raw-output < quickstart.environment.yaml)
372
373 echo "Environment ID: $ENVIRONMENT_ID"
371 ant apply environment.yaml
374372 ```
375373
376 <File filename="quickstart.environment.yaml">
374 <File filename="environment.yaml">
377375 ```yaml
378376 name: quickstart-env
379377 config:
from line 464
466464 ```
467465 </CodeGroup>
468466
469 Save the returned `environment.id`. You'll reference it in every session you create.
467 Save the returned `environment.id` (also in `claude-lock.json` if you used `ant apply`). You'll reference it in every session you create.
470468
471469 <Tip>
472470 To run the sandbox on your own infrastructure instead of a cloud sandbox, see
managed-agents/skills Changed · +7 / -4 lines
from line 219
219219
220220 <MultiFileExample language="cli" label="CLI">
221221 ```bash CLI
222 ant beta:agents create < agent.yaml
222 ant apply agent.md
223223 ```
224224
225 <File filename="agent.yaml">
226 ```yaml
225 <File filename="agent.md">
226 ```markdown
227 ---
227228 name: Financial Analyst
228229 model: claude-opus-5
229 system: You are a financial analysis agent.
230230 skills:
231231 - type: anthropic
232232 skill_id: xlsx
from line 233
233233 - type: custom
234234 skill_id: skill_01AbCdEfGhIjKlMnOpQrStUv
235235 version: latest
236 ---
237
238 You are a financial analysis agent.
236239 ```
237240 </File>
238241 </MultiFileExample>
managed-agents/tools Changed · +5 / -3 lines
from line 694
694694
695695 <MultiFileExample language="cli" label="CLI">
696696 ```bash CLI
697 ant beta:agents create < agent.yaml
697 ant apply agent.md
698698 ```
699699
700 <File filename="agent.yaml">
701 ```yaml
700 <File filename="agent.md">
701 ```markdown
702 ---
702703 name: Weather Agent
703704 model: claude-opus-5
704705 tools:
from line 715
714715 description: City name
715716 required:
716717 - location
718 ---
717719 ```
718720 </File>
719721 </MultiFileExample>
manage-claude/analytics-api Changed · +1 / -1 lines
from line 81
8181
8282Claude Enterprise Analytics API data is available for dates on or after January 1, 2026.
8383
84**Engagement and adoption endpoints** (user activity, summaries, projects, skills, connectors) return a per-day snapshot for the date you specify. Data for a given day is aggregated at 10:00 UTC the following day and is typically available with a 1-day lag. Exact freshness varies by query, so rather than assuming a fixed lag, check the error response: requesting a date that is not yet available returns a 400 error naming the most recent available day. If data is not available well past the typical lag, it usually indicates a data pipeline failure on Anthropic's side; contact support if the gap persists.
84**Engagement and adoption endpoints** (user activity, summaries, projects, skills, connectors) return a per-day snapshot for the date you specify. Data for a given day is typically available from about 17:00 UTC the following day (a 1-day lag); until then, the most recent available day is usually two days before the current UTC date. Data occasionally arrives later, and exact freshness varies by query, so rather than assuming a fixed time, check the error response: requesting a date that is not yet available returns a 400 error naming the most recent available day. If data is not available well past the typical lag, it usually indicates a data pipeline failure on Anthropic's side; contact support if the gap persists.
8585
8686**Cost and usage endpoints** follow a different freshness model. Data is typically available within four hours of the underlying usage but may take up to 24 hours. Values for a given date can be revised for up to 30 days as late events arrive and reconciliation runs. For invoicing-grade totals, query dates at least 30 days in the past.
8787
managed-agents/self-hosted-sandboxes Changed · +1 / -1 lines
from line 85
8585
8686 <MultiFileExample language="cli" label="CLI">
8787 ```bash CLI
88 ant beta:environments create < environment.yaml
88 ant apply environment.yaml
8989 ```
9090
9191 <File filename="environment.yaml">