Samples
List all models
Get all available OpenAI models:Find specific models
Search for models matching a pattern:Check model availability
Verify a specific model is available:Arguments
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
api_key | TEXT | NULL | ✖ | OpenAI API key. If not provided, uses ai.openai_api_key setting |
api_key_name | TEXT | NULL | ✖ | Name of the secret containing the API key |
extra_headers | JSONB | NULL | ✖ | Additional HTTP headers to include in the API request |
extra_query | JSONB | NULL | ✖ | Additional query parameters for the API request |
verbose | BOOLEAN | FALSE | ✖ | Enable verbose logging for debugging |
client_config | JSONB | NULL | ✖ | Advanced client configuration options |
Returns
TABLE(id TEXT, created TIMESTAMPTZ, owned_by TEXT): A table with one row per model containing:
id: The model identifier (e.g.,gpt-4o-mini)created: When the model was createdowned_by: The organization that owns the model
Related functions
openai_list_models_with_raw_response(): get the full API responseopenai_chat_complete(): use models for chat completionopenai_embed(): use models for embeddings