English ← MyDocs

获取模型

get /v1/models/{model_id}

获取特定模型。

模型 API 响应可用于获取特定模型的信息或将模型别名解析为模型 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

      使用此模型时 max_tokens 参数的最大值。

    • type: "model"

      对象类型。

      对于模型,始终为 "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"
}