Skip to main content

Obtaining a List of Claude Models Using the Anthropic API

By using the Anthropic API's /v1/models endpoint, you can programmatically retrieve a list of available Claude models along with their specifications.

How to Call the API

To retrieve it using PowerShell, use the following:

$uri = "https://api.anthropic.com/v1/models"
$headers = @{
"x-api-key" = $env:ANTHROPIC_API_KEY
"anthropic-version" = "2023-06-01"
}

$response = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers
$response.data | ConvertTo-Json -Depth 10

To retrieve it using curl, use the following:

curl https://api.anthropic.com/v1/models \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01"

Retrieval Results (As of May 2026)

ModelModel IDRelease DateMax InputMax Output
Claude Opus 4.7claude-opus-4-72026-04-141M128K
Claude Sonnet 4.6claude-sonnet-4-62026-02-171M128K
Claude Opus 4.6claude-opus-4-62026-02-041M128K
Claude Opus 4.5claude-opus-4-5-202511012025-11-24200K64K
Claude Haiku 4.5claude-haiku-4-5-202510012025-10-15200K64K
Claude Sonnet 4.5claude-sonnet-4-5-202509292025-09-291M64K
Claude Opus 4.1claude-opus-4-1-202508052025-08-05200K32K
Claude Opus 4claude-opus-4-202505142025-05-22200K32K
Claude Sonnet 4claude-sonnet-4-202505142025-05-221M64K

Feature Support Status

The availability of features for each model is as follows:

ModelBatch ProcessingCode ExecutionEffort ControlCompactThinking Mode
Claude Opus 4.7only adaptive
Claude Sonnet 4.6enabled / adaptive
Claude Opus 4.6enabled / adaptive
Claude Opus 4.5○ (max not supported)only enabled
Claude Haiku 4.5only enabled
Claude Sonnet 4.5only enabled
Claude Opus 4.1only enabled
Claude Opus 4only enabled
Claude Sonnet 4only enabled

Explanation of Each Feature

  • Batch Processing: Allows for the processing of large requests in bulk using an asynchronous batch API, available at 50% off the on-demand rate.
  • Code Execution: The model can execute code in a sandbox environment.
  • Effort Control: Adjusts the amount of thought with options for low, medium, high, and max, allowing control over cost and accuracy trade-offs.
  • Compact: Context management feature that makes it possible to compress long conversations to use tokens efficiently (compact_20260112).
  • Thinking Mode: Availability of Extended Thinking mode. enabled indicates always on, while adaptive means the model decides automatically.

Starting from the latest 4.6 generation (Opus 4.6, Sonnet 4.6), Compact is available and Effort Control is also supported. Note that these features are not available when using models from the 4.5 generation or earlier.

References

Comments

Loading...

Post a Comment