Skip to main content
List all Claude models available through the Anthropic API. This function returns basic information about each model including its ID, name, and creation date.

Samples

List all models

See all available Claude models:
SELECT * FROM ai.anthropic_list_models();
Returns:
              id                    |          name           |      created
------------------------------------+-------------------------+-------------------
 claude-3-5-sonnet-20241022         | Claude 3.5 Sonnet       | 2024-10-22 ...
 claude-3-opus-20240229             | Claude 3 Opus           | 2024-02-29 ...
 claude-3-sonnet-20240229           | Claude 3 Sonnet         | 2024-02-29 ...
 claude-3-haiku-20240307            | Claude 3 Haiku          | 2024-03-07 ...

Use with API key name

Reference a stored API key:
SELECT * FROM ai.anthropic_list_models(
    api_key_name => 'ANTHROPIC_API_KEY'
);

Filter by model name

Find specific models:
SELECT id, name
FROM ai.anthropic_list_models()
WHERE name LIKE '%Sonnet%';

Get the latest model

Find the most recently released model:
SELECT id, name, created
FROM ai.anthropic_list_models()
ORDER BY created DESC
LIMIT 1;

Arguments

NameTypeDefaultRequiredDescription
api_keyTEXTNULLAnthropic API key. If not provided, uses configured secret
api_key_nameTEXTNULLName of the secret containing the API key
base_urlTEXTNULLCustom API base URL
verboseBOOLEANFALSEEnable verbose logging for debugging

Returns

TABLE: A table with the following columns:
ColumnTypeDescription
idTEXTModel identifier (e.g., claude-3-5-sonnet-20241022)
nameTEXTHuman-readable model name (e.g., Claude 3.5 Sonnet)
createdTIMESTAMPTZWhen the model was released