English ← MyDocs

模型

列出模型

get /v1/models

列出可用的模型。

模型 API 响应可用于确定哪些模型可用于 API。最近发布的模型排在前面。

查询参数

  • after_id: optional string

    用作分页游标的对象 ID。提供时,返回此对象之后的结果页。

  • before_id: optional string

    用作分页游标的对象 ID。提供时,返回此对象之前的结果页。

  • limit: optional number

    每页返回的项目数。

    默认为 20。范围从 11000

请求头参数

  • "anthropic-beta": optional array of AnthropicBeta

    可选的请求头,用于指定您要使用的 beta 版本。

    • string

    • "message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more

      • "message-batches-2024-09-24"

      • "prompt-caching-2024-07-31"

      • "computer-use-2024-10-22"

      • "computer-use-2025-01-24"

      • "pdfs-2024-09-25"

      • "token-counting-2024-11-01"

      • "token-efficient-tools-2025-02-19"

      • "output-128k-2025-02-19"

      • "files-api-2025-04-14"

      • "mcp-client-2025-04-04"

      • "mcp-client-2025-11-20"

      • "dev-full-thinking-2025-05-14"

      • "interleaved-thinking-2025-05-14"

      • "code-execution-2025-05-22"

      • "extended-cache-ttl-2025-04-11"

      • "context-1m-2025-08-07"

      • "context-management-2025-06-27"

      • "model-context-window-exceeded-2025-08-26"

      • "skills-2025-10-02"

      • "fast-mode-2026-02-01"

      • "output-300k-2026-03-24"

      • "user-profiles-2026-03-24"

      • "advisor-tool-2026-03-01"

      • "managed-agents-2026-04-01"

      • "cache-diagnosis-2026-04-07"

返回

  • data: array of BetaModelInfo

    • id: string

      唯一模型标识符。

    • capabilities: BetaModelCapabilities

      模型能力信息。

      • batch: BetaCapabilitySupport

        模型是否支持批处理 API。

        • supported: boolean

          模型是否支持此能力。

      • citations: BetaCapabilitySupport

        模型是否支持引用生成。

      • code_execution: BetaCapabilitySupport

        模型是否支持代码执行工具。

      • context_management: BetaContextManagementCapability

        上下文管理支持和可用策略。

        • clear_thinking_20251015: BetaCapabilitySupport

          指示是否支持某项能力。

        • clear_tool_uses_20250919: BetaCapabilitySupport

          指示是否支持某项能力。

        • compact_20260112: BetaCapabilitySupport

          指示是否支持某项能力。

        • supported: boolean

          模型是否支持此能力。

      • effort: BetaEffortCapability

        Effort(推理努力程度)支持和可用级别。

        • high: BetaCapabilitySupport

          模型是否支持高努力级别。

        • low: BetaCapabilitySupport

          模型是否支持低努力级别。

        • max: BetaCapabilitySupport

          模型是否支持最大努力级别。

        • medium: BetaCapabilitySupport

          模型是否支持中等努力级别。

        • supported: boolean

          模型是否支持此能力。

        • xhigh: BetaCapabilitySupport

          指示是否支持某项能力。

      • image_input: BetaCapabilitySupport

        模型是否接受图像内容块。

      • pdf_input: BetaCapabilitySupport

        模型是否接受 PDF 内容块。

      • structured_outputs: BetaCapabilitySupport

        模型是否支持结构化输出 / JSON 模式 / 严格工具模式。

      • thinking: BetaThinkingCapability

        思考能力和支持的类型配置。

        • supported: boolean

          模型是否支持此能力。

        • types: BetaThinkingTypes

          支持的思考类型配置。

          • adaptive: BetaCapabilitySupport

            模型是否支持类型为 'adaptive'(自动)的思考。

          • enabled: BetaCapabilitySupport

            模型是否支持类型为 'enabled' 的思考。

    • created_at: string

      RFC 3339 日期时间字符串,表示模型发布的时间。如果发布日期未知,可能设置为纪元值。

    • display_name: string

      模型的可读名称。

    • max_input_tokens: number

      此模型的最大输入上下文窗口大小(以 token 为单位)。

    • max_tokens: number

      Maximum value for the max_tokens parameter when using this model.

    • type: "model"

      对象类型。

      For Models, this is always "model".

      • "model"
  • first_id: string

    First ID in the data 列表。 Can be used as the before_id for the previous page.

  • has_more: boolean

    Indicates if there are more results in the requested page direction.

  • last_id: string

    Last ID in the data 列表。 Can be used as the after_id for the next page.

示例

curl https://api.anthropic.com/v1/models \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"

响应

{
  "data": [
    {
      "id": "claude-opus-4-6",
      "capabilities": {
        "batch": {
          "supported": true
        },
        "citations": {
          "supported": true
        },
        "code_execution": {
          "supported": true
        },
        "context_management": {
          "clear_thinking_20251015": {
            "supported": true
          },
          "clear_tool_uses_20250919": {
            "supported": true
          },
          "compact_20260112": {
            "supported": true
          },
          "supported": true
        },
        "effort": {
          "high": {
            "supported": true
          },
          "low": {
            "supported": true
          },
          "max": {
            "supported": true
          },
          "medium": {
            "supported": true
          },
          "supported": true,
          "xhigh": {
            "supported": true
          }
        },
        "image_input": {
          "supported": true
        },
        "pdf_input": {
          "supported": true
        },
        "structured_outputs": {
          "supported": true
        },
        "thinking": {
          "supported": true,
          "types": {
            "adaptive": {
              "supported": true
            },
            "enabled": {
              "supported": true
            }
          }
        }
      },
      "created_at": "2026-02-04T00:00:00Z",
      "display_name": "Claude Opus 4.6",
      "max_input_tokens": 0,
      "max_tokens": 0,
      "type": "model"
    }
  ],
  "first_id": "first_id",
  "has_more": true,
  "last_id": "last_id"
}

获取模型

get /v1/models/{model_id}

Get a specific model.

The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.

路径参数

  • model_id: string

    模型标识符或别名。

请求头参数

  • "anthropic-beta": optional array of AnthropicBeta

    可选的请求头,用于指定您要使用的 beta 版本。

    • string

    • "message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 22 more

      • "message-batches-2024-09-24"

      • "prompt-caching-2024-07-31"

      • "computer-use-2024-10-22"

      • "computer-use-2025-01-24"

      • "pdfs-2024-09-25"

      • "token-counting-2024-11-01"

      • "token-efficient-tools-2025-02-19"

      • "output-128k-2025-02-19"

      • "files-api-2025-04-14"

      • "mcp-client-2025-04-04"

      • "mcp-client-2025-11-20"

      • "dev-full-thinking-2025-05-14"

      • "interleaved-thinking-2025-05-14"

      • "code-execution-2025-05-22"

      • "extended-cache-ttl-2025-04-11"

      • "context-1m-2025-08-07"

      • "context-management-2025-06-27"

      • "model-context-window-exceeded-2025-08-26"

      • "skills-2025-10-02"

      • "fast-mode-2026-02-01"

      • "output-300k-2026-03-24"

      • "user-profiles-2026-03-24"

      • "advisor-tool-2026-03-01"

      • "managed-agents-2026-04-01"

      • "cache-diagnosis-2026-04-07"

返回

  • BetaModelInfo object { id, capabilities, created_at, 4 more }

    • id: string

      唯一模型标识符。

    • capabilities: BetaModelCapabilities

      模型能力信息。

      • batch: BetaCapabilitySupport

        模型是否支持批处理 API。

        • supported: boolean

          模型是否支持此能力。

      • citations: BetaCapabilitySupport

        模型是否支持引用生成。

      • code_execution: BetaCapabilitySupport

        模型是否支持代码执行工具。

      • context_management: BetaContextManagementCapability

        上下文管理支持和可用策略。

        • clear_thinking_20251015: BetaCapabilitySupport

          指示是否支持某项能力。

        • clear_tool_uses_20250919: BetaCapabilitySupport

          指示是否支持某项能力。

        • compact_20260112: BetaCapabilitySupport

          指示是否支持某项能力。

        • supported: boolean

          模型是否支持此能力。

      • effort: BetaEffortCapability

        Effort(推理努力程度)支持和可用级别。

        • high: BetaCapabilitySupport

          模型是否支持高努力级别。

        • low: BetaCapabilitySupport

          模型是否支持低努力级别。

        • max: BetaCapabilitySupport

          模型是否支持最大努力级别。

        • medium: BetaCapabilitySupport

          模型是否支持中等努力级别。

        • supported: boolean

          模型是否支持此能力。

        • xhigh: BetaCapabilitySupport

          指示是否支持某项能力。

      • image_input: BetaCapabilitySupport

        模型是否接受图像内容块。

      • pdf_input: BetaCapabilitySupport

        模型是否接受 PDF 内容块。

      • structured_outputs: BetaCapabilitySupport

        模型是否支持结构化输出 / JSON 模式 / 严格工具模式。

      • thinking: BetaThinkingCapability

        思考能力和支持的类型配置。

        • supported: boolean

          模型是否支持此能力。

        • types: BetaThinkingTypes

          支持的思考类型配置。

          • adaptive: BetaCapabilitySupport

            模型是否支持类型为 'adaptive'(自动)的思考。

          • enabled: BetaCapabilitySupport

            模型是否支持类型为 'enabled' 的思考。

    • created_at: string

      RFC 3339 日期时间字符串,表示模型发布的时间。如果发布日期未知,可能设置为纪元值。

    • display_name: string

      模型的可读名称。

    • max_input_tokens: number

      此模型的最大输入上下文窗口大小(以 token 为单位)。

    • max_tokens: number

      Maximum value for the max_tokens parameter when using this model.

    • type: "model"

      对象类型。

      For Models, this is always "model".

      • "model"

示例

curl https://api.anthropic.com/v1/models/$MODEL_ID \
    -H 'anthropic-version: 2023-06-01' \
    -H "X-Api-Key: $ANTHROPIC_API_KEY"

响应

{
  "id": "claude-opus-4-6",
  "capabilities": {
    "batch": {
      "supported": true
    },
    "citations": {
      "supported": true
    },
    "code_execution": {
      "supported": true
    },
    "context_management": {
      "clear_thinking_20251015": {
        "supported": true
      },
      "clear_tool_uses_20250919": {
        "supported": true
      },
      "compact_20260112": {
        "supported": true
      },
      "supported": true
    },
    "effort": {
      "high": {
        "supported": true
      },
      "low": {
        "supported": true
      },
      "max": {
        "supported": true
      },
      "medium": {
        "supported": true
      },
      "supported": true,
      "xhigh": {
        "supported": true
      }
    },
    "image_input": {
      "supported": true
    },
    "pdf_input": {
      "supported": true
    },
    "structured_outputs": {
      "supported": true
    },
    "thinking": {
      "supported": true,
      "types": {
        "adaptive": {
          "supported": true
        },
        "enabled": {
          "supported": true
        }
      }
    }
  },
  "created_at": "2026-02-04T00:00:00Z",
  "display_name": "Claude Opus 4.6",
  "max_input_tokens": 0,
  "max_tokens": 0,
  "type": "model"
}

域类型

Beta Capability Support

  • BetaCapabilitySupport object { supported }

    指示是否支持某项能力。

    • supported: boolean

      模型是否支持此能力。

Beta Context Management Capability

  • BetaContextManagementCapability object { clear_thinking_20251015, clear_tool_uses_20250919, compact_20260112, supported }

    Context management capability details.

    • clear_thinking_20251015: BetaCapabilitySupport

      指示是否支持某项能力。

      • supported: boolean

        模型是否支持此能力。

    • clear_tool_uses_20250919: BetaCapabilitySupport

      指示是否支持某项能力。

    • compact_20260112: BetaCapabilitySupport

      指示是否支持某项能力。

    • supported: boolean

      模型是否支持此能力。

Beta Effort Capability

  • BetaEffortCapability object { high, low, max, 3 more }

    Effort (reasoning_effort) capability details.

    • high: BetaCapabilitySupport

      模型是否支持高努力级别。

      • supported: boolean

        模型是否支持此能力。

    • low: BetaCapabilitySupport

      模型是否支持低努力级别。

    • max: BetaCapabilitySupport

      模型是否支持最大努力级别。

    • medium: BetaCapabilitySupport

      模型是否支持中等努力级别。

    • supported: boolean

      模型是否支持此能力。

    • xhigh: BetaCapabilitySupport

      指示是否支持某项能力。

Beta Model Capabilities

  • BetaModelCapabilities object { batch, citations, code_execution, 6 more }

    模型能力信息。

    • batch: BetaCapabilitySupport

      模型是否支持批处理 API。

      • supported: boolean

        模型是否支持此能力。

    • citations: BetaCapabilitySupport

      模型是否支持引用生成。

    • code_execution: BetaCapabilitySupport

      模型是否支持代码执行工具。

    • context_management: BetaContextManagementCapability

      上下文管理支持和可用策略。

      • clear_thinking_20251015: BetaCapabilitySupport

        指示是否支持某项能力。

      • clear_tool_uses_20250919: BetaCapabilitySupport

        指示是否支持某项能力。

      • compact_20260112: BetaCapabilitySupport

        指示是否支持某项能力。

      • supported: boolean

        模型是否支持此能力。

    • effort: BetaEffortCapability

      Effort(推理努力程度)支持和可用级别。

      • high: BetaCapabilitySupport

        模型是否支持高努力级别。

      • low: BetaCapabilitySupport

        模型是否支持低努力级别。

      • max: BetaCapabilitySupport

        模型是否支持最大努力级别。

      • medium: BetaCapabilitySupport

        模型是否支持中等努力级别。

      • supported: boolean

        模型是否支持此能力。

      • xhigh: BetaCapabilitySupport

        指示是否支持某项能力。

    • image_input: BetaCapabilitySupport

      模型是否接受图像内容块。

    • pdf_input: BetaCapabilitySupport

      模型是否接受 PDF 内容块。

    • structured_outputs: BetaCapabilitySupport

      模型是否支持结构化输出 / JSON 模式 / 严格工具模式。

    • thinking: BetaThinkingCapability

      思考能力和支持的类型配置。

      • supported: boolean

        模型是否支持此能力。

      • types: BetaThinkingTypes

        支持的思考类型配置。

        • adaptive: BetaCapabilitySupport

          模型是否支持类型为 'adaptive'(自动)的思考。

        • enabled: BetaCapabilitySupport

          模型是否支持类型为 'enabled' 的思考。

Beta Model Info

  • BetaModelInfo object { id, capabilities, created_at, 4 more }

    • id: string

      唯一模型标识符。

    • capabilities: BetaModelCapabilities

      模型能力信息。

      • batch: BetaCapabilitySupport

        模型是否支持批处理 API。

        • supported: boolean

          模型是否支持此能力。

      • citations: BetaCapabilitySupport

        模型是否支持引用生成。

      • code_execution: BetaCapabilitySupport

        模型是否支持代码执行工具。

      • context_management: BetaContextManagementCapability

        上下文管理支持和可用策略。

        • clear_thinking_20251015: BetaCapabilitySupport

          指示是否支持某项能力。

        • clear_tool_uses_20250919: BetaCapabilitySupport

          指示是否支持某项能力。

        • compact_20260112: BetaCapabilitySupport

          指示是否支持某项能力。

        • supported: boolean

          模型是否支持此能力。

      • effort: BetaEffortCapability

        Effort(推理努力程度)支持和可用级别。

        • high: BetaCapabilitySupport

          模型是否支持高努力级别。

        • low: BetaCapabilitySupport

          模型是否支持低努力级别。

        • max: BetaCapabilitySupport

          模型是否支持最大努力级别。

        • medium: BetaCapabilitySupport

          模型是否支持中等努力级别。

        • supported: boolean

          模型是否支持此能力。

        • xhigh: BetaCapabilitySupport

          指示是否支持某项能力。

      • image_input: BetaCapabilitySupport

        模型是否接受图像内容块。

      • pdf_input: BetaCapabilitySupport

        模型是否接受 PDF 内容块。

      • structured_outputs: BetaCapabilitySupport

        模型是否支持结构化输出 / JSON 模式 / 严格工具模式。

      • thinking: BetaThinkingCapability

        思考能力和支持的类型配置。

        • supported: boolean

          模型是否支持此能力。

        • types: BetaThinkingTypes

          支持的思考类型配置。

          • adaptive: BetaCapabilitySupport

            模型是否支持类型为 'adaptive'(自动)的思考。

          • enabled: BetaCapabilitySupport

            模型是否支持类型为 'enabled' 的思考。

    • created_at: string

      RFC 3339 日期时间字符串,表示模型发布的时间。如果发布日期未知,可能设置为纪元值。

    • display_name: string

      模型的可读名称。

    • max_input_tokens: number

      此模型的最大输入上下文窗口大小(以 token 为单位)。

    • max_tokens: number

      Maximum value for the max_tokens parameter when using this model.

    • type: "model"

      对象类型。

      For Models, this is always "model".

      • "model"

Beta Thinking Capability

  • BetaThinkingCapability object { supported, types }

    Thinking capability details.

    • supported: boolean

      模型是否支持此能力。

    • types: BetaThinkingTypes

      支持的思考类型配置。

      • adaptive: BetaCapabilitySupport

        模型是否支持类型为 'adaptive'(自动)的思考。

        • supported: boolean

          模型是否支持此能力。

      • enabled: BetaCapabilitySupport

        模型是否支持类型为 'enabled' 的思考。

Beta Thinking Types

  • BetaThinkingTypes object { adaptive, enabled }

    支持的思考类型配置。

    • adaptive: BetaCapabilitySupport

      模型是否支持类型为 'adaptive'(自动)的思考。

      • supported: boolean

        模型是否支持此能力。

    • enabled: BetaCapabilitySupport

      模型是否支持类型为 'enabled' 的思考。