Skip to content

Models

List available models from any configured provider. Useful for building model selectors, validating configurations, and checking provider capabilities.

List Models

php
use Atlasphp\Atlas\Atlas;

$models = Atlas::provider('openai')->models();

foreach ($models as $model) {
    echo $model->id . "\n";
}

Validate Provider

Check if a provider is correctly configured and reachable:

php
$valid = Atlas::provider('openai')->validate();

if ($valid) {
    echo 'Provider is configured and reachable.';
}

Check Capabilities

Query what a provider supports before making calls:

php
$capabilities = Atlas::provider('openai')->capabilities();

$capabilities->supports('text');       // true
$capabilities->supports('image');      // true
$capabilities->supports('audio');      // true
$capabilities->supports('embed');      // true
$capabilities->supports('rerank');     // false

Provider Name

php
$name = Atlas::provider('openai')->name();  // 'openai'

Caching

Model listings are cached by default to minimize API calls:

env
ATLAS_CACHE_MODELS_TTL=86400   # 24 hours (default)

Set TTL to 0 to disable caching.

Supported Providers

ProviderModelsValidate
OpenAIYesYes
AnthropicYesYes
GoogleYesYes
xAIYesYes
ElevenLabsYesYes

API Reference

MethodReturnsDescription
models()ModelListList available models
validate()boolCheck provider connectivity
capabilities()ProviderCapabilitiesCheck supported features
name()stringProvider identifier

Released under the MIT License.