OpenAI releases new models and previews faster than any package can track them in a release cycle. Rather than waiting for aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/openai/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/openai update, you can register a model at runtime with its declared capabilities, or use lighter-weight escape hatches — assume() and allowUnknownCapabilities() — directly on a model handle. Both approaches let the SDK’s capability-checking layer know what to expect without modifying the bundled models.json catalog.
Registering a Model
Registration permanently adds the model to the provider’s in-process registry for the lifetime of the request. Once registered, the model is indistinguishable from a built-in model: capability checks work normally, and it routes to the same chat completions endpoint. Terse facade form — pass the model ID as the first argument and acapabilities array as a named argument:
ModelDefinition form — construct a ModelDefinition object explicitly and pass it to registerModel(). This is the same form used internally for every built-in model:
$model->supports(Capability::TextGeneration) and all other capability queries you declared.
Assuming Capabilities on an Unknown Handle
If you only need to opt in to one or two extra capabilities for a single call, avoid the overhead of full registration and call->assume() directly on the model handle returned by OpenAI::model().
assume() — opt in to a specific list of capabilities. The model still reports TextGeneration from the unknown-model fallback, and the assumed capabilities are marked with the user-assumed source so you can audit them later:
allowUnknownCapabilities() — bypass all capability checks entirely. Every capability query returns true, with source user-allowed-unknown-capabilities. Use this only when exploring a model whose full feature set is not yet documented:
assume() grants only the capabilities you name (all others remain unchecked), while allowUnknownCapabilities() grants every capability unconditionally.
Unknown Model Fallback
Any model handle that is neither registered nor matched by the built-in catalog is not rejected outright. Instead, the SDK automatically grants itTextGeneration capability under the source label unknown-model-fallback. This means you can pass an unrecognised model ID to OpenAI::model() and call .run() on a plain text generation request without any additional setup — the request will reach the OpenAI API and succeed or fail based on what the API actually supports.
Available Capabilities
TheCapability enum covers every feature the provider layer understands. All values below appear in models.json and the source:
| Capability | Description |
|---|---|
Capability::TextGeneration | Model can produce text completions via the chat completions endpoint. |
Capability::Streaming | Model supports server-sent event streaming for incremental output. |
Capability::ToolCalling | Model supports function / tool calling with structured tool definitions. |
Capability::StructuredOutput | Model supports json_schema mode for guaranteed structured JSON output. |
Capability::Reasoning | Model exposes a reasoning_effort parameter (e.g. o-series models). |
Capability::TextInput | Model accepts plain text as part of a multimodal message. |
Capability::ImageInput | Model accepts image URLs or base-64 encoded images in messages. |
Capability::AudioInput | Model accepts audio content in messages (e.g. gpt-*-audio variants). |
Capability::FileInput | Model accepts file attachments in messages (e.g. gpt-4.1 and gpt-5 families). |
Capability::ImageGeneration | Model generates images rather than text (e.g. gpt-image-1, dall-e-3). |
If the OpenAI API rejects a request because the model or feature is not supported, the SDK normalizes the error into a typed
CapabilityNotSupportedException or provider API error. You do not need to parse raw HTTP error bodies — catch the SDK exception instead.