2026-10-20
加载中…| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| POST | /v1/messages | 发送消息 | ● 支持 |
| POST | /v1/messages/count_tokens | 统计 token | ◐ 部分支持 |
| GET | /v1/models | 列出模型 | ● 支持 |
| POST | /v1/files | 上传文件 | ● 支持 |
| GET | /v1/files | 列出文件 | ● 支持 |
| GET | /v1/files/{file_id} | 读取文件信息 | ● 支持 |
| DELETE | /v1/files/{file_id} | 删除文件 | ● 支持 |
| GET | /v1/files/{file_id}/content | 下载文件内容 | ● 支持 |
参数与字段的权威定义以 Anthropic 官方文档为准。
/anthropic/v1/messages● 支持modelstring必填◐ 部分支持Body param: The model that will complete your prompt. See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
deepseek-v4-pro、glm-5.3-flash、qwen3.8-flash、claude-opus-5 可调用;deepseek-v4-flash 在此协议面返回 400。
max_tokensnumber必填Body param: The maximum number of tokens to generate before stopping. Note that our models may stop _before_ reaching this maximum. This parameter only specifies the absolute maximum number of tokens to generate. Set to `0` to populate the [prompt cache](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache) without generating a response. Different models have different maximum values for this parameter. See [models](https://platform.claude.com/docs/en/about-claude/models/overview) for details.
限制输出 token,思考也占用预算。
messagesarray必填◐ 部分支持Body param: Input messages. Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn. Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages. If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response. Example with a single `user` message: ```json [{ "role": "user", "content": "Hello, Claude" }] ``` Example with multiple conversational turns: ```json [ { "role": "user", "content": "Hello there." }, { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, { "role": "user", "content": "Can you explain LLMs in plain English?" } ] ``` Example with a partially-filled response from Claude: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent: ```json { "role": "user", "content": "Hello, Claude" } ``` ```json { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } ``` See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. There is a limit of 100,000 messages in a single request.
文本和工具往返生效;document 的托管 file_id 返回 400,qwen3.8-flash 可读取内联 PDF;图片有模型尺寸限制。
contentstring | array必填Message content: a plain string (shorthand for one text block) or an array of content blocks such as text, image, document, tool_use and tool_result.
rolestring必填Who produced the message. Use user for your turns and assistant to replay earlier model turns; system-role messages are accepted by the shape but system instructions normally go in the top-level system field.
streamboolean可选◐ 部分支持Body param: Whether to incrementally stream the response using server-sent events. See [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) for details.
流式正文和工具事件可用;可能在正文前出现额外 message_delta,message_start 的用量为 0。
systemstring | array可选Body param: System prompt. A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role).
已验证生效。
temperaturenumber可选top_pnumber可选top_knumber可选stop_sequencesarray可选◐ 部分支持Body param: Custom text sequences that will cause the model to stop generating. Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`. If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence.
deepseek-v4-pro、qwen3.8-flash 生效;glm-5.3-flash 文本截断但 stop_reason 和 stop_sequence 未准确反映。
toolsarray可选Body param: Definitions of tools that the model may use. If 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. There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)). Each tool definition includes: - `name`: Name of the tool. - `description`: Optional, but strongly-recommended description of the tool. - `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. For example, if you defined `tools` as: ```json [ { "name": "get_stock_price", "description": "Get the current stock price for a given ticker symbol.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string", "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." } }, "required": ["ticker"] } } ] ``` And 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: ```json [ { "type": "tool_use", "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "name": "get_stock_price", "input": { "ticker": "^GSPC" } } ] ``` You 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: ```json [ { "type": "tool_result", "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "content": "259.75 USD" } ] ``` Tools 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. See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
已验证生效。
tool_choiceobject可选◐ 部分支持Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
qwen3.8-flash 四种模式生效;deepseek-v4-pro 忽略 any/tool/none;glm-5.3-flash 忽略 none。
typestring必填disable_parallel_tool_useboolean可选○ 当前不生效Whether to disable parallel tool use. Defaults to `false`. If set to `true`, the model will output exactly one tool use.
接受但当前不生效。true 仍可能返回多个工具调用。
namestring必填The name of the tool to use.
metadataobject可选◐ 部分支持Body param: An object describing metadata about the request.
接受 metadata;metadata.user_id 由同协议线路传递,不承诺上游回显。
user_idstring可选An external identifier for the user who is associated with the request. This should be a uuid, hash value, or other opaque identifier. Anthropic may use this id to help detect abuse. Do not include any identifying information such as name, email address, or phone number.
cache_controlobject可选◐ 部分支持Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
deepseek-v4-pro、qwen3.8-flash、glm-5.3-flash 有隐式缓存命中,但不能据此确认标记生效;claude-opus-5 未命中缓存,ttl=1h 未见效果。
typestring必填Always `ephemeral`. Discriminator that marks this object as a CacheControlEphemeral in a `type`-tagged union.
ttlstring可选The time-to-live for the cache control breakpoint. This may be one the following values: - `5m`: 5 minutes - `1h`: 1 hour Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
containerstring | object可选○ 当前不生效接受并忽略 container;平台尚未实现此能力。
idstring可选Container id
skillsarray可选List of skills to load in the container
inference_geostring可选○ 当前不生效接受并忽略 inference_geo;平台尚未实现此能力。
output_configobject可选Body param: Configuration options for the model's output, such as the output format.
effortstring可选◐ 部分支持All possible effort levels.
deepseek-v4-pro 仅 high/xhigh 可用,其余返回 400;qwen3.8-flash 全档返回 400;glm-5.3-flash 接受各档但消耗不随档位单调变化。
formatobject可选◐ 部分支持A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
json_schema 在 deepseek-v4-pro、qwen3.8-flash 生效;glm-5.3-flash 与 thinking 同传返回 400。
service_tierstring可选○ 当前不生效接受并忽略 service_tier;平台尚未实现此能力。
thinkingobject可选◐ 部分支持Body param: Configuration for enabling Claude's extended thinking. When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit. See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
disabled 在 deepseek-v4-pro、qwen3.8-flash 生效;glm-5.3-flash 携带任何 thinking 都返回 400。adaptive 在已测的 deepseek-v4-pro、qwen3.8-flash 也返回 400。
budget_tokensnumber必填◐ 部分支持Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than `max_tokens`. See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
deepseek-v4-pro、qwen3.8-flash 接受,但预算不构成可靠上限;glm-5.3-flash 返回 400。
typestring必填displaystring可选○ 当前不生效Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
接受但当前不生效。omitted 仍返回完整思考内容。
context_managementobject可选○ 当前不生效接受并忽略 context_management;平台尚未实现此能力。
diagnosticsobject可选○ 当前不生效接受并忽略 diagnostics;平台尚未实现此能力。
mcp_serversarray可选○ 当前不生效接受并忽略 mcp_servers;平台尚未实现此能力。
speedstring可选○ 当前不生效接受并忽略 speed;平台尚未实现此能力。
output_formatobject可选○ 当前不生效接受并忽略此旧字段;结构化输出使用 output_config.format。
compactionobject可选○ 未支持已识别 compaction;尚未实现,传入返回 400 并明确说明不支持。
fallback_credit_tokenstring可选○ 未支持已识别 fallback_credit_token;尚未实现,传入返回 400 并明确说明不支持。
fallbacksstring可选○ 未支持已识别 fallbacks;尚未实现,传入返回 400 并明确说明不支持。
200
stream=true 时以 SSE 增量返回(text/event-stream)。
支持顶层 cache_control、top_k、metadata.user_id、output_config.format、thinking.display 与 anthropic-user-profile-id。仅原生 Anthropic 能表达的选项会限制路由;没有可保真供应时返回参数错误。anthropic-workspace-id 尚未支持,非空值返回 400。container、inference_geo 与 service_tier 接受并忽略;其他扩展见字段支持标注。 未知顶层字段原样转发给同协议上游,由上游决定是否接受;已声明字段的类型与取值范围仍会校验,不合法时返回 400 并点名字段。
错误按 Anthropic 格式返回,参见 错误码
Message created
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique object identifier. The format and length of IDs may change over time. |
| container | null | object | Information about the container used in the request (for the code execution tool) |
| container.id | string | Identifier for the container used in this request |
| container.expires_at | string | The time at which the container will expire. |
| container.skills | null | array<object> | Skills loaded in the container |
| content | array<object> | Content generated by the model. This is an array of content blocks, each of which has a `type` that determines its shape. Example: ```json [{ "type": "text", "text": "Hi, I'm Claude." }] ``` If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output. For example, if the input `messages` were: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Then the response `content` might be: ```json [{ "type": "text", "text": "B)" }] ``` |
| content[].citations | null | array<object> | Citations supporting the text block. The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`. |
| content[].text | string | The text generated by the model. |
| content[].type | string | Always `text`. Discriminator that marks this object as a TextBlock in a `type`-tagged union. / Always `thinking`. Discriminator that marks this object as a ThinkingBlock in a `type`-tagged union. / Always `redacted_thinking`. Discriminator that marks this object as a RedactedThinkingBlock in a `type`-tagged union. / Always `tool_use`. Discriminator that marks this object as a ToolUseBlock in a `type`-tagged union. / Always `server_tool_use`. Discriminator that marks this object as a ServerToolUseBlock in a `type`-tagged union. / Always `web_search_tool_result`. Discriminator that marks this object as a WebSearchToolResultBlock in a `type`-tagged union. / Always `web_fetch_tool_result`. Discriminator that marks this object as a WebFetchToolResultBlock in a `type`-tagged union. / Always `code_execution_tool_result`. Discriminator that marks this object as a CodeExecutionToolResultBlock in a `type`-tagged union. / Always `bash_code_execution_tool_result`. Discriminator that marks this object as a BashCodeExecutionToolResultBlock in a `type`-tagged union. / Always `text_editor_code_execution_tool_result`. Discriminator that marks this object as a TextEditorCodeExecutionToolResultBlock in a `type`-tagged union. / Always `tool_search_tool_result`. Discriminator that marks this object as a ToolSearchToolResultBlock in a `type`-tagged union. / Always `container_upload`. Discriminator that marks this object as a ContainerUploadBlock in a `type`-tagged union. |
| content[].signature | string | A value used to verify that this thinking block was generated by Claude when it is passed back to the API. This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact. See extended thinking for details. |
| content[].thinking | string | The text of Claude's thinking process for this block. |
| content[].data | string | The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content. Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation. See extended thinking for details. |
| content[].id | string | Id of the tool call; send it back as tool_use_id in the tool_result block that answers it. / Id of the server tool call; the matching result block repeats it as tool_use_id. |
| content[].caller | object | Which party invoked the tool: the model directly or a code execution tool. / Which party invoked the server tool: the model directly or a code execution tool. / Which party invoked the search: the model directly or a code execution tool. / Which party invoked the fetch: the model directly or a code execution tool. |
| content[].input | any | Arguments the model chose, as a JSON object that follows the tool's input_schema. / Arguments the model passed to the server tool, as a JSON object. |
| content[].name | string | Name of the tool the model wants to call. / Name of the server tool the model called, such as web_search, web_fetch or code_execution. |
| content[].toolset_name | null | string | For a toolset member tool_use, the toolset family. |
| content[].content | object | array<object> | object | object | object | object | object | Search results (array of web_search_result blocks) or an error object. / The fetched document or an error object. / Result of the code execution: a result block, an encrypted result block, or an error object. / Result of the bash command: a result block or an error object. / Result of the text editor command: a view, create or str_replace result block, or an error object. / Result of the tool search: a search result block that lists tool references, or an error object. |
| content[].tool_use_id | string | Id of the web_search server tool call this result belongs to. / Id of the web_fetch server tool call this result belongs to. / Id of the code_execution server tool call this result belongs to. / Id of the bash_code_execution server tool call this result belongs to. / Id of the text_editor_code_execution server tool call this result belongs to. / Id of the tool search server tool call this result belongs to. |
| content[].file_id | string | Id of the file that was uploaded into the code execution container. |
| model | string | The model that will complete your prompt. See models for additional details and options. |
| role | string | Conversational role of the generated message. This will always be `"assistant"`. |
| stop_details | null | object | Structured information about a refusal. |
| stop_details.category | null | string | The policy category that triggered a refusal. - `cyber` - The request could enable cyber harm, such as malware or exploit development. Benign cybersecurity work can also trigger this category. - `bio` - The request could enable biological harm, such as dangerous lab methods. Beneficial life sciences work can also trigger this category. - `frontier_llm` - The request could assist the development of competing AI models, which is restricted under Anthropic's commercial terms. Benign machine learning work can also trigger this category. - `reasoning_extraction` - The request asks the model to reproduce its internal reasoning in the response text. To get reasoning in a structured form instead, use adaptive thinking. - `general_harms` - The request could be related to an area that was determined as harmful. Benign work might sometimes trigger this category. |
| stop_details.explanation | null | string | Human-readable explanation of the refusal. This text is not guaranteed to be stable. `null` when no explanation is available for the category. |
| stop_details.type | string | Always `refusal`. Discriminator that marks this object as a RefusalStopDetails in a `type`-tagged union. |
| stop_reason | null | string | The reason that we stopped. This may be one the following values: - `"end_turn"`: the model reached a natural stopping point - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated - `"tool_use"`: the model invoked one or more tools - `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue. - `"refusal"`: when streaming classifiers intervene to handle potential policy violations - `"model_context_window_exceeded"`: we exceeded the model's context window In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise. |
| stop_sequence | null | string | Which custom stop sequence was generated, if any. This value will be a non-null string if one of your custom stop sequences was generated. |
| type | string | Object type. For Messages, this is always `"message"`. |
| usage | object | Billing and rate-limit usage. Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems. Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response. For example, `output_tokens` will be non-zero, even for an empty string response from Claude. Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`. |
| usage.cache_creation | null | object | Breakdown of cached tokens by TTL |
| usage.cache_creation_input_tokens | null | number | The number of input tokens used to create the cache entry. |
| usage.cache_read_input_tokens | null | number | The number of input tokens read from the cache. |
| usage.inference_geo | null | string | The geographic region where inference was performed for this request. |
| usage.input_tokens | number | The number of input tokens which were used. |
| usage.output_tokens | number | The number of output tokens which were used. |
| usage.output_tokens_details | null | object | Breakdown of output tokens by category. `output_tokens` remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you. |
| usage.server_tool_use | null | object | The number of server tool requests. |
| usage.service_tier | null | string | If the request used the priority, standard, or batch tier. |
text/event-stream — chunk / 事件对象
| 名称 | 类型 | 说明 |
|---|---|---|
| delta | object | Final fields of the message sent with message_delta: why generation stopped and the container. / The incremental change to the content block at index. |
| delta.container | null | object | Information about the container used in the request (for the code execution tool) |
| delta.stop_details | null | object | Structured information about a refusal. |
| delta.stop_reason | null | string | Why the model stopped; null while the message is still generating. |
| delta.stop_sequence | null | string | The custom stop sequence that was matched; null unless stop_reason is stop_sequence. |
| delta.text | string | Text fragment to append to the text block. |
| delta.type | string | Always `text_delta`. Discriminator that marks this object as a TextDelta in a `type`-tagged union. / Always `input_json_delta`. Discriminator that marks this object as a InputJSONDelta in a `type`-tagged union. / Always `citations_delta`. Discriminator that marks this object as a CitationsDelta in a `type`-tagged union. / Always `thinking_delta`. Discriminator that marks this object as a ThinkingDelta in a `type`-tagged union. / Always `signature_delta`. Discriminator that marks this object as a SignatureDelta in a `type`-tagged union. |
| delta.partial_json | string | Fragment of the tool input JSON string; concatenate all fragments of a block and parse the result when the block stops. |
| delta.citation | object | The citation to attach to the text block being streamed. |
| delta.thinking | string | The incremental `thinking` text for this content block. Concatenate the `thinking` values of successive `thinking_delta` events to assemble the block's full `thinking` value. |
| delta.signature | string | The `signature` for this thinking block: an opaque value used to verify that the block was generated by Claude when it is passed back to the API. Delivered in a `signature_delta` event just before the block's `content_block_stop` event. |
| type | string | Always `message_delta`. Discriminator that marks this object as a RawMessageDeltaEvent in a `type`-tagged union. / Always `content_block_delta`. Discriminator that marks this object as a RawContentBlockDeltaEvent in a `type`-tagged union. / Always `message_start`. Discriminator that marks this object as a RawMessageStartEvent in a `type`-tagged union. / Always `message_stop`. Discriminator that marks this object as a RawMessageStopEvent in a `type`-tagged union. / Always `content_block_start`. Discriminator that marks this object as a RawContentBlockStartEvent in a `type`-tagged union. / Always `content_block_stop`. Discriminator that marks this object as a RawContentBlockStopEvent in a `type`-tagged union. |
| usage | object | Billing and rate-limit usage. Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems. Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response. For example, `output_tokens` will be non-zero, even for an empty string response from Claude. Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`. |
| usage.cache_creation_input_tokens | null | number | The cumulative number of input tokens used to create the cache entry. |
| usage.cache_read_input_tokens | null | number | The cumulative number of input tokens read from the cache. |
| usage.input_tokens | null | number | The cumulative number of input tokens which were used. |
| usage.output_tokens | number | The cumulative number of output tokens which were used. |
| usage.output_tokens_details | null | object | Breakdown of output tokens by category. `output_tokens` remains the inclusive, authoritative total used for billing. This object provides a read-only decomposition for observability — for example, how many of the billed output tokens were spent on internal reasoning that may have been summarized before being returned to you. |
| usage.server_tool_use | null | object | The number of server tool requests. |
| index | number | Zero-based index of the content block this delta applies to. / Zero-based index of the content block that starts. / Zero-based index of the content block that ends. |
| message | object | The complete Message object being started; its content is empty at message_start and filled by the following content_block events. |
| message.id | string | Unique object identifier. The format and length of IDs may change over time. |
| message.container | null | object | Information about the container used in the request (for the code execution tool) |
| message.content | array<object> | Content generated by the model. This is an array of content blocks, each of which has a `type` that determines its shape. Example: ```json [{ "type": "text", "text": "Hi, I'm Claude." }] ``` If the request input `messages` ended with an `assistant` turn, then the response `content` will continue directly from that last turn. You can use this to constrain the model's output. For example, if the input `messages` were: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Then the response `content` might be: ```json [{ "type": "text", "text": "B)" }] ``` |
| message.model | string | The model that will complete your prompt. See models for additional details and options. |
| message.role | string | Conversational role of the generated message. This will always be `"assistant"`. |
| message.stop_details | null | object | Structured information about a refusal. |
| message.stop_reason | null | string | The reason that we stopped. This may be one the following values: - `"end_turn"`: the model reached a natural stopping point - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated - `"tool_use"`: the model invoked one or more tools - `"pause_turn"`: we paused a long-running turn. You may provide the response back as-is in a subsequent request to let the model continue. - `"refusal"`: when streaming classifiers intervene to handle potential policy violations - `"model_context_window_exceeded"`: we exceeded the model's context window In non-streaming mode this value is always non-null. In streaming mode, it is null in the `message_start` event and non-null otherwise. |
| message.stop_sequence | null | string | Which custom stop sequence was generated, if any. This value will be a non-null string if one of your custom stop sequences was generated. |
| message.type | string | Object type. For Messages, this is always `"message"`. |
| message.usage | object | Billing and rate-limit usage. Anthropic's API bills and rate-limits by token counts, as tokens represent the underlying cost to our systems. Under the hood, the API transforms requests into a format suitable for the model. The model's output then goes through a parsing stage before becoming an API response. As a result, the token counts in `usage` will not match one-to-one with the exact visible content of an API request or response. For example, `output_tokens` will be non-zero, even for an empty string response from Claude. Total input tokens in a request is the summation of `input_tokens`, `cache_creation_input_tokens`, and `cache_read_input_tokens`. |
| content_block | object | The content block as it starts, with empty text or input to be filled by deltas. |
| content_block.citations | null | array<object> | Citations supporting the text block. The type of citation returned will depend on the type of document being cited. Citing a PDF results in `page_location`, plain text results in `char_location`, and content document results in `content_block_location`. |
| content_block.text | string | The text generated by the model. |
| content_block.type | string | Always `text`. Discriminator that marks this object as a TextBlock in a `type`-tagged union. / Always `thinking`. Discriminator that marks this object as a ThinkingBlock in a `type`-tagged union. / Always `redacted_thinking`. Discriminator that marks this object as a RedactedThinkingBlock in a `type`-tagged union. / Always `tool_use`. Discriminator that marks this object as a ToolUseBlock in a `type`-tagged union. / Always `server_tool_use`. Discriminator that marks this object as a ServerToolUseBlock in a `type`-tagged union. / Always `web_search_tool_result`. Discriminator that marks this object as a WebSearchToolResultBlock in a `type`-tagged union. / Always `web_fetch_tool_result`. Discriminator that marks this object as a WebFetchToolResultBlock in a `type`-tagged union. / Always `code_execution_tool_result`. Discriminator that marks this object as a CodeExecutionToolResultBlock in a `type`-tagged union. / Always `bash_code_execution_tool_result`. Discriminator that marks this object as a BashCodeExecutionToolResultBlock in a `type`-tagged union. / Always `text_editor_code_execution_tool_result`. Discriminator that marks this object as a TextEditorCodeExecutionToolResultBlock in a `type`-tagged union. / Always `tool_search_tool_result`. Discriminator that marks this object as a ToolSearchToolResultBlock in a `type`-tagged union. / Always `container_upload`. Discriminator that marks this object as a ContainerUploadBlock in a `type`-tagged union. |
| content_block.signature | string | A value used to verify that this thinking block was generated by Claude when it is passed back to the API. This is an opaque field and should not be interpreted or parsed. When passing thinking blocks back to the API (required when using tools with extended thinking), pass them back exactly as received, with this field intact. See extended thinking for details. |
| content_block.thinking | string | The text of Claude's thinking process for this block. |
| content_block.data | string | The contents of this redacted thinking block, returned when portions of the model's thinking were safety-redacted. This field is opaque and encrypted, with no readable content. Pass `redacted_thinking` blocks back to the API unchanged when continuing a multi-turn conversation. See extended thinking for details. |
| content_block.id | string | Id of the tool call; send it back as tool_use_id in the tool_result block that answers it. / Id of the server tool call; the matching result block repeats it as tool_use_id. |
| content_block.caller | object | Which party invoked the tool: the model directly or a code execution tool. / Which party invoked the server tool: the model directly or a code execution tool. / Which party invoked the search: the model directly or a code execution tool. / Which party invoked the fetch: the model directly or a code execution tool. |
| content_block.input | any | Arguments the model chose, as a JSON object that follows the tool's input_schema. / Arguments the model passed to the server tool, as a JSON object. |
| content_block.name | string | Name of the tool the model wants to call. / Name of the server tool the model called, such as web_search, web_fetch or code_execution. |
| content_block.toolset_name | null | string | For a toolset member tool_use, the toolset family. |
| content_block.content | object | array<object> | object | object | object | object | object | Search results (array of web_search_result blocks) or an error object. / The fetched document or an error object. / Result of the code execution: a result block, an encrypted result block, or an error object. / Result of the bash command: a result block or an error object. / Result of the text editor command: a view, create or str_replace result block, or an error object. / Result of the tool search: a search result block that lists tool references, or an error object. |
| content_block.tool_use_id | string | Id of the web_search server tool call this result belongs to. / Id of the web_fetch server tool call this result belongs to. / Id of the code_execution server tool call this result belongs to. / Id of the bash_code_execution server tool call this result belongs to. / Id of the text_editor_code_execution server tool call this result belongs to. / Id of the tool search server tool call this result belongs to. |
| content_block.file_id | string | Id of the file that was uploaded into the code execution container. |
/anthropic/v1/messages/count_tokens◐ 部分支持modelstring必填Body param: The model that will complete your prompt. See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
必填并校验存在性,用于选择原生线路和本地分词器。
messagesarray必填◐ 部分支持Body param: Input messages. Our models are trained to operate on alternating `user` and `assistant` conversational turns. When creating a new `Message`, you specify the prior conversational turns with the `messages` parameter, and the model then generates the next `Message` in the conversation. Consecutive `user` or `assistant` turns in your request will be combined into a single turn. Each input message must be an object with a `role` and `content`. You can specify a single `user`-role message, or you can include multiple `user` and `assistant` messages. If the final message uses the `assistant` role, the response content will continue immediately from the content in that message. This can be used to constrain part of the model's response. Example with a single `user` message: ```json [{ "role": "user", "content": "Hello, Claude" }] ``` Example with multiple conversational turns: ```json [ { "role": "user", "content": "Hello there." }, { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, { "role": "user", "content": "Can you explain LLMs in plain English?" } ] ``` Example with a partially-filled response from Claude: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent: ```json { "role": "user", "content": "Hello, Claude" } ``` ```json { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } ``` See [input examples](https://platform.claude.com/docs/en/build-with-claude/working-with-messages). Note that if you want to include a [system prompt](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. There is a limit of 100,000 messages in a single request.
原生路径保留消息;本地使用 o200k 或按模型族校准的估算,图片按已知模型规则估算,未知尺寸使用近似额度;不下载图片 URL。
contentstring | array必填Message content: a plain string (shorthand for one text block) or an array of content blocks such as text, image, document, tool_use and tool_result.
rolestring必填Who produced the message. Use user for your turns and assistant to replay earlier model turns; system-role messages are accepted by the shape but system instructions normally go in the top-level system field.
systemstring | array可选◐ 部分支持Body param: System prompt. A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role).
原生透传;本地计入估算。
toolsarray可选◐ 部分支持Body param: Definitions of tools that the model may use. If 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. There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)). Each tool definition includes: - `name`: Name of the tool. - `description`: Optional, but strongly-recommended description of the tool. - `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. For example, if you defined `tools` as: ```json [ { "name": "get_stock_price", "description": "Get the current stock price for a given ticker symbol.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string", "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." } }, "required": ["ticker"] } } ] ``` And 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: ```json [ { "type": "tool_use", "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "name": "get_stock_price", "input": { "ticker": "^GSPC" } } ] ``` You 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: ```json [ { "type": "tool_result", "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "content": "259.75 USD" } ] ``` Tools 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. See our [guide](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview) for more details.
原生透传;本地计入定义与包装的估算。
tool_choiceobject可选◐ 部分支持Body param: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all.
原生透传;本地计入估算。
typestring必填Disable tool calls for this request.
disable_parallel_tool_useboolean可选Whether to disable parallel tool use. Defaults to `false`. If set to `true`, the model will output exactly one tool use.
namestring必填The name of the tool to use.
cache_controlobject可选◐ 部分支持Body param: Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
原生路径保留消息内标记;计数不能预测缓存命中或计费。
typestring必填Always `ephemeral`. Discriminator that marks this object as a CacheControlEphemeral in a `type`-tagged union.
ttlstring可选The time-to-live for the cache control breakpoint. This may be one the following values: - `5m`: 5 minutes - `1h`: 1 hour Defaults to `5m`. See [prompt caching pricing](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) for details.
output_configobject可选◐ 部分支持Body param: Configuration options for the model's output, such as the output format.
原生路径透传;本地不承诺其附加模板的精确计数。
effortstring可选All possible effort levels.
formatobject可选A schema to specify Claude's output format in responses. See [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
thinkingobject可选◐ 部分支持Body param: Configuration for enabling Claude's extended thinking. When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit. See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
原生路径透传;本地不承诺思考模板精确计数。
budget_tokensnumber必填Determines how many tokens Claude can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than `max_tokens`. See [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) for details.
typestring必填Let the model choose its reasoning budget, subject to output_config.effort when supplied.
displaystring可选Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.
200
按模型族校准的估算值(包括中文和工具定义),响应头为 x-praxis-token-count: estimated;不能用作精确用量或计费依据。
错误按 Anthropic 格式返回,参见 错误码
Token count
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| input_tokens | number | The total number of tokens across the provided list of messages, system prompt, and tools. |
/anthropic/v1/models● 支持limitnumber可选query: Number of items per page.
已验证生效。
before_idstring可选query:
已验证生效。
after_idstring可选query:
已验证生效。
200
始终返回 capabilities、max_input_tokens、max_tokens;目录无法确定的值为 null,不将总上下文窗口冒充独立输入上限。非空 anthropic-workspace-id 返回 400;尚不按 anthropic-beta 选择目录版本。
错误按 Anthropic 格式返回,参见 错误码
Models listed
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique model identifier. |
| data[].capabilities | null | object | Model capability information. |
| data[].created_at | string | RFC 3339 datetime string representing the time at which the model was released. May be set to an epoch value if the release date is unknown. |
| data[].display_name | string | A human-readable name for the model. |
| data[].max_input_tokens | null | number | Maximum input context window size in tokens for this model. |
| data[].max_tokens | null | number | Maximum value for the `max_tokens` parameter when using this model. |
| data[].type | string | Object type. For Models, this is always `"model"`. |
| has_more | boolean | |
| first_id | null | string | |
| last_id | null | string |
/anthropic/v1/files● 支持filestring必填◐ 部分支持Body param: The file to upload. Only the final path component of the part's `filename` is kept; an absent or empty `filename` is replaced with `unnamed` plus the extension for the file's stored `mime_type`, when known.
支持文本、PDF 和 PNG;按文件内容识别类型,不支持任意二进制。
expires_in_secondsnumber可选◐ 部分支持Body param: Seconds from upload until the file expires and its bytes become permanently unavailable. Must be between 3600 (one hour) and 7776000 (ninety days).
表单字段支持 3600–7776000 秒;作为查询参数传入返回 400,提示改放表单。
200
SDK 0.128.0 上传参数为表单 file 和可选的表单 expires_in_seconds(3600–7776000 秒)。其他表单字段(包括 purpose)返回 400 invalid_request_error,消息形如 "purpose: Extra inputs are not permitted";查询参数只接受 SDK 自带的 beta,其他查询参数返回 400,查询参数 expires_in_seconds 会提示改放表单。平台将上传文件记为 user_data;不支持 anthropic-workspace-id,请求携带该头时返回 400。
错误按 Anthropic 格式返回,参见 错误码
File uploaded
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique object identifier. The format and length of IDs may change over time. |
| created_at | string | RFC 3339 datetime string representing when the file was created. |
| filename | string | Original filename of the uploaded file. |
| mime_type | string | MIME type of the file. |
| size_bytes | number | Size of the file in bytes. |
| type | string | Object type. For files, this is always `"file"`. |
| downloadable | boolean | Whether the file can be downloaded. |
| expires_at | null | string | RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value. |
| scope | null | object | The scope of this file, indicating the context in which it was created (e.g., a session). |
| scope.id | string | The ID of the scoping resource (e.g., the session ID). |
| scope.type | string | The type of scope (e.g., `"session"`). |
/anthropic/v1/files● 支持idsarray可选query: Query param: Restrict the result set to Files whose `id` is in this list. At most 100 entries (after de-duplication). Mutually exclusive with `page` and `limit`. When supplied, the response is always a single page (`next_page` is null). IDs that do not resolve to a visible File — including deleted Files — are silently omitted.
已验证生效。
scope_idstring可选◐ 部分支持query: Query param: Filter by scope ID. Only returns files associated with the specified scope (e.g., a session ID).
需要 anthropic-beta: managed-agents-2026-04-01。非法 scope_id 返回 400,不存在的会话范围返回 404。
limitnumber可选query: Number of items per page.
已验证生效。
pagestring可选query:
已验证生效。
after_idstring可选query: Return the page of files immediately after this file id (older files).
返回该文件之后(更早创建)的一页;不能与 before_id 或 page 同时使用。
before_idstring可选query: Return the page of files immediately before this file id (newer files).
返回该文件之前(更新创建)的一页;不能与 after_id 或 page 同时使用。
200
按创建时间从新到旧排列。用 after_id / before_id 与 limit 分页(两者同时给返回 400),也可以用 page 游标(next_page);三者只能选一个。响应包含 data、has_more、first_id、last_id 与 next_page。ids(最多 100 个去重 ID)与 page、after_id、before_id、limit 互斥。scope_id 需要 anthropic-beta: managed-agents-2026-04-01 请求头;缺少该头返回 400,不存在的会话范围返回 404。anthropic-workspace-id 返回 400。
错误按 Anthropic 格式返回,参见 错误码
Files listed
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique object identifier. The format and length of IDs may change over time. |
| data[].created_at | string | RFC 3339 datetime string representing when the file was created. |
| data[].filename | string | Original filename of the uploaded file. |
| data[].mime_type | string | MIME type of the file. |
| data[].size_bytes | number | Size of the file in bytes. |
| data[].type | string | Object type. For files, this is always `"file"`. |
| data[].downloadable | boolean | Whether the file can be downloaded. |
| data[].expires_at | null | string | RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value. |
| data[].scope | null | object | The scope of this file, indicating the context in which it was created (e.g., a session). |
| next_page | null | string |
先调用「上传文件」,用返回的文件 ID 替换示例文件 ID。
Metadata
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique object identifier. The format and length of IDs may change over time. |
| created_at | string | RFC 3339 datetime string representing when the file was created. |
| filename | string | Original filename of the uploaded file. |
| mime_type | string | MIME type of the file. |
| size_bytes | number | Size of the file in bytes. |
| type | string | Object type. For files, this is always `"file"`. |
| downloadable | boolean | Whether the file can be downloaded. |
| expires_at | null | string | RFC 3339 datetime string representing when the file will expire and become unavailable for download. Null if the file does not expire. For files uploaded with `expires_in_seconds`, this is the upload time plus that value. |
| scope | null | object | The scope of this file, indicating the context in which it was created (e.g., a session). |
| scope.id | string | The ID of the scoping resource (e.g., the session ID). |
| scope.type | string | The type of scope (e.g., `"session"`). |
加载中…agent_… ID。agent 替换为该 ID,保存 sesn_… ID。agent.message 后等待 session.status_idle;也可查询历史事件。SDK 基础地址就是上面的基础地址。每个请求均需 API Key、anthropic-version: 2023-06-01 和 anthropic-beta: managed-agents-2026-04-01。在线试调会自动带上这些协议头,资源 ID 需自行替换。
官方 95 个操作已全部声明:其中 41 个已支持或部分支持(见端点清单徽标);其余 54 个平台尚未实现,调用如实返回 501(not_implemented_error,响应带 x-should-retry: false),不产生任何副作用、不计费。各项能力与凭据库的具体限制见端点说明。
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| POST | /v1/agents | 创建智能体 | ◐ 部分支持 |
| GET | /v1/agents | 列出智能体 | ● 支持 |
| GET | /v1/agents/{agent_id} | 读取智能体 | ● 支持 |
| POST | /v1/agents/{agent_id} | 更新智能体 | ◐ 部分支持 |
| GET | /v1/agents/{agent_id}/versions | 列出版本 | ● 支持 |
| POST | /v1/agents/{agent_id}/archive | 归档智能体 | ● 支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| POST | /v1/sessions | 创建会话 | ◐ 部分支持 |
| GET | /v1/sessions | 列出会话 | ◐ 部分支持 |
| GET | /v1/sessions/{session_id} | 读取会话 | ● 支持 |
| POST | /v1/sessions/{session_id}/events | 发送事件 | ◐ 部分支持 |
| GET | /v1/sessions/{session_id}/events | 列出事件 | ● 支持 |
| GET | /v1/sessions/{session_id}/events/stream | 订阅事件 | ◐ 部分支持 |
| POST | /v1/sessions/{session_id} | 更新会话 | ◐ 部分支持 |
| DELETE | /v1/sessions/{session_id} | 删除会话 | ○ 未支持 |
| POST | /v1/sessions/{session_id}/archive | 归档会话 | ● 支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/deployment_runs | 列出部署运行 | ○ 未支持 |
| GET | /v1/deployment_runs/{deployment_run_id} | 读取部署运行 | ○ 未支持 |
| GET | /v1/deployments | 列出部署 | ○ 未支持 |
| POST | /v1/deployments | 创建部署 | ○ 未支持 |
| GET | /v1/deployments/{deployment_id} | 读取部署 | ○ 未支持 |
| POST | /v1/deployments/{deployment_id} | 更新部署 | ○ 未支持 |
| POST | /v1/deployments/{deployment_id}/archive | 归档部署 | ○ 未支持 |
| POST | /v1/deployments/{deployment_id}/pause | 暂停部署 | ○ 未支持 |
| POST | /v1/deployments/{deployment_id}/run | 运行部署 | ○ 未支持 |
| POST | /v1/deployments/{deployment_id}/unpause | 恢复部署 | ○ 未支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/environments | 列出环境 | ◐ 部分支持 |
| POST | /v1/environments | 创建环境 | ◐ 部分支持 |
| DELETE | /v1/environments/{environment_id} | 删除环境 | ○ 未支持 |
| GET | /v1/environments/{environment_id} | 读取环境 | ◐ 部分支持 |
| POST | /v1/environments/{environment_id} | 更新环境 | ◐ 部分支持 |
| POST | /v1/environments/{environment_id}/archive | 归档环境 | ◐ 部分支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/environments/{environment_id}/work | 列出工作项 | ○ 未支持 |
| GET | /v1/environments/{environment_id}/work/{work_id} | 读取工作项 | ○ 未支持 |
| POST | /v1/environments/{environment_id}/work/{work_id} | 更新工作项 | ○ 未支持 |
| POST | /v1/environments/{environment_id}/work/{work_id}/ack | 确认工作项 | ○ 未支持 |
| POST | /v1/environments/{environment_id}/work/{work_id}/heartbeat | 工作项心跳 | ○ 未支持 |
| POST | /v1/environments/{environment_id}/work/{work_id}/stop | 停止工作项 | ○ 未支持 |
| GET | /v1/environments/{environment_id}/work/poll | 轮询工作项 | ○ 未支持 |
| GET | /v1/environments/{environment_id}/work/stats | 工作项统计 | ○ 未支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/memory_stores | 列出记忆库 | ○ 未支持 |
| POST | /v1/memory_stores | 创建记忆库 | ○ 未支持 |
| DELETE | /v1/memory_stores/{memory_store_id} | 删除记忆库 | ○ 未支持 |
| GET | /v1/memory_stores/{memory_store_id} | 读取记忆库 | ○ 未支持 |
| POST | /v1/memory_stores/{memory_store_id} | 更新记忆库 | ○ 未支持 |
| POST | /v1/memory_stores/{memory_store_id}/archive | 归档记忆库 | ○ 未支持 |
| GET | /v1/memory_stores/{memory_store_id}/memories | 列出记忆 | ○ 未支持 |
| POST | /v1/memory_stores/{memory_store_id}/memories | 创建记忆 | ○ 未支持 |
| DELETE | /v1/memory_stores/{memory_store_id}/memories/{memory_id} | 删除记忆 | ○ 未支持 |
| GET | /v1/memory_stores/{memory_store_id}/memories/{memory_id} | 读取记忆 | ○ 未支持 |
| POST | /v1/memory_stores/{memory_store_id}/memories/{memory_id} | 更新记忆 | ○ 未支持 |
| GET | /v1/memory_stores/{memory_store_id}/memory_versions | 列出记忆版本 | ○ 未支持 |
| GET | /v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id} | 读取记忆版本 | ○ 未支持 |
| POST | /v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact | 抹除记忆版本 | ○ 未支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/sessions/{session_id}/resources | 列出会话资源 | ◐ 部分支持 |
| POST | /v1/sessions/{session_id}/resources | 添加会话资源 | ◐ 部分支持 |
| DELETE | /v1/sessions/{session_id}/resources/{resource_id} | 删除会话资源 | ◐ 部分支持 |
| GET | /v1/sessions/{session_id}/resources/{resource_id} | 读取会话资源 | ◐ 部分支持 |
| POST | /v1/sessions/{session_id}/resources/{resource_id} | 更新会话资源 | ○ 未支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/sessions/{session_id}/threads | 列出线程 | ◐ 部分支持 |
| GET | /v1/sessions/{session_id}/threads/{thread_id} | 读取线程 | ◐ 部分支持 |
| POST | /v1/sessions/{session_id}/threads/{thread_id}/archive | 归档线程 | ◐ 部分支持 |
| GET | /v1/sessions/{session_id}/threads/{thread_id}/events | 列出线程事件 | ◐ 部分支持 |
| GET | /v1/sessions/{session_id}/threads/{thread_id}/stream | 订阅线程事件 | ◐ 部分支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/skills | 列出技能 | ○ 未支持 |
| POST | /v1/skills | 创建技能 | ○ 未支持 |
| DELETE | /v1/skills/{skill_id} | 删除技能 | ○ 未支持 |
| GET | /v1/skills/{skill_id} | 读取技能 | ○ 未支持 |
| GET | /v1/skills/{skill_id}/versions | 列出技能版本 | ○ 未支持 |
| POST | /v1/skills/{skill_id}/versions | 创建技能版本 | ○ 未支持 |
| DELETE | /v1/skills/{skill_id}/versions/{version} | 删除技能版本 | ○ 未支持 |
| GET | /v1/skills/{skill_id}/versions/{version} | 读取技能版本 | ○ 未支持 |
| GET | /v1/skills/{skill_id}/versions/{version}/content | 下载技能版本内容 | ○ 未支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/tunnels | 列出隧道 | ○ 未支持 |
| POST | /v1/tunnels | 创建隧道 | ○ 未支持 |
| GET | /v1/tunnels/{tunnel_id} | 读取隧道 | ○ 未支持 |
| POST | /v1/tunnels/{tunnel_id}/archive | 归档隧道 | ○ 未支持 |
| GET | /v1/tunnels/{tunnel_id}/certificates | 列出隧道证书 | ○ 未支持 |
| POST | /v1/tunnels/{tunnel_id}/certificates | 创建隧道证书 | ○ 未支持 |
| GET | /v1/tunnels/{tunnel_id}/certificates/{certificate_id} | 读取隧道证书 | ○ 未支持 |
| POST | /v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive | 归档隧道证书 | ○ 未支持 |
| POST | /v1/tunnels/{tunnel_id}/reveal_token | 显示隧道令牌 | ○ 未支持 |
| POST | /v1/tunnels/{tunnel_id}/rotate_token | 轮换隧道令牌 | ○ 未支持 |
| 方法 | 路径 | 说明 | 支持 |
|---|---|---|---|
| GET | /v1/vaults | 列出凭据库 | ● 支持 |
| POST | /v1/vaults | 创建凭据库 | ● 支持 |
| DELETE | /v1/vaults/{vault_id} | 删除凭据库 | ● 支持 |
| GET | /v1/vaults/{vault_id} | 读取凭据库 | ● 支持 |
| POST | /v1/vaults/{vault_id} | 更新凭据库 | ● 支持 |
| POST | /v1/vaults/{vault_id}/archive | 归档凭据库 | ● 支持 |
| GET | /v1/vaults/{vault_id}/credentials | 列出凭据 | ◐ 部分支持 |
| POST | /v1/vaults/{vault_id}/credentials | 创建凭据 | ◐ 部分支持 |
| DELETE | /v1/vaults/{vault_id}/credentials/{credential_id} | 删除凭据 | ◐ 部分支持 |
| GET | /v1/vaults/{vault_id}/credentials/{credential_id} | 读取凭据 | ◐ 部分支持 |
| POST | /v1/vaults/{vault_id}/credentials/{credential_id} | 更新凭据 | ◐ 部分支持 |
| POST | /v1/vaults/{vault_id}/credentials/{credential_id}/archive | 归档凭据 | ◐ 部分支持 |
| POST | /v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate | 校验凭据 MCP OAuth | ◐ 部分支持 |
参数与字段的权威定义以 Claude Managed Agents 官方文档为准。
/anthropic/v1/agents◐ 部分支持namestring必填智能体名称,1–255 个字符,工作区内可读。
modelstring | object必填智能体使用的模型:直接写模型名字符串(如 claude-opus-5),或传对象做附加配置(见子字段)。
idstring必填模型名字符串,如 claude-opus-5。
effortstring | object可选每次推理的思考力度:可传级别字符串(如 high)或 {type: high} 对象。创建时省略取该模型的默认值;更新时省略保持不变。
inference_geostring可选模型推理的地理区域;不传沿用工作区默认。model 是整体替换字段,更新时省略子字段即清除该项。
speedstring可选推理速度模式:fast 出字显著更快但按溢价计费;并非所有模型都支持,不支持的组合在创建时被拒。
systemstring可选智能体的系统提示词。
descriptionstring可选智能体的用途说明。
mcp_serversarray可选○ 未支持智能体连接的 MCP 服务器列表,最多 20 个,名称必须唯一;每个服务器都要被 tools 里的 mcp_toolset 引用,否则整笔请求被拒。
namestring必填MCP 服务器在本列表内的唯一名称,1–255 个字符,供 mcp_toolset 配置引用。
typestring必填服务器类型,目前只支持 url。
urlstring必填MCP 服务器的端点地址。
metadataobject可选自定义元数据键值对,最多 16 个键、每个值最长 512 字符。
multiagentobject可选多智能体协作拓扑:会话主线程作为协调者,从 agents 名单派生会话线程执行工作。
agentsarray必填协调者可以派生为会话线程的智能体名单,1–20 项;支持 ID 字符串、{type: agent, id, version?} 和最多一个 {type: self}。创建/更新时固定版本。成员须唯一、存在且未归档,不能自身带 multiagent。每个 coordinator 最多一个 advisor,模型须可用且不同于智能体模型;仅主会话可咨询,每次咨询为独立 advisor 线程,建议以 agent.thread_message_received 返回。
typestring必填拓扑类型,目前只有 coordinator。
skillsarray可选○ 未支持智能体可用的 Skill 列表。
toolsarray可选智能体可用的工具配置,所有工具合计最多 128 个。
200
支持文本提示词、模型、元数据与内置工具。MCP、Skills 及额外模型控制尚不支持,传入会返回 400。 multiagent 接受 null 或 coordinator 名册,1–20 项:智能体 ID、{type:"agent",id,version?} 或最多一个 {type:"self"}。创建/更新时固定版本;成员去重且须存在、未归档、不能自身带 multiagent。兼容 API 只提供 bash、edit、glob、grep、read、write、web_search、web_fetch 这 8 个官方工具;configs 不接受其他工具名,经此入口创建的会话不提供后台任务、Monitor 或子智能体。完整原生工具请使用 /agent/v1。每个 coordinator 最多一个 advisor,模型须可用且不同于智能体模型;仅主会话可咨询,每次咨询为独立 advisor 线程,建议以 agent.thread_message_received 返回。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | |
| mcp_servers | array<object> | |
| mcp_servers[].name | string | |
| mcp_servers[].type | string | |
| mcp_servers[].url | string | |
| metadata | object | |
| model | object | Model identifier and configuration. |
| model.id | string | The model that will power your agent. See models for additional details and options. |
| model.effort | object | How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes. |
| model.inference_geo | string | Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. |
| model.speed | string | Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time. |
| multiagent | null | object | Resolved coordinator topology with a concrete agent roster. |
| multiagent.agents | array<object> | Agents the coordinator may spawn as session threads, each resolved to a specific version. |
| multiagent.type | string | |
| name | string | |
| skills | array<object> | |
| skills[].skill_id | string | |
| skills[].type | string | |
| skills[].version | string | |
| system | null | string | |
| tools | array<object> | |
| tools[].configs | array<object> | |
| tools[].default_config | object | Resolved default configuration for agent tools. / Resolved default configuration for all tools from an MCP server. |
| tools[].type | string | |
| tools[].mcp_server_name | string | |
| tools[].description | string | |
| tools[].input_schema | object | JSON Schema for custom tool input parameters. |
| tools[].name | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| version | number | The agent's current version. Starts at 1 and increments when the agent is modified. |
/anthropic/v1/agents● 支持created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].description | null | string | |
| data[].mcp_servers | array<object> | |
| data[].metadata | object | |
| data[].model | object | Model identifier and configuration. |
| data[].multiagent | null | object | Resolved coordinator topology with a concrete agent roster. |
| data[].name | string | |
| data[].skills | array<object> | |
| data[].system | null | string | |
| data[].tools | array<object> | |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].version | number | The agent's current version. Starts at 1 and increments when the agent is modified. |
| next_page | string | null |
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
/anthropic/v1/agents/{agent_id}● 支持agent_idstring必填path: 按智能体 ID 过滤结果。
versionnumber可选query: 路径参数:版本号。
200
将示例中的资源 ID 替换成你创建的资源 ID。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | |
| mcp_servers | array<object> | |
| mcp_servers[].name | string | |
| mcp_servers[].type | string | |
| mcp_servers[].url | string | |
| metadata | object | |
| model | object | Model identifier and configuration. |
| model.id | string | The model that will power your agent. See models for additional details and options. |
| model.effort | object | How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes. |
| model.inference_geo | string | Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. |
| model.speed | string | Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time. |
| multiagent | null | object | Resolved coordinator topology with a concrete agent roster. |
| multiagent.agents | array<object> | Agents the coordinator may spawn as session threads, each resolved to a specific version. |
| multiagent.type | string | |
| name | string | |
| skills | array<object> | |
| skills[].skill_id | string | |
| skills[].type | string | |
| skills[].version | string | |
| system | null | string | |
| tools | array<object> | |
| tools[].configs | array<object> | |
| tools[].default_config | object | Resolved default configuration for agent tools. / Resolved default configuration for all tools from an MCP server. |
| tools[].type | string | |
| tools[].mcp_server_name | string | |
| tools[].description | string | |
| tools[].input_schema | object | JSON Schema for custom tool input parameters. |
| tools[].name | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| version | number | The agent's current version. Starts at 1 and increments when the agent is modified. |
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
/anthropic/v1/agents/{agent_id}◐ 部分支持agent_idstring必填path: 按智能体 ID 过滤结果。
namestring可选智能体名称;省略保持不变,不能传空串清除。
modelstring | object可选智能体使用的模型:直接写模型名字符串(如 claude-opus-5),或传对象做附加配置(见子字段)。
idstring必填模型名字符串,如 claude-opus-5。
effortstring | object可选每次推理的思考力度:可传级别字符串(如 high)或 {type: high} 对象。创建时省略取该模型的默认值;更新时省略保持不变。
inference_geostring可选模型推理的地理区域;不传沿用工作区默认。model 是整体替换字段,更新时省略子字段即清除该项。
speedstring可选推理速度模式:fast 出字显著更快但按溢价计费;并非所有模型都支持,不支持的组合在创建时被拒。
systemstring可选系统提示词;省略保持不变,传空串或 null 清除。
descriptionstring可选用途说明;省略保持不变,传空串或 null 清除。
mcp_serversarray可选○ 未支持整体替换的 MCP 服务器列表;省略保持不变,传空数组或 null 清除。
metadataobject可选元数据补丁:键设为字符串即写入,设为 null 即删除;省略该字段保持不变。存储上限 16 个键、每个值 512 字符。
multiagentobject可选多智能体协作拓扑:会话主线程作为协调者,从 agents 名单派生会话线程执行工作。
agentsarray必填协调者可以派生为会话线程的智能体名单,1–20 项;支持 ID 字符串、{type: agent, id, version?} 和最多一个 {type: self}。创建/更新时固定版本。成员须唯一、存在且未归档,不能自身带 multiagent。每个 coordinator 最多一个 advisor,模型须可用且不同于智能体模型;仅主会话可咨询,每次咨询为独立 advisor 线程,建议以 agent.thread_message_received 返回。
typestring必填拓扑类型,目前只有 coordinator。
skillsarray可选○ 未支持整体替换的 Skill 列表;省略保持不变,传空数组或 null 清除。
toolsarray可选整体替换的工具配置;省略保持不变,传空数组或 null 清除。
versionnumber可选智能体当前版本号,用于并发保护:必须与最近一次创建/读取返回的版本一致,否则返回冲突。
200
version 可用于乐观并发控制,版本冲突返回 409;无变化的更新不增加版本。MCP、Skills 尚不支持。 multiagent 接受 null 或 coordinator 名册,1–20 项:智能体 ID、{type:"agent",id,version?} 或最多一个 {type:"self"}。创建/更新时固定版本;成员去重且须存在、未归档、不能自身带 multiagent。兼容 API 只提供 bash、edit、glob、grep、read、write、web_search、web_fetch 这 8 个官方工具;configs 不接受其他工具名,经此入口创建的会话不提供后台任务、Monitor 或子智能体。完整原生工具请使用 /agent/v1。每个 coordinator 最多一个 advisor,模型须可用且不同于智能体模型;仅主会话可咨询,每次咨询为独立 advisor 线程,建议以 agent.thread_message_received 返回。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | |
| mcp_servers | array<object> | |
| mcp_servers[].name | string | |
| mcp_servers[].type | string | |
| mcp_servers[].url | string | |
| metadata | object | |
| model | object | Model identifier and configuration. |
| model.id | string | The model that will power your agent. See models for additional details and options. |
| model.effort | object | How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes. |
| model.inference_geo | string | Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. |
| model.speed | string | Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time. |
| multiagent | null | object | Resolved coordinator topology with a concrete agent roster. |
| multiagent.agents | array<object> | Agents the coordinator may spawn as session threads, each resolved to a specific version. |
| multiagent.type | string | |
| name | string | |
| skills | array<object> | |
| skills[].skill_id | string | |
| skills[].type | string | |
| skills[].version | string | |
| system | null | string | |
| tools | array<object> | |
| tools[].configs | array<object> | |
| tools[].default_config | object | Resolved default configuration for agent tools. / Resolved default configuration for all tools from an MCP server. |
| tools[].type | string | |
| tools[].mcp_server_name | string | |
| tools[].description | string | |
| tools[].input_schema | object | JSON Schema for custom tool input parameters. |
| tools[].name | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| version | number | The agent's current version. Starts at 1 and increments when the agent is modified. |
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
/anthropic/v1/agents/{agent_id}/versions● 支持agent_idstring必填path: 按智能体 ID 过滤结果。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
将示例中的资源 ID 替换成你创建的资源 ID。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].description | null | string | |
| data[].mcp_servers | array<object> | |
| data[].metadata | object | |
| data[].model | object | Model identifier and configuration. |
| data[].multiagent | null | object | Resolved coordinator topology with a concrete agent roster. |
| data[].name | string | |
| data[].skills | array<object> | |
| data[].system | null | string | |
| data[].tools | array<object> | |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].version | number | The agent's current version. Starts at 1 and increments when the agent is modified. |
| next_page | string | null |
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
/anthropic/v1/agents/{agent_id}/archive● 支持agent_idstring必填path: 按智能体 ID 过滤结果。
200
归档后保留查询与历史版本,不能继续更新。请只归档自己的测试智能体。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | |
| mcp_servers | array<object> | |
| mcp_servers[].name | string | |
| mcp_servers[].type | string | |
| mcp_servers[].url | string | |
| metadata | object | |
| model | object | Model identifier and configuration. |
| model.id | string | The model that will power your agent. See models for additional details and options. |
| model.effort | object | How hard Claude works on each turn. Sets `output_config.effort` on every Messages call the session makes. |
| model.inference_geo | string | Geographic region for model inference. When unset, requests fall through to the workspace's default_inference_geo. |
| model.speed | string | Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time. |
| multiagent | null | object | Resolved coordinator topology with a concrete agent roster. |
| multiagent.agents | array<object> | Agents the coordinator may spawn as session threads, each resolved to a specific version. |
| multiagent.type | string | |
| name | string | |
| skills | array<object> | |
| skills[].skill_id | string | |
| skills[].type | string | |
| skills[].version | string | |
| system | null | string | |
| tools | array<object> | |
| tools[].configs | array<object> | |
| tools[].default_config | object | Resolved default configuration for agent tools. / Resolved default configuration for all tools from an MCP server. |
| tools[].type | string | |
| tools[].mcp_server_name | string | |
| tools[].description | string | |
| tools[].input_schema | object | JSON Schema for custom tool input parameters. |
| tools[].name | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| version | number | The agent's current version. Starts at 1 and increments when the agent is modified. |
先调用「创建智能体」,用返回的智能体 ID 替换示例 ID。
/anthropic/v1/sessions◐ 部分支持agentstring | object必填会话要运行的智能体:直接写智能体 ID 字符串(固定用最新版本),或传对象指定 id 与 version(见子字段)。
idstring必填会话要运行的智能体 ID。
typestring必填引用类型,目前只有 agent。
versionnumber可选固定使用的智能体版本;省略用最新版本。
mcp_serversarray可选替换本会话的 MCP 服务器列表:传入的数组整体生效;传空数组清除,省略沿用智能体的配置。
modelstring | object可选替换本会话的模型:模型名字符串(如 claude-opus-5)或配置对象;省略沿用智能体自身的模型。
skillsarray可选替换本会话的 Skill 列表;传空数组清除,省略沿用智能体的配置。
systemstring可选替换本会话的系统提示词,最长 100,000 字符;传 null 清除,省略沿用智能体的。
toolsarray可选替换本会话的工具配置;传空数组清除,省略沿用智能体的配置。
environment_idstring必填会话运行所在的环境 ID,决定容器的基础环境。
budgetobject可选○ 未支持会话的预算上限设置。
max_list_costobject必填预算内列表类调用的花费上限。
typestring必填预算类型,目前只有 max_list_cost。
initial_eventsarray可选创建时按顺序发给会话的初始事件,支持 user.message 与 user.define_outcome,一次最多 50 条。
metadataobject可选会话的自定义元数据键值对。
resourcesarray可选◐ 部分支持要挂载进会话容器的资源(如代码仓库、文件)。
titlestring可选会话标题,便于在控制台辨认。
vault_idsarray可选○ 未支持保险库 ID 列表:会话里智能体可以使用这些已存凭据。
200
先创建智能体,将示例 agent_123 换成返回的 id。Anthropic 兼容 API 的 environment_id 必填,可用 node22 或租户自建 cloud 环境;/agent/v1 可省略 environment_id 得到轻量机器。不支持内联智能体覆盖、预算与凭据库。 支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| agent | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.model | object | Model identifier and configuration. |
| agent.multiagent | null | object | Resolved coordinator topology with full agent definitions for each roster member. |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | |
| created_at | string | A timestamp in RFC 3339 format |
| environment_id | string | |
| metadata | object | |
| outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per `define_outcome` event sent to the session. |
| outcome_evaluations[].completed_at | null | string | A timestamp in RFC 3339 format |
| outcome_evaluations[].description | string | What the agent should produce. |
| outcome_evaluations[].explanation | null | string | Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable. |
| outcome_evaluations[].iteration | number | 0-indexed revision cycle the outcome is currently on. |
| outcome_evaluations[].outcome_id | string | Server-generated outc_ ID for this outcome. |
| outcome_evaluations[].result | string | Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal. |
| outcome_evaluations[].type | string | |
| resources | array<object> | |
| resources[].id | string | |
| resources[].created_at | string | A timestamp in RFC 3339 format |
| resources[].mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| resources[].type | string | |
| resources[].updated_at | string | A timestamp in RFC 3339 format |
| resources[].url | string | |
| resources[].checkout | null | object | |
| resources[].file_id | string | |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| resources[].name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
| stats | object | Timing statistics for a session. |
| stats.active_seconds | number | Cumulative time in seconds the session spent in `running` status. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update. |
| status | string | SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. - `running` - Agent is actively executing. - `idle` - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - `terminated` - Session has ended, either due to an error or completion. |
| title | null | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | object | Cumulative token usage for a session across all turns. |
| usage.active_seconds | number | Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |
| vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |
/anthropic/v1/sessions◐ 部分支持agent_idstring可选query: 按智能体 ID 过滤结果。
agent_versionnumber可选query: 按智能体版本过滤;仅在同时设置 agent_id 时生效。
created_at[gt]string可选query: 只返回严格晚于该时间创建的记录。
created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lt]string可选query: 只返回严格早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
deployment_idstring可选query: 部署 ID(路径或查询参数)。
include_archivedboolean可选query: 是否包含已归档的记录。
memory_store_idstring可选query: 记忆库 ID(路径或查询参数)。
orderstring可选query: 按创建时间排序:asc 从旧到新,desc 从新到旧(默认)。
statusesarray可选query: 按会话状态过滤,可重复该参数匹配多种状态。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
支持 limit、page 与 agent_id;agent_version、时间范围、deployment_id、memory_store_id、include_archived、order、statuses 尚不支持,传入返回 400。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | |
| data[].agent | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].environment_id | string | |
| data[].metadata | object | |
| data[].outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per `define_outcome` event sent to the session. |
| data[].resources | array<object> | |
| data[].stats | object | Timing statistics for a session. |
| data[].status | string | SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. - `running` - Agent is actively executing. - `idle` - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - `terminated` - Session has ended, either due to an error or completion. |
| data[].title | null | string | |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].usage | object | Cumulative token usage for a session across all turns. |
| data[].vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| data[].deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |
| next_page | string | null |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}● 支持session_idstring必填path: 会话 ID(路径或查询参数)。
200
将示例中的资源 ID 替换成你创建的资源 ID。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| agent | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.model | object | Model identifier and configuration. |
| agent.multiagent | null | object | Resolved coordinator topology with full agent definitions for each roster member. |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | |
| created_at | string | A timestamp in RFC 3339 format |
| environment_id | string | |
| metadata | object | |
| outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per `define_outcome` event sent to the session. |
| outcome_evaluations[].completed_at | null | string | A timestamp in RFC 3339 format |
| outcome_evaluations[].description | string | What the agent should produce. |
| outcome_evaluations[].explanation | null | string | Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable. |
| outcome_evaluations[].iteration | number | 0-indexed revision cycle the outcome is currently on. |
| outcome_evaluations[].outcome_id | string | Server-generated outc_ ID for this outcome. |
| outcome_evaluations[].result | string | Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal. |
| outcome_evaluations[].type | string | |
| resources | array<object> | |
| resources[].id | string | |
| resources[].created_at | string | A timestamp in RFC 3339 format |
| resources[].mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| resources[].type | string | |
| resources[].updated_at | string | A timestamp in RFC 3339 format |
| resources[].url | string | |
| resources[].checkout | null | object | |
| resources[].file_id | string | |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| resources[].name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
| stats | object | Timing statistics for a session. |
| stats.active_seconds | number | Cumulative time in seconds the session spent in `running` status. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update. |
| status | string | SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. - `running` - Agent is actively executing. - `idle` - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - `terminated` - Session has ended, either due to an error or completion. |
| title | null | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | object | Cumulative token usage for a session across all turns. |
| usage.active_seconds | number | Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |
| vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/events◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
eventsarray必填要发送给会话的事件列表。
200
将 sesn_123 换成创建会话返回的 id。每条 user.message 只接受一个非空文本块。支持文本 user.message、user.interrupt 和工具确认;其它事件变体尚不支持。返回的是已接纳事件;模型回复从事件历史或订阅读取。会话等待工具授权时发送的 user.message 会排队:返回的事件 processed_at 为 null,授权处理完成后按发送顺序执行。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | Sent events |
| data[].id | string | Unique identifier for this event. |
| data[].content | array<object> | Array of content blocks comprising the user message. / The result content returned by the tool. / The result content returned by the tool. / System content blocks. Text-only. |
| data[].type | string | |
| data[].processed_at | null | string | string | null | string | null | string | A timestamp in RFC 3339 format |
| data[].session_thread_id | null | string | If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. |
| data[].result | string | UserToolConfirmationResult enum |
| data[].tool_use_id | string | The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. |
| data[].deny_message | null | string | Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'. |
| data[].custom_tool_use_id | string | The id of the `agent.custom_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. |
| data[].is_error | null | boolean | Whether the tool execution resulted in an error. |
| data[].description | string | What the agent should produce. Copied from the input event. |
| data[].max_iterations | null | number | Evaluate-then-revise cycles before giving up. Default 3, max 20. |
| data[].outcome_id | string | Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list. |
| data[].rubric | object | Rubric for grading the quality of an outcome. |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/events● 支持session_idstring必填path: 会话 ID(路径或查询参数)。
created_at[gt]string可选query: 只返回严格晚于该时间创建的记录。
created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lt]string可选query: 只返回严格早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
orderstring可选query: 按事件处理时间排序:asc 从早到晚(默认),desc 相反。
typesarray可选query: 按事件类型过滤,取值与返回事件的 type 字段一致(如 user.message、agent.tool_use);不传返回全部类型。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
先发送消息再读取历史;处理完成前可能只看到已接纳的输入。支持分页、事件类型和时间过滤。会话等待工具授权时停在 session.status_idle,stop_reason 为 requires_action,event_ids 列出待确认的 agent.tool_use;运行失败时先出现 session.error,再出现 session.status_terminated。agent.thinking 与官方一致,是不带内容的进度信号。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this event. |
| data[].content | array<object> | Array of content blocks comprising the user message. / The result content returned by the tool. / Array of text blocks comprising the agent response. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks. / The result content returned by the tool. / System content blocks. Text-only. |
| data[].type | string | |
| data[].processed_at | null | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null | string | string | string | null | string | string | A timestamp in RFC 3339 format |
| data[].session_thread_id | null | string | string | string | string | string | null | string | string | If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that terminated. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Public sthr_ ID of the thread that is retrying. |
| data[].result | string | UserToolConfirmationResult enum / Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress. |
| data[].tool_use_id | string | The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the `agent.tool_use` event this result corresponds to. / The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. |
| data[].deny_message | null | string | Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'. |
| data[].custom_tool_use_id | string | The id of the `agent.custom_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. |
| data[].is_error | null | boolean | Whether the tool execution resulted in an error. / Whether the model request resulted in an error. / Whether the tool execution resulted in an error. |
| data[].input | object | Input parameters for the tool call. |
| data[].name | string | Name of the custom tool being called. / Name of the MCP tool being used. / Name of the agent tool being used. |
| data[].mcp_server_name | string | Name of the MCP server providing the tool. |
| data[].evaluated_permission | string | AgentEvaluatedPermission enum |
| data[].evaluation | object | Names the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants. |
| data[].mcp_tool_use_id | string | The id of the `agent.mcp_tool_use` event this result corresponds to. |
| data[].from_session_thread_id | string | Public `sthr_` ID of the thread that sent the message. |
| data[].from_agent_name | null | string | Name of the callable agent this message came from. Absent when received from the primary agent. |
| data[].to_session_thread_id | string | Public `sthr_` ID of the thread the message was sent to. |
| data[].to_agent_name | null | string | Name of the callable agent this message was sent to. Absent when sent to the primary agent. |
| data[].error | object | |
| data[].stop_reason | object | |
| data[].agent_name | string | Name of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. |
| data[].iteration | number | 0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`. |
| data[].outcome_id | string | The `outc_` ID of the outcome being evaluated. / Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list. |
| data[].explanation | string | Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why. |
| data[].outcome_evaluation_start_id | string | The id of the corresponding `span.outcome_evaluation_start` event. |
| data[].usage | object | Token usage for a single model request. / Point-in-time snapshot of a session's cumulative usage. |
| data[].model_request_start_id | string | The id of the corresponding `span.model_request_start` event. |
| data[].model_usage | object | Token usage for a single model request. |
| data[].description | string | What the agent should produce. Copied from the input event. |
| data[].max_iterations | null | number | Evaluate-then-revise cycles before giving up. Default 3, max 20. |
| data[].rubric | object | Rubric for grading the quality of an outcome. |
| data[].agent | null | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| data[].budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| data[].metadata | object | The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty. |
| data[].title | null | string | The session's new title. Present only when the update changed it. |
| next_page | string | null |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/events/stream◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
event_deltasarray可选query: 设置后连接同时接收流式增量事件。
200
保持 SSE 连接以接收事件;请求不会像普通 JSON 接口一样立刻结束。先创建会话并替换 sesn_123,再从另一请求发送消息;停止按钮只断开订阅,不会停止智能体。SDK 0.124.0 会过滤 session.usage,完整用量请读历史。传 event_deltas[]=agent.message 可在最终事件到达前收到逐段文本预览;agent.thinking 与官方一致,只有 event_start。
错误按 Claude Managed Agents 格式返回,参见 错误码
Server-sent events
text/event-stream — chunk / 事件对象
未声明字段结构。
/anthropic/v1/deployment_runs○ 未支持created_at[gt]string可选query: 只返回严格晚于该时间创建的记录。
created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lt]string可选query: 只返回严格早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
deployment_idstring可选query: 部署 ID(路径或查询参数)。
has_errorboolean可选query: 按是否出错过滤部署运行。
trigger_typestring可选query: 按触发类型过滤部署运行。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this run (`drun_...`). |
| data[].agent | object | A resolved agent reference with a concrete version. |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].deployment_id | string | ID of the deployment that produced this run. |
| data[].error | null | object | Why the run failed to create a session. The type identifies the failure; message is human-readable detail. |
| data[].session_id | null | string | Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null. |
| data[].trigger_context | object | Describes what triggered a deployment run, with trigger-specific metadata. |
| data[].type | string | |
| next_page | string | null |
/anthropic/v1/deployment_runs/{deployment_run_id}○ 未支持deployment_run_idstring必填path: 路径参数:部署运行 ID。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this run (`drun_...`). |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| created_at | string | A timestamp in RFC 3339 format |
| deployment_id | string | ID of the deployment that produced this run. |
| error | null | object | Why the run failed to create a session. The type identifies the failure; message is human-readable detail. |
| error.message | string | Human-readable error description. |
| error.type | string | |
| session_id | null | string | Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null. |
| trigger_context | object | Describes what triggered a deployment run, with trigger-specific metadata. |
| trigger_context.scheduled_at | string | A timestamp in RFC 3339 format |
| trigger_context.type | string | |
| type | string |
/anthropic/v1/deployments○ 未支持agent_idstring可选query: 按智能体 ID 过滤结果。
created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
include_archivedboolean可选query: 是否包含已归档的记录。
statusstring可选query: 按状态过滤:active 或 paused。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this deployment. |
| data[].agent | object | A resolved agent reference with a concrete version. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].description | null | string | Description of what the deployment does. |
| data[].environment_id | string | ID of the `environment` where sessions run. |
| data[].initial_events | array<object> | Events sent to each session immediately after creation. |
| data[].metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| data[].name | string | Human-readable name. |
| data[].paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| data[].resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| data[].schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| data[].status | string | Lifecycle status of a deployment. |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| data[].budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| next_page | string | null |
/anthropic/v1/deployments○ 未支持namestring必填Human-readable name for the deployment.
agentstring | object必填Agent to deploy. Accepts the `agent` ID string, which pins the latest version, or an `agent` object with both id and version specified. The agent must exist and not be archived.
idstring必填The `agent` ID.
typestring必填versionnumber可选The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
environment_idstring必填ID of the `environment` defining the container configuration for sessions created from this deployment.
initial_eventsarray必填Events to send to each session immediately after creation. At least 1, maximum 50.
budgetobject可选A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
max_list_costobject必填A monetary amount in a specific currency.
typestring必填descriptionstring可选Description of what the deployment does.
metadataobject可选Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
resourcesarray可选Resources (e.g. repositories, files) to mount into each session's container. Maximum 500.
scheduleobject可选5-field POSIX cron schedule. Literal wall-clock matching in the configured timezone.
expressionstring必填5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 \* \* 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).
timezonestring必填Required. IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). Validated against the IANA timezone database.
typestring必填vault_idsarray可选Vault IDs for stored credentials the agent can use during sessions created from this deployment. Maximum 50.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | ID of the `environment` where sessions run. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| paused_reason.type | string | |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's `error.type`. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to `/workspace/<repo-name>`. / Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string |
/anthropic/v1/deployments/{deployment_id}○ 未支持deployment_idstring必填path: 部署 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | ID of the `environment` where sessions run. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| paused_reason.type | string | |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's `error.type`. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to `/workspace/<repo-name>`. / Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string |
/anthropic/v1/deployments/{deployment_id}○ 未支持deployment_idstring必填path: 部署 ID(路径或查询参数)。
namestring可选Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.
agentstring | object可选Agent to deploy. Accepts the `agent` ID string, which re-pins to the latest version, or an `agent` object with both id and version specified. Omit to preserve. Cannot be cleared.
idstring必填The `agent` ID.
typestring必填versionnumber可选The specific `agent` version to use. Omit to use the latest version. Must be at least 1 if specified.
environment_idstring可选ID of the `environment` where sessions run. Omit to preserve. Cannot be cleared.
budgetobject可选A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
max_list_costobject必填A monetary amount in a specific currency.
typestring必填descriptionstring可选Description. Omit to preserve; send empty string or null to clear.
initial_eventsarray可选Initial events. Full replacement. Omit to preserve. Cannot be cleared. At least 1, maximum 50.
metadataobject可选Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
resourcesarray可选Session resources. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 500.
scheduleobject可选5-field POSIX cron schedule. Literal wall-clock matching in the configured timezone.
expressionstring必填5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 \* \* 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily).
timezonestring必填Required. IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). Validated against the IANA timezone database.
typestring必填vault_idsarray可选Vault IDs. Full replacement. Omit to preserve; send empty array or null to clear. Maximum 50.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | ID of the `environment` where sessions run. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| paused_reason.type | string | |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's `error.type`. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to `/workspace/<repo-name>`. / Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string |
/anthropic/v1/deployments/{deployment_id}/archive○ 未支持deployment_idstring必填path: 部署 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | ID of the `environment` where sessions run. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| paused_reason.type | string | |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's `error.type`. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to `/workspace/<repo-name>`. / Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string |
/anthropic/v1/deployments/{deployment_id}/pause○ 未支持deployment_idstring必填path: 部署 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | ID of the `environment` where sessions run. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| paused_reason.type | string | |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's `error.type`. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to `/workspace/<repo-name>`. / Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string |
/anthropic/v1/deployments/{deployment_id}/run○ 未支持deployment_idstring必填path: 部署 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this run (`drun_...`). |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| created_at | string | A timestamp in RFC 3339 format |
| deployment_id | string | ID of the deployment that produced this run. |
| error | null | object | Why the run failed to create a session. The type identifies the failure; message is human-readable detail. |
| error.message | string | Human-readable error description. |
| error.type | string | |
| session_id | null | string | Populated on success. Null on creation failure. Exactly one of `session_id` or `error` is non-null. |
| trigger_context | object | Describes what triggered a deployment run, with trigger-specific metadata. |
| trigger_context.scheduled_at | string | A timestamp in RFC 3339 format |
| trigger_context.type | string | |
| type | string |
/anthropic/v1/deployments/{deployment_id}/unpause○ 未支持deployment_idstring必填path: 部署 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能按计划或触发条件自动运行智能体。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this deployment. |
| agent | object | A resolved agent reference with a concrete version. |
| agent.id | string | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| description | null | string | Description of what the deployment does. |
| environment_id | string | ID of the `environment` where sessions run. |
| initial_events | array<object> | Events sent to each session immediately after creation. |
| initial_events[].content | array<object> | Array of content blocks for the user message. / System content blocks to append. Text-only. |
| initial_events[].type | string | |
| initial_events[].description | string | What the agent should produce. This is the task specification. |
| initial_events[].rubric | object | Rubric for grading the quality of an outcome. |
| initial_events[].max_iterations | null | number | Eval→revision cycles before giving up. Default 3, max 20. |
| metadata | object | Arbitrary key-value metadata. Maximum 16 pairs. |
| name | string | Human-readable name. |
| paused_reason | null | object | Why a deployment is paused. Non-null exactly when `status` is `paused`. |
| paused_reason.type | string | |
| paused_reason.error | object | The error that triggered an auto-pause. Matches the failed run's `error.type`. |
| resources | array<object> | Resources attached to sessions created from this deployment. Echoes the input minus write-only credentials. |
| resources[].type | string | |
| resources[].url | string | Github URL of the repository |
| resources[].checkout | null | object | Branch or commit to check out. Defaults to the repository's default branch. |
| resources[].mount_path | null | string | Mount path in the container. Defaults to `/workspace/<repo-name>`. / Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`. |
| resources[].file_id | string | ID of a previously uploaded file. |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| schedule | null | object | 5-field POSIX cron schedule with computed runtime timestamps. |
| schedule.expression | string | 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g., "0 9 * * 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean Sunday. Extended cron syntax - seconds or year fields, and the special characters L, W, #, and ? - is not supported, nor are predefined shortcuts (@daily). |
| schedule.timezone | string | IANA timezone identifier (e.g., "America/Los_Angeles", "UTC"). |
| schedule.type | string | |
| schedule.last_run_at | null | string | A timestamp in RFC 3339 format |
| schedule.upcoming_runs_at | array<string> | Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused deployments (reflects what the schedule would do if unpaused); empty once the deployment is archived (`archived_at` set). Each fire is offset by a small per-schedule jitter, so a run will actually start at or shortly after its listed time. |
| status | string | Lifecycle status of a deployment. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_ids | array<string> | Vault IDs supplying stored credentials for sessions created from this deployment. |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string |
/anthropic/v1/environments◐ 部分支持include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Environment identifier (e.g., 'env_...') |
| data[].archived_at | null | string | RFC 3339 timestamp when environment was archived, or null if not archived |
| data[].config | object | Environment configuration (either Anthropic Cloud or self-hosted) |
| data[].created_at | string | RFC 3339 timestamp when environment was created |
| data[].description | null | string | User-provided description for the environment; null when unset |
| data[].metadata | object | User-provided metadata key-value pairs |
| data[].name | string | Human-readable name for the environment |
| data[].type | string | The type of object (always 'environment') |
| data[].updated_at | string | RFC 3339 timestamp when environment was last updated |
| data[].scope | string | The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account. |
| next_page | string | null |
/anthropic/v1/environments◐ 部分支持namestring必填Human-readable name for the environment
configobject可选Environment configuration
typestring必填Environment type
networkingobject可选Network configuration policy. Omit on update to preserve the existing value.
packagesobject可选Specify packages (and optionally their versions) available in this environment. When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest. Under `limited` networking, requires `networking.allow_package_managers` to be `true`.
descriptionstring可选Optional description of the environment
metadataobject可选User-provided metadata key-value pairs
scopestring可选The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only. API organizations support only 'organization'; 'account' is rejected. If not specified, defaults based on organization type.
501
支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Environment identifier (e.g., 'env_...') |
| archived_at | null | string | RFC 3339 timestamp when environment was archived, or null if not archived |
| config | object | Environment configuration (either Anthropic Cloud or self-hosted) |
| config.networking | object | Network configuration policy. |
| config.packages | object | Package manager configuration. |
| config.type | string | Environment type |
| created_at | string | RFC 3339 timestamp when environment was created |
| description | null | string | User-provided description for the environment; null when unset |
| metadata | object | User-provided metadata key-value pairs |
| name | string | Human-readable name for the environment |
| type | string | The type of object (always 'environment') |
| updated_at | string | RFC 3339 timestamp when environment was last updated |
| scope | string | The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account. |
/anthropic/v1/environments/{environment_id}○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
会话目前统一使用平台内置环境,还不能自定义创建或管理环境。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Environment identifier |
| type | string | The type of response |
/anthropic/v1/environments/{environment_id}◐ 部分支持environment_idstring必填path: 环境 ID(路径或查询参数)。
200
支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Environment identifier (e.g., 'env_...') |
| archived_at | null | string | RFC 3339 timestamp when environment was archived, or null if not archived |
| config | object | Environment configuration (either Anthropic Cloud or self-hosted) |
| config.networking | object | Network configuration policy. |
| config.packages | object | Package manager configuration. |
| config.type | string | Environment type |
| created_at | string | RFC 3339 timestamp when environment was created |
| description | null | string | User-provided description for the environment; null when unset |
| metadata | object | User-provided metadata key-value pairs |
| name | string | Human-readable name for the environment |
| type | string | The type of object (always 'environment') |
| updated_at | string | RFC 3339 timestamp when environment was last updated |
| scope | string | The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account. |
/anthropic/v1/environments/{environment_id}◐ 部分支持environment_idstring必填path: 环境 ID(路径或查询参数)。
namestring可选Updated name for the environment
configobject可选Updated environment configuration
typestring必填Environment type
networkingobject可选Network configuration policy. Omit on update to preserve the existing value.
packagesobject可选Specify packages (and optionally their versions) available in this environment. When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest. Under `limited` networking, requires `networking.allow_package_managers` to be `true`.
descriptionstring可选Updated description of the environment. Omit to preserve; null clears to null; an empty string is stored as an empty string.
metadataobject可选User-provided metadata key-value pairs. Set a value to null or empty string to delete the key.
scopestring可选The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only.
501
支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Environment identifier (e.g., 'env_...') |
| archived_at | null | string | RFC 3339 timestamp when environment was archived, or null if not archived |
| config | object | Environment configuration (either Anthropic Cloud or self-hosted) |
| config.networking | object | Network configuration policy. |
| config.packages | object | Package manager configuration. |
| config.type | string | Environment type |
| created_at | string | RFC 3339 timestamp when environment was created |
| description | null | string | User-provided description for the environment; null when unset |
| metadata | object | User-provided metadata key-value pairs |
| name | string | Human-readable name for the environment |
| type | string | The type of object (always 'environment') |
| updated_at | string | RFC 3339 timestamp when environment was last updated |
| scope | string | The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account. |
/anthropic/v1/environments/{environment_id}/archive◐ 部分支持environment_idstring必填path: 环境 ID(路径或查询参数)。
501
支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Environment identifier (e.g., 'env_...') |
| archived_at | null | string | RFC 3339 timestamp when environment was archived, or null if not archived |
| config | object | Environment configuration (either Anthropic Cloud or self-hosted) |
| config.networking | object | Network configuration policy. |
| config.packages | object | Package manager configuration. |
| config.type | string | Environment type |
| created_at | string | RFC 3339 timestamp when environment was created |
| description | null | string | User-provided description for the environment; null when unset |
| metadata | object | User-provided metadata key-value pairs |
| name | string | Human-readable name for the environment |
| type | string | The type of object (always 'environment') |
| updated_at | string | RFC 3339 timestamp when environment was last updated |
| scope | string | The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account. |
/anthropic/v1/environments/{environment_id}/work○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Work identifier (e.g., 'work_...') |
| data[].acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| data[].created_at | string | RFC 3339 timestamp when work was created |
| data[].data | object | The actual work to be performed (session or health check) |
| data[].environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| data[].latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| data[].metadata | object | User-provided metadata key-value pairs associated with this work item |
| data[].secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| data[].started_at | null | string | RFC 3339 timestamp when work execution started |
| data[].state | string | Current state of the work item |
| data[].stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| data[].stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| data[].type | string | The type of object (always 'work') |
| next_page | string | null |
/anthropic/v1/environments/{environment_id}/work/{work_id}○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
work_idstring必填path: 路径参数:任务 ID。
environment_idstring必填query: 环境 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Work identifier (e.g., 'work_...') |
| acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| created_at | string | RFC 3339 timestamp when work was created |
| data | object | The actual work to be performed (session or health check) |
| data.id | string | Session identifier (e.g., 'session_...') / Health check identifier |
| data.type | string | Type of work data |
| environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| metadata | object | User-provided metadata key-value pairs associated with this work item |
| secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| started_at | null | string | RFC 3339 timestamp when work execution started |
| state | string | Current state of the work item |
| stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| type | string | The type of object (always 'work') |
/anthropic/v1/environments/{environment_id}/work/{work_id}○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
work_idstring必填path: 路径参数:任务 ID。
environment_idstring必填query: 环境 ID(路径或查询参数)。
metadataobject必填Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve existing metadata.
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Work identifier (e.g., 'work_...') |
| acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| created_at | string | RFC 3339 timestamp when work was created |
| data | object | The actual work to be performed (session or health check) |
| data.id | string | Session identifier (e.g., 'session_...') / Health check identifier |
| data.type | string | Type of work data |
| environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| metadata | object | User-provided metadata key-value pairs associated with this work item |
| secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| started_at | null | string | RFC 3339 timestamp when work execution started |
| state | string | Current state of the work item |
| stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| type | string | The type of object (always 'work') |
/anthropic/v1/environments/{environment_id}/work/{work_id}/ack○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
work_idstring必填path: 路径参数:任务 ID。
environment_idstring必填query: 环境 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Work identifier (e.g., 'work_...') |
| acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| created_at | string | RFC 3339 timestamp when work was created |
| data | object | The actual work to be performed (session or health check) |
| data.id | string | Session identifier (e.g., 'session_...') / Health check identifier |
| data.type | string | Type of work data |
| environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| metadata | object | User-provided metadata key-value pairs associated with this work item |
| secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| started_at | null | string | RFC 3339 timestamp when work execution started |
| state | string | Current state of the work item |
| stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| type | string | The type of object (always 'work') |
/anthropic/v1/environments/{environment_id}/work/{work_id}/heartbeat○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
work_idstring必填path: 路径参数:任务 ID。
environment_idstring必填query: 环境 ID(路径或查询参数)。
desired_ttl_secondsnumber可选query: 期望的任务租约有效期(秒)。
expected_last_heartbeatstring可选query: 期望的最后心跳时间,用于并发保护。
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| last_heartbeat | string | RFC 3339 timestamp of the actual heartbeat from DB |
| lease_extended | boolean | Whether the heartbeat succeeded in extending the lease |
| state | string | Current state of the work item (active/stopping/stopped) |
| ttl_seconds | number | Effective TTL applied to the lease |
| type | string | The type of response |
/anthropic/v1/environments/{environment_id}/work/{work_id}/stop○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
work_idstring必填path: 路径参数:任务 ID。
environment_idstring必填query: 环境 ID(路径或查询参数)。
forceboolean可选If true, immediately stop work without graceful shutdown
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Work identifier (e.g., 'work_...') |
| acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| created_at | string | RFC 3339 timestamp when work was created |
| data | object | The actual work to be performed (session or health check) |
| data.id | string | Session identifier (e.g., 'session_...') / Health check identifier |
| data.type | string | Type of work data |
| environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| metadata | object | User-provided metadata key-value pairs associated with this work item |
| secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| started_at | null | string | RFC 3339 timestamp when work execution started |
| state | string | Current state of the work item |
| stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| type | string | The type of object (always 'work') |
/anthropic/v1/environments/{environment_id}/work/poll○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
block_msnumber可选query: 没有可领任务时最多等待的毫秒数(1–999)。
reclaim_older_than_msnumber可选query: 回收租约早于该毫秒数的任务。
Anthropic-Worker-IDstring可选query: 发起轮询的自托管执行器实例 ID,用于在控制台聚合环境级任务指标。
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Work identifier (e.g., 'work_...') |
| acknowledged_at | null | string | RFC 3339 timestamp when work was acknowledged by Environment Manager |
| created_at | string | RFC 3339 timestamp when work was created |
| data | object | The actual work to be performed (session or health check) |
| data.id | string | Session identifier (e.g., 'session_...') / Health check identifier |
| data.type | string | Type of work data |
| environment_id | string | Environment identifier this work belongs to (e.g., `env_...`) |
| latest_heartbeat_at | null | string | RFC 3339 timestamp of the most recent heartbeat |
| metadata | object | User-provided metadata key-value pairs associated with this work item |
| secret | null | string | Credential payload used by the environment worker to execute this work item. May be populated when polling for work; null on all other retrieval paths. |
| started_at | null | string | RFC 3339 timestamp when work execution started |
| state | string | Current state of the work item |
| stop_requested_at | null | string | RFC 3339 timestamp when stop was requested |
| stopped_at | null | string | RFC 3339 timestamp when work execution stopped |
| type | string | The type of object (always 'work') |
/anthropic/v1/environments/{environment_id}/work/stats○ 未支持environment_idstring必填path: 环境 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
这是自托管执行器领取任务的协议;平台的智能体都在平台上执行,不支持自托管执行器。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| depth | number | Number of work items waiting to be picked up (lag from consumer group) |
| oldest_queued_at | null | string | RFC 3339 timestamp of oldest item in the work stream (includes both queued and pending items), null if stream empty |
| pending | number | Number of work items being processed (polled but not acknowledged) |
| type | string | The type of object |
| workers_polling | null | number | Number of workers that have polled for work in the last 30 seconds. Requires worker_id to be sent with poll requests. |
/anthropic/v1/memory_stores○ 未支持created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls. |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].name | string | Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name. |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].description | string | Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset. |
| data[].metadata | object | Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable. |
| next_page | string | null |
/anthropic/v1/memory_stores○ 未支持namestring必填Human-readable name for the store. Required; 1–255 characters; no control characters. The mount-path slug under `/mnt/memory/` is derived from this name (lowercased, non-alphanumeric runs collapsed to a hyphen). Names need not be unique within a workspace.
descriptionstring可选Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent.
metadataobject可选Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Not visible to the agent.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls. |
| created_at | string | A timestamp in RFC 3339 format |
| name | string | Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| archived_at | null | string | A timestamp in RFC 3339 format |
| description | string | Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset. |
| metadata | object | Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable. |
/anthropic/v1/memory_stores/{memory_store_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | ID of the deleted memory store (a `memstore_...` identifier). The store and all its memories and versions are no longer retrievable. |
| type | string |
/anthropic/v1/memory_stores/{memory_store_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls. |
| created_at | string | A timestamp in RFC 3339 format |
| name | string | Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| archived_at | null | string | A timestamp in RFC 3339 format |
| description | string | Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset. |
| metadata | object | Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable. |
/anthropic/v1/memory_stores/{memory_store_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
namestring可选New human-readable name for the store. 1–255 characters; no control characters. Renaming changes the slug used for the store's `mount_path` in sessions created after the update.
descriptionstring可选New description for the store, up to 1024 characters. Pass an empty string to clear it.
metadataobject可选Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars each) with values up to 512 chars.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls. |
| created_at | string | A timestamp in RFC 3339 format |
| name | string | Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| archived_at | null | string | A timestamp in RFC 3339 format |
| description | string | Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset. |
| metadata | object | Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable. |
/anthropic/v1/memory_stores/{memory_store_id}/archive○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the memory store (a `memstore_...` tagged ID). Use this when attaching the store to a session, or in the `{memory_store_id}` path parameter of subsequent calls. |
| created_at | string | A timestamp in RFC 3339 format |
| name | string | Human-readable name for the store. 1–255 characters. The store's mount-path slug under `/mnt/memory/` is derived from this name. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| archived_at | null | string | A timestamp in RFC 3339 format |
| description | string | Free-text description of what the store contains, up to 1024 characters. Included in the agent's system prompt when the store is attached, so word it to be useful to the agent. Empty string when unset. |
| metadata | object | Arbitrary key-value tags for your own bookkeeping (such as the end user a store belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters. Returned on retrieve/list but not filterable. |
/anthropic/v1/memory_stores/{memory_store_id}/memories○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
depthnumber可选query: 子节点回溯深度:0(默认)递归返回全部后代,1 只返回直接子节点。
path_prefixstring可选query: 按路径前缀过滤(需以 / 结尾并对齐分段)。
viewstring可选query: 返回投影:basic 省略内容,full 附带完整内容。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory. |
| data[].content_sha256 | string | Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`. |
| data[].content_size_bytes | number | Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`. |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].memory_store_id | string | ID of the memory store this memory belongs to (a `memstore_...` value). |
| data[].memory_version_id | string | ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via List memory versions. |
| data[].path | string | Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes. / The rolled-up path prefix, including a trailing `/` (e.g. `/projects/foo/`). Pass this value as `path_prefix` on a subsequent list call to drill into the directory. |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].content | null | string | The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes). |
| next_page | string | null |
/anthropic/v1/memory_stores/{memory_store_id}/memories○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
viewstring可选query: 返回投影:basic 省略内容,full 附带完整内容。
contentstring必填UTF-8 text content for the new memory. Maximum 100 kB (102,400 bytes). Required; pass `""` explicitly to create an empty memory.
pathstring必填Hierarchical path for the new memory, e.g. `/projects/foo/notes.md`. Must start with `/`, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, `.` or `..` segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory. |
| content_sha256 | string | Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`. |
| content_size_bytes | number | Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`. |
| created_at | string | A timestamp in RFC 3339 format |
| memory_store_id | string | ID of the memory store this memory belongs to (a `memstore_...` value). |
| memory_version_id | string | ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via List memory versions. |
| path | string | Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| content | null | string | The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes). |
/anthropic/v1/memory_stores/{memory_store_id}/memories/{memory_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
memory_idstring必填path: 记忆 ID(路径或查询参数)。
memory_store_idstring必填query: 记忆库 ID(路径或查询参数)。
expected_content_sha256string可选query: 期望的内容 SHA-256,用于并发修改保护。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | ID of the deleted memory (a `mem_...` value). |
| type | string |
/anthropic/v1/memory_stores/{memory_store_id}/memories/{memory_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
memory_idstring必填path: 记忆 ID(路径或查询参数)。
memory_store_idstring必填query: 记忆库 ID(路径或查询参数)。
viewstring可选query: 返回投影:basic 省略内容,full 附带完整内容。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory. |
| content_sha256 | string | Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`. |
| content_size_bytes | number | Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`. |
| created_at | string | A timestamp in RFC 3339 format |
| memory_store_id | string | ID of the memory store this memory belongs to (a `memstore_...` value). |
| memory_version_id | string | ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via List memory versions. |
| path | string | Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| content | null | string | The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes). |
/anthropic/v1/memory_stores/{memory_store_id}/memories/{memory_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
memory_idstring必填path: 记忆 ID(路径或查询参数)。
memory_store_idstring必填query: 记忆库 ID(路径或查询参数)。
viewstring可选query: 返回投影:basic 省略内容,full 附带完整内容。
contentstring可选New UTF-8 text content for the memory. Maximum 100 kB (102,400 bytes). Omit to leave the content unchanged (e.g., for a rename-only update).
pathstring可选New path for the memory (a rename). Must start with `/`, contain at least one non-empty segment, and be at most 1,024 bytes. Must not contain empty segments, `.` or `..` segments, control or format characters, or the Unicode line and paragraph separators (U+2028, U+2029), and must be NFC-normalized. Paths are case-sensitive. The memory's `id` is preserved across renames. Omit to leave the path unchanged.
preconditionobject可选Optimistic-concurrency precondition: the update applies only if the memory's stored `content_sha256` equals the supplied value. On mismatch, the request returns `memory_precondition_failed_error` (HTTP 409); re-read the memory and retry against the fresh state. If the precondition fails but the stored state already exactly matches the requested `content` and `path`, the server returns 200 instead of 409.
typestring必填content_sha256string可选Expected `content_sha256` of the stored memory (64 lowercase hexadecimal characters). Typically the `content_sha256` returned by a prior read or list call. Because the server applies no content normalization, clients can also compute this locally as the SHA-256 of the UTF-8 content bytes.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this memory (a `mem_...` value). Stable across renames; use this ID, not the path, to read, update, or delete the memory. |
| content_sha256 | string | Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The server applies no normalization, so clients can compute the same hash locally for staleness checks and as the value for a `content_sha256` precondition on update. Always populated, regardless of `view`. |
| content_size_bytes | number | Size of `content` in bytes (the UTF-8 plaintext length). Always populated, regardless of `view`. |
| created_at | string | A timestamp in RFC 3339 format |
| memory_store_id | string | ID of the memory store this memory belongs to (a `memstore_...` value). |
| memory_version_id | string | ID of the `memory_version` representing this memory's current content (a `memver_...` value). This is the authoritative head pointer; `memory_version` objects do not carry an `is_latest` flag, so compare against this field instead. Enumerate the history via List memory versions. |
| path | string | Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`. Always starts with `/`. Paths are case-sensitive and unique within a store. Maximum 1,024 bytes. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| content | null | string | The memory's UTF-8 text content. Populated when `view=full`; `null` when `view=basic`. Maximum 100 kB (102,400 bytes). |
/anthropic/v1/memory_stores/{memory_store_id}/memory_versions○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
api_key_idstring可选query: 只返回用该 API Key 写入的版本。
created_at[gte]string可选query: 只返回不早于该时间创建的记录。
created_at[lte]string可选query: 只返回不晚于该时间创建的记录。
memory_idstring可选query: 记忆 ID(路径或查询参数)。
operationstring可选query: 只返回记录该类变更的版本。
service_account_idstring可选query: 只返回该服务账号写入的版本。
session_idstring可选query: 会话 ID(路径或查询参数)。
viewstring可选query: 返回投影:basic 省略内容,full 附带完整内容。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this version (a `memver_...` value). |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].memory_id | string | ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to List memory versions to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained. |
| data[].memory_store_id | string | ID of the memory store this version belongs to (a `memstore_...` value). |
| data[].operation | string | The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values. |
| data[].type | string | |
| data[].content | null | string | The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set. |
| data[].content_sha256 | null | string | Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
| data[].content_size_bytes | null | number | Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
| data[].created_by | object | Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the Sessions API. |
| data[].path | null | string | The memory's path at the time of this write. `null` if and only if `redacted_at` is set. |
| data[].redacted_at | null | string | A timestamp in RFC 3339 format |
| data[].redacted_by | object | Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the Sessions API. |
| next_page | string | null |
/anthropic/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
memory_version_idstring必填path: 路径参数:记忆版本 ID。
memory_store_idstring必填query: 记忆库 ID(路径或查询参数)。
viewstring可选query: 返回投影:basic 省略内容,full 附带完整内容。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this version (a `memver_...` value). |
| created_at | string | A timestamp in RFC 3339 format |
| memory_id | string | ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to List memory versions to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained. |
| memory_store_id | string | ID of the memory store this version belongs to (a `memstore_...` value). |
| operation | string | The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values. |
| type | string | |
| content | null | string | The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set. |
| content_sha256 | null | string | Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
| content_size_bytes | null | number | Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
| created_by | object | Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the Sessions API. |
| created_by.session_id | string | ID of the session that performed the write (a `sesn_...` value). Look up the session via Retrieve a session for further provenance. |
| created_by.type | string | |
| created_by.api_key_id | string | ID of the API key that performed the write. This identifies the key, not the secret. |
| created_by.user_id | string | ID of the user who performed the write (a `user_...` value). |
| created_by.service_account_id | string | ID of the service account that performed the write (a `svac_...` value). |
| path | null | string | The memory's path at the time of this write. `null` if and only if `redacted_at` is set. |
| redacted_at | null | string | A timestamp in RFC 3339 format |
| redacted_by | object | Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the Sessions API. |
| redacted_by.session_id | string | ID of the session that performed the write (a `sesn_...` value). Look up the session via Retrieve a session for further provenance. |
| redacted_by.type | string | |
| redacted_by.api_key_id | string | ID of the API key that performed the write. This identifies the key, not the secret. |
| redacted_by.user_id | string | ID of the user who performed the write (a `user_...` value). |
| redacted_by.service_account_id | string | ID of the service account that performed the write (a `svac_...` value). |
/anthropic/v1/memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redact○ 未支持memory_store_idstring必填path: 记忆库 ID(路径或查询参数)。
memory_version_idstring必填path: 路径参数:记忆版本 ID。
memory_store_idstring必填query: 记忆库 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供智能体可读写的持久记忆库。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this version (a `memver_...` value). |
| created_at | string | A timestamp in RFC 3339 format |
| memory_id | string | ID of the memory this version snapshots (a `mem_...` value). Remains valid after the memory is deleted; pass it as `memory_id` to List memory versions to retrieve the memory's retained versions, including the `deleted` row while the lineage is retained. |
| memory_store_id | string | ID of the memory store this version belongs to (a `memstore_...` value). |
| operation | string | The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values. |
| type | string | |
| content | null | string | The memory's UTF-8 text content as of this version. `null` when `view=basic`, when `operation` is `deleted`, or when `redacted_at` is set. |
| content_sha256 | null | string | Lowercase hex SHA-256 digest of `content` as of this version (64 characters). `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
| content_size_bytes | null | number | Size of `content` in bytes as of this version. `null` when `redacted_at` is set or `operation` is `deleted`. Populated regardless of `view` otherwise. |
| created_by | object | Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the Sessions API. |
| created_by.session_id | string | ID of the session that performed the write (a `sesn_...` value). Look up the session via Retrieve a session for further provenance. |
| created_by.type | string | |
| created_by.api_key_id | string | ID of the API key that performed the write. This identifies the key, not the secret. |
| created_by.user_id | string | ID of the user who performed the write (a `user_...` value). |
| created_by.service_account_id | string | ID of the service account that performed the write (a `svac_...` value). |
| path | null | string | The memory's path at the time of this write. `null` if and only if `redacted_at` is set. |
| redacted_at | null | string | A timestamp in RFC 3339 format |
| redacted_by | object | Identifies who performed a write or redact operation. Captured at write time on the `memory_version` row. The API key that created a session is not recorded on agent writes; attribution answers who made the write, not who is ultimately responsible. Look up session provenance separately via the Sessions API. |
| redacted_by.session_id | string | ID of the session that performed the write (a `sesn_...` value). Look up the session via Retrieve a session for further provenance. |
| redacted_by.type | string | |
| redacted_by.api_key_id | string | ID of the API key that performed the write. This identifies the key, not the secret. |
| redacted_by.user_id | string | ID of the user who performed the write (a `user_...` value). |
| redacted_by.service_account_id | string | ID of the service account that performed the write (a `svac_...` value). |
/anthropic/v1/sessions/{session_id}○ 未支持session_idstring必填path: 会话 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
会话目前支持创建、读取、列出、更新与归档;删除还没有实现。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| type | string |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
agentobject可选会话要运行的智能体:直接写智能体 ID 字符串(固定用最新版本),或传对象指定 id 与 version(见子字段)。
mcp_serversarray可选替换本会话的 MCP 服务器列表:传入的数组整体生效;传空数组清除,省略沿用智能体的配置。
toolsarray可选替换本会话的工具配置;传空数组清除,省略沿用智能体的配置。
budgetobject可选A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.
max_list_costobject必填预算内列表类调用的花费上限。
typestring必填预算类型,目前只有 max_list_cost。
metadataobject可选Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.
titlestring可选Human-readable session title.
vault_idsarray可选Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.
200
支持 title 与 metadata(官方补丁语义:字符串值写入、null 删除该键、整包 null 清空,未提及的键保留)。官方的 agent 覆盖(tools/mcp_servers)、budget 与 vault_ids 不支持,传入返回 400 并点名字段。归档后的会话更新返回 409。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| agent | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.model | object | Model identifier and configuration. |
| agent.multiagent | null | object | Resolved coordinator topology with full agent definitions for each roster member. |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | |
| created_at | string | A timestamp in RFC 3339 format |
| environment_id | string | |
| metadata | object | |
| outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per `define_outcome` event sent to the session. |
| outcome_evaluations[].completed_at | null | string | A timestamp in RFC 3339 format |
| outcome_evaluations[].description | string | What the agent should produce. |
| outcome_evaluations[].explanation | null | string | Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable. |
| outcome_evaluations[].iteration | number | 0-indexed revision cycle the outcome is currently on. |
| outcome_evaluations[].outcome_id | string | Server-generated outc_ ID for this outcome. |
| outcome_evaluations[].result | string | Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal. |
| outcome_evaluations[].type | string | |
| resources | array<object> | |
| resources[].id | string | |
| resources[].created_at | string | A timestamp in RFC 3339 format |
| resources[].mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| resources[].type | string | |
| resources[].updated_at | string | A timestamp in RFC 3339 format |
| resources[].url | string | |
| resources[].checkout | null | object | |
| resources[].file_id | string | |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| resources[].name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
| stats | object | Timing statistics for a session. |
| stats.active_seconds | number | Cumulative time in seconds the session spent in `running` status. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update. |
| status | string | SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. - `running` - Agent is actively executing. - `idle` - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - `terminated` - Session has ended, either due to an error or completion. |
| title | null | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | object | Cumulative token usage for a session across all turns. |
| usage.active_seconds | number | Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |
| vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/archive● 支持session_idstring必填path: 会话 ID(路径或查询参数)。
200
归档后的会话拒绝新消息(400 invalid_request_error,写明会话已归档),读取与事件历史仍可用;重复归档幂等,archived_at 保持首次归档时间。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| agent | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.model | object | Model identifier and configuration. |
| agent.multiagent | null | object | Resolved coordinator topology with full agent definitions for each roster member. |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.type | string | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| budget.max_list_cost | object | A monetary amount in a specific currency. |
| budget.type | string | |
| created_at | string | A timestamp in RFC 3339 format |
| environment_id | string | |
| metadata | object | |
| outcome_evaluations | array<object> | Per-outcome evaluation state. One entry per `define_outcome` event sent to the session. |
| outcome_evaluations[].completed_at | null | string | A timestamp in RFC 3339 format |
| outcome_evaluations[].description | string | What the agent should produce. |
| outcome_evaluations[].explanation | null | string | Grader's verdict text from the most recent evaluation. For `satisfied`, explains why criteria are met; for `needs_revision` (intermediate), what's missing; for `failed`, why unrecoverable. |
| outcome_evaluations[].iteration | number | 0-indexed revision cycle the outcome is currently on. |
| outcome_evaluations[].outcome_id | string | Server-generated outc_ ID for this outcome. |
| outcome_evaluations[].result | string | Current evaluation state. `pending` before the agent begins work; `running` while producing or revising; `evaluating` while the grader scores; `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal. |
| outcome_evaluations[].type | string | |
| resources | array<object> | |
| resources[].id | string | |
| resources[].created_at | string | A timestamp in RFC 3339 format |
| resources[].mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| resources[].type | string | |
| resources[].updated_at | string | A timestamp in RFC 3339 format |
| resources[].url | string | |
| resources[].checkout | null | object | |
| resources[].file_id | string | |
| resources[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| resources[].access | null | string | Access mode for an attached memory store. |
| resources[].description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| resources[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| resources[].name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
| stats | object | Timing statistics for a session. |
| stats.active_seconds | number | Cumulative time in seconds the session spent in `running` status. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update. |
| status | string | SessionStatus enum - `rescheduling` - Transient error occurred, retrying automatically. - `running` - Agent is actively executing. - `idle` - Agent is waiting for input, including user messages or tool confirmations. Sessions start in idle. - `terminated` - Session has ended, either due to an error or completion. |
| title | null | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | object | Cumulative token usage for a session across all turns. |
| usage.active_seconds | number | Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike `stats.active_seconds`, which sums each thread's own active time. This is the duration the session's runtime cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |
| vault_ids | array<string> | Vault IDs attached to the session at creation. Empty when no vaults were supplied. |
| deployment_id | null | string | Deployment ID when the session was created from a deployment reference. Null otherwise. |
/anthropic/v1/sessions/{session_id}/resources◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501
支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].url | string | |
| data[].checkout | null | object | |
| data[].file_id | string | |
| data[].memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| data[].access | null | string | Access mode for an attached memory store. |
| data[].description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| data[].instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| data[].name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
| next_page | string | null |
/anthropic/v1/sessions/{session_id}/resources◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
typestring必填query: 要新增的资源在请求体里对应的字段名。
file_idstring必填ID of a previously uploaded file.
mount_pathstring可选Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.
501
支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| created_at | string | A timestamp in RFC 3339 format |
| file_id | string | |
| mount_path | string | |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
/anthropic/v1/sessions/{session_id}/resources/{resource_id}◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
resource_idstring必填path: 路径参数:会话资源 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
501
支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| type | string |
/anthropic/v1/sessions/{session_id}/resources/{resource_id}◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
resource_idstring必填path: 路径参数:会话资源 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
501
支持 file 类型资源的持久化、查询和解除关联,单会话最多 500 条。文件须属于当前租户且有效。默认路径为 /mnt/session/uploads/<file_id>,自定义路径归一到该目录,拒绝父目录遍历。不修改文件内容;本批尚不将资源同步到沙箱。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| created_at | string | A timestamp in RFC 3339 format |
| mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| url | string | |
| checkout | null | object | |
| checkout.name | string | Branch name to check out. |
| checkout.type | string | |
| checkout.sha | string | Full commit SHA to check out. |
| file_id | string | |
| memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| access | null | string | Access mode for an attached memory store. |
| description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
/anthropic/v1/sessions/{session_id}/resources/{resource_id}○ 未支持session_idstring必填path: 会话 ID(路径或查询参数)。
resource_idstring必填path: 路径参数:会话资源 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
authorization_tokenstring必填New authorization token for the resource. Currently only `github_repository` resources support token rotation.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不能给会话挂载额外资源(文件、代码仓库等)。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | |
| created_at | string | A timestamp in RFC 3339 format |
| mount_path | string | null | string | Filesystem path where the store is mounted in the session container, e.g. /mnt/memory/user-preferences. Derived from the store's name. Output-only. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| url | string | |
| checkout | null | object | |
| checkout.name | string | Branch name to check out. |
| checkout.type | string | |
| checkout.sha | string | Full commit SHA to check out. |
| file_id | string | |
| memory_store_id | string | The memory store ID (memstore_...). Must belong to the caller's organization and workspace. |
| access | null | string | Access mode for an attached memory store. |
| description | string | Description of the memory store, snapshotted at attach time. Rendered into the agent's system prompt. Empty string when the store has no description. |
| instructions | null | string | Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars. |
| name | null | string | Display name of the memory store, snapshotted at attach time. Later edits to the store's name do not propagate to this resource. |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/threads◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
按 created_at 升序返回主线程及全部子线程。线程 id 为 sthr_ 加所属会话 id 的后缀;子线程的 parent_thread_id 指向主线程,session_id 始终为父会话。agent 是实际运行的定义,内置类型的 name 为类型名,未注册的 id/version 为 null。归档子线程的 status 为 terminated,archived_at 为归档时间;stats/usage 无线程级追踪时如实为 null。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this thread. |
| data[].agent | object | The resolved agent a `session_thread` runs. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].parent_thread_id | null | string | Parent thread that spawned this thread. Null for the primary thread. |
| data[].session_id | string | The session this thread belongs to. |
| data[].stats | null | object | Timing statistics for a session thread. |
| data[].status | string | SessionThreadStatus enum |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].usage | null | object | Cumulative token usage for a session thread across all turns. |
| next_page | string | null |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/threads/{thread_id}◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
thread_idstring必填path: 路径参数:线程 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
200
返回本会话的主线程或子线程,与列表项逐字段一致。其他会话的线程、未知线程或非 sthr_ id 一律返回 404,不泄露其存在性。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this thread. |
| agent | object | The resolved agent a `session_thread` runs. |
| agent.model | string | object | The advisor model id. / Model identifier and configuration. |
| agent.type | string | |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| parent_thread_id | null | string | Parent thread that spawned this thread. Null for the primary thread. |
| session_id | string | The session this thread belongs to. |
| stats | null | object | Timing statistics for a session thread. |
| stats.active_seconds | number | Cumulative time in seconds the thread spent actively running. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since thread creation in seconds. For archived threads, frozen at the final update. |
| stats.startup_seconds | number | Time in seconds for the thread to begin running. Zero for child threads, which start immediately. |
| status | string | SessionThreadStatus enum |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | null | object | Cumulative token usage for a session thread across all turns. |
| usage.active_seconds | number | Cumulative time in seconds this thread spent in running status. Equal to `stats.active_seconds`; surfaced here so a thread's usage carries every quantity its cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/threads/{thread_id}/archive◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
thread_idstring必填path: 路径参数:线程 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
200
主线程沿用会话归档动作;子线程仅归档对应子会话,不归档父会话或其他子线程。子线程归档后 status 为 terminated,带 archived_at;历史事件仍可读。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this thread. |
| agent | object | The resolved agent a `session_thread` runs. |
| agent.model | string | object | The advisor model id. / Model identifier and configuration. |
| agent.type | string | |
| agent.id | string | |
| agent.description | null | string | |
| agent.mcp_servers | array<object> | |
| agent.name | string | |
| agent.skills | array<object> | |
| agent.system | null | string | |
| agent.tools | array<object> | |
| agent.version | number | |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| parent_thread_id | null | string | Parent thread that spawned this thread. Null for the primary thread. |
| session_id | string | The session this thread belongs to. |
| stats | null | object | Timing statistics for a session thread. |
| stats.active_seconds | number | Cumulative time in seconds the thread spent actively running. Excludes idle time. |
| stats.duration_seconds | number | Elapsed time since thread creation in seconds. For archived threads, frozen at the final update. |
| stats.startup_seconds | number | Time in seconds for the thread to begin running. Zero for child threads, which start immediately. |
| status | string | SessionThreadStatus enum |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| usage | null | object | Cumulative token usage for a session thread across all turns. |
| usage.active_seconds | number | Cumulative time in seconds this thread spent in running status. Equal to `stats.active_seconds`; surfaced here so a thread's usage carries every quantity its cost is priced on. |
| usage.cache_creation | object | Prompt-cache creation token usage broken down by cache lifetime. |
| usage.cache_read_input_tokens | number | Total tokens read from prompt cache. |
| usage.input_tokens | number | Total input tokens consumed across all turns. |
| usage.list_cost | null | object | A monetary amount in a specific currency. |
| usage.output_tokens | number | Total output tokens generated across all turns. |
| usage.server_tool_use | null | object | Cumulative count of server-executed tool invocations, broken down by tool. |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/threads/{thread_id}/events◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
thread_idstring必填path: 路径参数:线程 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
读取所选线程自己的事件记录:主线程读主会话,子线程读对应子会话。沿用会话事件接口的查询参数、公开事件类型和 data + next_page 信封。使用网页工具时,两个接口均返回 search_result 块;回答 citations 为 /agent/v1 扩展,/anthropic 将引用显示为正文 [n]。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this event. |
| data[].content | array<object> | Array of content blocks comprising the user message. / The result content returned by the tool. / Array of text blocks comprising the agent response. / The result content returned by the tool. / The result content returned by the tool. / Message content blocks. / Message content blocks. / The result content returned by the tool. / System content blocks. Text-only. |
| data[].type | string | |
| data[].processed_at | null | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null | string | string | string | null | string | string | A timestamp in RFC 3339 format |
| data[].session_thread_id | null | string | string | string | string | string | null | string | string | If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread. / Set by the server to the subagent thread this confirmation was routed to. Omitted when it was routed to the primary thread. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.custom_tool_result` by `custom_tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` by `tool_use_id`, so clients do not send it back. / When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching `user.tool_confirmation` or `user.tool_result` by `tool_use_id`, so clients do not send it back. / Public `sthr_` ID of the newly created thread. / Public sthr_ ID of the thread that started running. / Public sthr_ ID of the thread that went idle. / Public sthr_ ID of the thread that terminated. / Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread. / Public sthr_ ID of the thread that is retrying. |
| data[].result | string | UserToolConfirmationResult enum / Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress. |
| data[].tool_use_id | string | The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. / The id of the `agent.tool_use` event this result corresponds to. / The id of the `agent.tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. |
| data[].deny_message | null | string | Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'. |
| data[].custom_tool_use_id | string | The id of the `agent.custom_tool_use` event this result corresponds to, which can be found in the last `session.status_idle` event's `stop_reason.event_ids` field. |
| data[].is_error | null | boolean | Whether the tool execution resulted in an error. / Whether the model request resulted in an error. / Whether the tool execution resulted in an error. |
| data[].input | object | Input parameters for the tool call. |
| data[].name | string | Name of the custom tool being called. / Name of the MCP tool being used. / Name of the agent tool being used. |
| data[].mcp_server_name | string | Name of the MCP server providing the tool. |
| data[].evaluated_permission | string | AgentEvaluatedPermission enum |
| data[].evaluation | object | Names the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants. |
| data[].mcp_tool_use_id | string | The id of the `agent.mcp_tool_use` event this result corresponds to. |
| data[].from_session_thread_id | string | Public `sthr_` ID of the thread that sent the message. |
| data[].from_agent_name | null | string | Name of the callable agent this message came from. Absent when received from the primary agent. |
| data[].to_session_thread_id | string | Public `sthr_` ID of the thread the message was sent to. |
| data[].to_agent_name | null | string | Name of the callable agent this message was sent to. Absent when sent to the primary agent. |
| data[].error | object | |
| data[].stop_reason | object | |
| data[].agent_name | string | Name of the callable agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. / Name of the agent the thread runs. |
| data[].iteration | number | 0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`. / 0-indexed revision cycle, matching the corresponding `span.outcome_evaluation_start`. |
| data[].outcome_id | string | The `outc_` ID of the outcome being evaluated. / Server-generated `outc_` ID for this outcome. Referenced by `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list. |
| data[].explanation | string | Human-readable explanation of the verdict. For `needs_revision`, describes which criteria failed and why. |
| data[].outcome_evaluation_start_id | string | The id of the corresponding `span.outcome_evaluation_start` event. |
| data[].usage | object | Token usage for a single model request. / Point-in-time snapshot of a session's cumulative usage. |
| data[].model_request_start_id | string | The id of the corresponding `span.model_request_start` event. |
| data[].model_usage | object | Token usage for a single model request. |
| data[].description | string | What the agent should produce. Copied from the input event. |
| data[].max_iterations | null | number | Evaluate-then-revise cycles before giving up. Default 3, max 20. |
| data[].rubric | object | Rubric for grading the quality of an outcome. |
| data[].agent | null | object | Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time. |
| data[].budget | null | object | A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`. |
| data[].metadata | object | The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty. |
| data[].title | null | string | The session's new title. Present only when the update changed it. |
| next_page | string | null |
先调用「创建会话」,用返回的会话 ID 替换示例 ID。
/anthropic/v1/sessions/{session_id}/threads/{thread_id}/stream◐ 部分支持session_idstring必填path: 会话 ID(路径或查询参数)。
thread_idstring必填path: 路径参数:线程 ID。
session_idstring必填query: 会话 ID(路径或查询参数)。
event_deltasarray可选query: 设置后连接同时接收流式增量事件。
200
订阅所选线程自己的实时事件流。复用会话 SSE 实现;/agent 接口支持同址只读 WebSocket。主会话流同时包含子线程创建、状态和消息事件,子线程审批带 session_thread_id 上浮;确认或中断携带该字段时路由到所属子线程。
错误按 Claude Managed Agents 格式返回,参见 错误码
Server-sent events
text/event-stream — chunk / 事件对象
未声明字段结构。
/anthropic/v1/skills○ 未支持sourcestring可选query: 按来源过滤 Skill:custom 或官方来源。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| data[].created_at | string | ISO 8601 timestamp of when the skill was created. |
| data[].display_name | string | Human-readable, single-line label for the Skill. Maximum 255 characters. Always set: derived from the SKILL.md frontmatter `name` when omitted at creation. Not unique. |
| data[].latest_version_id | string | ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version. |
| data[].source | object | Where the Skill comes from. Possible values: - `"custom"`: authored by the platform user; private to their workspace - `"anthropic"`: published by Anthropic; shared and read-only - `"anthropic_example"`: Anthropic-published sample Skill - `"plugin"`: resolved from an installed plugin |
| data[].type | string | Object type. For Skills, this is always `"skill"`. |
| data[].updated_at | string | ISO 8601 timestamp of when the skill was last updated. |
| next_page | string | null |
/anthropic/v1/skills○ 未支持filesarray必填Files to upload for the skill. All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
display_namestring可选Human-readable, single-line label for the Skill. Maximum 255 characters. Always set: derived from the SKILL.md frontmatter `name` when omitted at creation. Not unique.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
multipart/form-data
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| created_at | string | ISO 8601 timestamp of when the skill was created. |
| display_name | string | Human-readable, single-line label for the Skill. Maximum 255 characters. Always set: derived from the SKILL.md frontmatter `name` when omitted at creation. Not unique. |
| latest_version_id | string | ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version. |
| source | object | Where the Skill comes from. Possible values: - `"custom"`: authored by the platform user; private to their workspace - `"anthropic"`: published by Anthropic; shared and read-only - `"anthropic_example"`: Anthropic-published sample Skill - `"plugin"`: resolved from an installed plugin |
| source.type | string | Where the Skill comes from. Possible values: - `"custom"`: authored by the platform user; private to their workspace - `"anthropic"`: published by Anthropic; shared and read-only - `"anthropic_example"`: Anthropic-published sample Skill - `"plugin"`: resolved from an installed plugin |
| type | string | Object type. For Skills, this is always `"skill"`. |
| updated_at | string | ISO 8601 timestamp of when the skill was last updated. |
/anthropic/v1/skills/{skill_id}○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| type | string | Deleted object type. For Skills, this is always `"skill_deleted"`. |
/anthropic/v1/skills/{skill_id}○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| created_at | string | ISO 8601 timestamp of when the skill was created. |
| display_name | string | Human-readable, single-line label for the Skill. Maximum 255 characters. Always set: derived from the SKILL.md frontmatter `name` when omitted at creation. Not unique. |
| latest_version_id | string | ID of the newest Skill Version — what `latest` references resolve to. Always set: a Skill holds at least one version. |
| source | object | Where the Skill comes from. Possible values: - `"custom"`: authored by the platform user; private to their workspace - `"anthropic"`: published by Anthropic; shared and read-only - `"anthropic_example"`: Anthropic-published sample Skill - `"plugin"`: resolved from an installed plugin |
| source.type | string | Where the Skill comes from. Possible values: - `"custom"`: authored by the platform user; private to their workspace - `"anthropic"`: published by Anthropic; shared and read-only - `"anthropic_example"`: Anthropic-published sample Skill - `"plugin"`: resolved from an installed plugin |
| type | string | Object type. For Skills, this is always `"skill"`. |
| updated_at | string | ISO 8601 timestamp of when the skill was last updated. |
/anthropic/v1/skills/{skill_id}/versions○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for this Skill Version. The id addresses the version in paths and pins it in references. |
| data[].created_at | string | ISO 8601 timestamp of when the skill was created. |
| data[].description | string | Description of the skill version. This is extracted from the SKILL.md file in the skill upload. |
| data[].name | string | The Skill's immutable kebab-case slug, set at creation from the first upload's SKILL.md frontmatter `name` (or its enclosing directory). Every later upload must resolve to the same value. Also the top-level directory of the Skill's mounted files and the base name of a downloaded archive. |
| data[].skill_id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| data[].type | string | Object type. For Skill Versions, this is always `"skill_version"`. |
| next_page | string | null |
/anthropic/v1/skills/{skill_id}/versions○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
filesarray必填Files to upload for the skill. All files must be in the same top-level directory and must include a SKILL.md file at the root of that directory.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
multipart/form-data
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this Skill Version. The id addresses the version in paths and pins it in references. |
| created_at | string | ISO 8601 timestamp of when the skill was created. |
| description | string | Description of the skill version. This is extracted from the SKILL.md file in the skill upload. |
| name | string | The Skill's immutable kebab-case slug, set at creation from the first upload's SKILL.md frontmatter `name` (or its enclosing directory). Every later upload must resolve to the same value. Also the top-level directory of the Skill's mounted files and the base name of a downloaded archive. |
| skill_id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| type | string | Object type. For Skill Versions, this is always `"skill_version"`. |
/anthropic/v1/skills/{skill_id}/versions/{version}○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
versionstring必填path: 路径参数:版本号。
skill_idstring必填query: Skill ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this Skill Version. The id addresses the version in paths and pins it in references. |
| type | string | Deleted object type. For Skill Versions, this is always `"skill_version_deleted"`. |
/anthropic/v1/skills/{skill_id}/versions/{version}○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
versionstring必填path: 路径参数:版本号。
skill_idstring必填query: Skill ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for this Skill Version. The id addresses the version in paths and pins it in references. |
| created_at | string | ISO 8601 timestamp of when the skill was created. |
| description | string | Description of the skill version. This is extracted from the SKILL.md file in the skill upload. |
| name | string | The Skill's immutable kebab-case slug, set at creation from the first upload's SKILL.md frontmatter `name` (or its enclosing directory). Every later upload must resolve to the same value. Also the top-level directory of the Skill's mounted files and the base name of a downloaded archive. |
| skill_id | string | Unique identifier for the skill. The format and length of IDs may change over time. |
| type | string | Object type. For Skill Versions, this is always `"skill_version"`. |
/anthropic/v1/skills/{skill_id}/versions/{version}/content○ 未支持skill_idstring必填path: Skill ID(路径或查询参数)。
versionstring必填path: 路径参数:版本号。
skill_idstring必填query: Skill ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还不支持上传和管理 Skills;创建智能体时传入 skills 会返回 400。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Binary response body
application/octet-stream
| 名称 | 类型 | 说明 |
|---|---|---|
| $ | string (binary) |
/anthropic/v1/tunnels○ 未支持include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for the tunnel, prefixed with `tnl_`. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].display_name | null | string | Human-readable name for the tunnel (1-255 characters). Null if unset. |
| data[].domain | string | Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived. |
| data[].type | string | |
| next_page | string | null |
/anthropic/v1/tunnels○ 未支持display_namestring可选Optional human-readable name for the tunnel (1-255 characters).
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the tunnel, prefixed with `tnl_`. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | null | string | Human-readable name for the tunnel (1-255 characters). Null if unset. |
| domain | string | Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the tunnel, prefixed with `tnl_`. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | null | string | Human-readable name for the tunnel (1-255 characters). Null if unset. |
| domain | string | Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}/archive○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the tunnel, prefixed with `tnl_`. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | null | string | Human-readable name for the tunnel (1-255 characters). Null if unset. |
| domain | string | Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}/certificates○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for the certificate, prefixed with `tcrt_`. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].expires_at | null | string | A timestamp in RFC 3339 format |
| data[].fingerprint | string | Lowercase hex SHA-256 fingerprint of the certificate's DER encoding. |
| data[].tunnel_id | string | ID of the tunnel the certificate is registered against. |
| data[].type | string | |
| next_page | string | null |
/anthropic/v1/tunnels/{tunnel_id}/certificates○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
ca_certificate_pemstring必填PEM-encoded X.509 CA certificate. Must contain exactly one certificate and no private-key material. Maximum 8KB.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the certificate, prefixed with `tcrt_`. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| expires_at | null | string | A timestamp in RFC 3339 format |
| fingerprint | string | Lowercase hex SHA-256 fingerprint of the certificate's DER encoding. |
| tunnel_id | string | ID of the tunnel the certificate is registered against. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}/certificates/{certificate_id}○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
certificate_idstring必填path: 路径参数:客户端证书 ID。
tunnel_idstring必填query: 隧道 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the certificate, prefixed with `tcrt_`. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| expires_at | null | string | A timestamp in RFC 3339 format |
| fingerprint | string | Lowercase hex SHA-256 fingerprint of the certificate's DER encoding. |
| tunnel_id | string | ID of the tunnel the certificate is registered against. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}/certificates/{certificate_id}/archive○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
certificate_idstring必填path: 路径参数:客户端证书 ID。
tunnel_idstring必填query: 隧道 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the certificate, prefixed with `tcrt_`. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| expires_at | null | string | A timestamp in RFC 3339 format |
| fingerprint | string | Lowercase hex SHA-256 fingerprint of the certificate's DER encoding. |
| tunnel_id | string | ID of the tunnel the certificate is registered against. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}/reveal_token○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Stable identifier for the current token value. Changes when the token is rotated. |
| tunnel_token | string | The connector token used to run the tunnel. Treat as a credential. |
| type | string |
/anthropic/v1/tunnels/{tunnel_id}/rotate_token○ 未支持tunnel_idstring必填path: 隧道 ID(路径或查询参数)。
reasonstring可选Optional free-text reason for the rotation, recorded for audit.
501 平台还没有实现这个端点;调用会得到下面这个响应:
平台还没有提供把智能体接入你自有网络的隧道。调用会返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Stable identifier for the current token value. Changes when the token is rotated. |
| tunnel_token | string | The connector token used to run the tunnel. Treat as a credential. |
| type | string |
/anthropic/v1/vaults● 支持include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
支持创建、列出、读取、更新、归档与删除。列表支持 limit、page 和 include_archived。归档会同时归档库内全部凭据并清除凭据的值;删除会一并删除全部凭据,不可恢复。以 anthropic. 开头的 metadata 键由平台保留,不能写入。同一个库也可以通过原生接口 /vault/v1 管理。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for the vault. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].display_name | string | Human-readable name for the vault. |
| data[].metadata | object | Arbitrary key-value metadata attached to the vault. |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| next_page | string | null |
/anthropic/v1/vaults● 支持display_namestring必填Human-readable name for the vault. 1-255 characters.
metadataobject可选Arbitrary key-value metadata to attach to the vault. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
200
支持创建、列出、读取、更新、归档与删除。列表支持 limit、page 和 include_archived。归档会同时归档库内全部凭据并清除凭据的值;删除会一并删除全部凭据,不可恢复。以 anthropic. 开头的 metadata 键由平台保留,不能写入。同一个库也可以通过原生接口 /vault/v1 管理。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the vault. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | string | Human-readable name for the vault. |
| metadata | object | Arbitrary key-value metadata attached to the vault. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
/anthropic/v1/vaults/{vault_id}● 支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
200
支持创建、列出、读取、更新、归档与删除。列表支持 limit、page 和 include_archived。归档会同时归档库内全部凭据并清除凭据的值;删除会一并删除全部凭据,不可恢复。以 anthropic. 开头的 metadata 键由平台保留,不能写入。同一个库也可以通过原生接口 /vault/v1 管理。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier of the deleted vault. |
| type | string |
/anthropic/v1/vaults/{vault_id}● 支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
200
支持创建、列出、读取、更新、归档与删除。列表支持 limit、page 和 include_archived。归档会同时归档库内全部凭据并清除凭据的值;删除会一并删除全部凭据,不可恢复。以 anthropic. 开头的 metadata 键由平台保留,不能写入。同一个库也可以通过原生接口 /vault/v1 管理。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the vault. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | string | Human-readable name for the vault. |
| metadata | object | Arbitrary key-value metadata attached to the vault. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
/anthropic/v1/vaults/{vault_id}● 支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
display_namestring可选Updated human-readable name for the vault. 1-255 characters.
metadataobject可选Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
200
支持创建、列出、读取、更新、归档与删除。列表支持 limit、page 和 include_archived。归档会同时归档库内全部凭据并清除凭据的值;删除会一并删除全部凭据,不可恢复。以 anthropic. 开头的 metadata 键由平台保留,不能写入。同一个库也可以通过原生接口 /vault/v1 管理。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the vault. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | string | Human-readable name for the vault. |
| metadata | object | Arbitrary key-value metadata attached to the vault. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
/anthropic/v1/vaults/{vault_id}/archive● 支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
200
支持创建、列出、读取、更新、归档与删除。列表支持 limit、page 和 include_archived。归档会同时归档库内全部凭据并清除凭据的值;删除会一并删除全部凭据,不可恢复。以 anthropic. 开头的 metadata 键由平台保留,不能写入。同一个库也可以通过原生接口 /vault/v1 管理。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the vault. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| created_at | string | A timestamp in RFC 3339 format |
| display_name | string | Human-readable name for the vault. |
| metadata | object | Arbitrary key-value metadata attached to the vault. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
/anthropic/v1/vaults/{vault_id}/credentials◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
include_archivedboolean可选query: 是否包含已归档的记录。
limitnumber可选query: 每页返回的条数上限。
pagestring可选query: 分页游标,取自上一页响应的 next_page。
200
支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | |
| data[].id | string | Unique identifier for the credential. |
| data[].archived_at | null | string | A timestamp in RFC 3339 format |
| data[].auth | object | Authentication details for a credential. |
| data[].created_at | string | A timestamp in RFC 3339 format |
| data[].metadata | object | Arbitrary key-value metadata attached to the credential. |
| data[].type | string | |
| data[].updated_at | string | A timestamp in RFC 3339 format |
| data[].vault_id | string | Identifier of the vault this credential belongs to. |
| data[].display_name | null | string | Human-readable name for the credential. |
| next_page | string | null |
/anthropic/v1/vaults/{vault_id}/credentials◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
authobject必填Authentication details for creating a credential.
access_tokenstring必填OAuth access token.
mcp_server_urlstring必填URL of the MCP server this credential authenticates against.
typestring必填expires_atstring可选A timestamp in RFC 3339 format
refreshobject可选OAuth refresh token parameters for creating a credential with refresh support.
tokenstring必填Static bearer token value.
networkingobject必填Outbound hosts the secret value is substituted on.
secret_namestring必填Name of the environment variable. Immutable after create.
secret_valuestring必填Secret value. Write-only; never returned in responses.
injection_locationobject可选Where in the outbound request the secret value may be substituted.
display_namestring可选Human-readable name for the credential. Up to 255 characters.
metadataobject可选Arbitrary key-value metadata to attach to the credential. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
200
支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the credential. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| auth | object | Authentication details for a credential. |
| auth.mcp_server_url | string | URL of the MCP server this credential authenticates against. |
| auth.type | string | |
| auth.expires_at | null | string | A timestamp in RFC 3339 format |
| auth.refresh | null | object | OAuth refresh token configuration returned in credential responses. |
| auth.injection_location | object | Where in the outbound request the secret value is substituted. |
| auth.networking | object | Outbound hosts the secret value is substituted on. |
| auth.secret_name | string | Name of the environment variable. |
| created_at | string | A timestamp in RFC 3339 format |
| metadata | object | Arbitrary key-value metadata attached to the credential. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault this credential belongs to. |
| display_name | null | string | Human-readable name for the credential. |
上面的示例创建 environment_variable 凭据。创建 mcp_oauth 仍返回 501,不会创建凭据;更新已有 mcp_oauth 凭据也不支持。以下为创建请求的实测错误响应。
{
"type": "error",
"error": {
"type": "not_implemented_error",
"message": "Not implemented: creating mcp_oauth credentials is not available on this platform yet; use static_bearer or environment_variable."
},
"request_id": "4c1dcdba-97bb-46ce-aad0-0a7d8753357c"
}/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
credential_idstring必填path: 路径参数:凭据 ID。
vault_idstring必填query: 保险库 ID(路径或查询参数)。
200
支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier of the deleted credential. |
| type | string |
/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
credential_idstring必填path: 路径参数:凭据 ID。
vault_idstring必填query: 保险库 ID(路径或查询参数)。
200
支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the credential. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| auth | object | Authentication details for a credential. |
| auth.mcp_server_url | string | URL of the MCP server this credential authenticates against. |
| auth.type | string | |
| auth.expires_at | null | string | A timestamp in RFC 3339 format |
| auth.refresh | null | object | OAuth refresh token configuration returned in credential responses. |
| auth.injection_location | object | Where in the outbound request the secret value is substituted. |
| auth.networking | object | Outbound hosts the secret value is substituted on. |
| auth.secret_name | string | Name of the environment variable. |
| created_at | string | A timestamp in RFC 3339 format |
| metadata | object | Arbitrary key-value metadata attached to the credential. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault this credential belongs to. |
| display_name | null | string | Human-readable name for the credential. |
/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
credential_idstring必填path: 路径参数:凭据 ID。
vault_idstring必填query: 保险库 ID(路径或查询参数)。
authobject可选Updated authentication details for a credential.
typestring必填access_tokenstring可选Updated OAuth access token.
expires_atstring可选A timestamp in RFC 3339 format
refreshobject可选Parameters for updating OAuth refresh token configuration.
tokenstring可选Updated static bearer token value.
injection_locationobject可选Updated injection location.
networkingobject可选Updated networking scope. Full replacement.
secret_valuestring可选Updated secret value.
display_namestring可选Updated human-readable name for the credential. 1-255 characters.
metadataobject可选Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omitted keys are preserved.
200
支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the credential. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| auth | object | Authentication details for a credential. |
| auth.mcp_server_url | string | URL of the MCP server this credential authenticates against. |
| auth.type | string | |
| auth.expires_at | null | string | A timestamp in RFC 3339 format |
| auth.refresh | null | object | OAuth refresh token configuration returned in credential responses. |
| auth.injection_location | object | Where in the outbound request the secret value is substituted. |
| auth.networking | object | Outbound hosts the secret value is substituted on. |
| auth.secret_name | string | Name of the environment variable. |
| created_at | string | A timestamp in RFC 3339 format |
| metadata | object | Arbitrary key-value metadata attached to the credential. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault this credential belongs to. |
| display_name | null | string | Human-readable name for the credential. |
/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}/archive◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
credential_idstring必填path: 路径参数:凭据 ID。
vault_idstring必填query: 保险库 ID(路径或查询参数)。
200
支持 environment_variable 与 static_bearer。environment_variable 的 networking 只支持 limited,传 unrestricted 返回 400;secret_name 只能使用大写字母、数字和下划线,且不能以数字开头;injection_location 的默认值与官方一致。static_bearer 的令牌只在 mcp_server_url 所在主机上可用。创建或更新 mcp_oauth 返回 501(not_implemented_error),不产生副作用,官方 SDK 不会重试;需要 OAuth 令牌时请使用 /vault/v1/authorizations 一键授权。每个库最多 20 个有效凭据。以 anthropic. 开头的 metadata 键由平台保留,不能写入。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Unique identifier for the credential. |
| archived_at | null | string | A timestamp in RFC 3339 format |
| auth | object | Authentication details for a credential. |
| auth.mcp_server_url | string | URL of the MCP server this credential authenticates against. |
| auth.type | string | |
| auth.expires_at | null | string | A timestamp in RFC 3339 format |
| auth.refresh | null | object | OAuth refresh token configuration returned in credential responses. |
| auth.injection_location | object | Where in the outbound request the secret value is substituted. |
| auth.networking | object | Outbound hosts the secret value is substituted on. |
| auth.secret_name | string | Name of the environment variable. |
| created_at | string | A timestamp in RFC 3339 format |
| metadata | object | Arbitrary key-value metadata attached to the credential. |
| type | string | |
| updated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault this credential belongs to. |
| display_name | null | string | Human-readable name for the credential. |
/anthropic/v1/vaults/{vault_id}/credentials/{credential_id}/mcp_oauth_validate◐ 部分支持vault_idstring必填path: 保险库 ID(路径或查询参数)。
credential_idstring必填path: 路径参数:凭据 ID。
vault_idstring必填query: 保险库 ID(路径或查询参数)。
400
只适用于 OAuth 凭据,对其他类型返回 400。结果总是 HTTP 200,status 为 valid、invalid 或 unknown;mcp_probe 只在未通过时给出失败的一步,refresh 只在尝试了续期时给出。
错误按 Claude Managed Agents 格式返回,参见 错误码
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| credential_id | string | Unique identifier of the credential that was validated. |
| has_refresh_token | boolean | Whether the credential has a refresh token configured. |
| mcp_probe | null | object | The failing step of an MCP validation probe. |
| mcp_probe.http_response | null | object | An HTTP response captured during a credential validation probe. |
| mcp_probe.method | string | The MCP method that failed (for example `initialize` or `tools/list`). |
| refresh | null | object | Outcome of a refresh-token exchange attempted during credential validation. |
| refresh.http_response | null | object | An HTTP response captured during a credential validation probe. |
| refresh.status | string | Outcome of a refresh-token exchange attempted during credential validation. - `succeeded` - The token endpoint returned a new access token. - `failed` - The token endpoint returned an error response. See `http_response` for detail. - `connect_error` - The token endpoint could not be reached (DNS, TLS, or connection error). - `no_refresh_token` - No refresh token is stored for the credential, so no exchange was attempted. |
| status | string | Overall verdict of a credential validation probe. |
| type | string | |
| validated_at | string | A timestamp in RFC 3339 format |
| vault_id | string | Identifier of the vault containing the credential. |
此示例针对前面创建的 static 凭据,因此实测返回 400 invalid_request_error。要获得校验结果,请先通过一键授权完成用户授权,再将 credential_id 换成产生的 OAuth Secret ID。校验 OAuth 凭据返回 HTTP 200,状态为 valid、invalid 或 unknown。