TheDocumentation 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.
Capability enum (from aisdk/core) defines the feature set a model exposes. The aisdk/openai package declares capabilities per model in resources/models.json and enforces them before making API calls. When a request requires a capability that the target model does not declare — for example, sending an image URL to gpt-4o-mini without the image_input capability — the SDK throws CapabilityNotSupportedException before any HTTP request is made. This early enforcement catches configuration mistakes at the application layer rather than relying on opaque provider API errors.
Capability Table
Each row describes oneCapability enum case, the feature it gates, and the OpenAI model families that declare it in models.json.
| Capability | Description | Example Models |
|---|---|---|
TextGeneration | Core chat completions capability. Required for any text output from a text model. | All text models |
Streaming | Server-sent event streaming via ->stream() through /chat/completions. | gpt-4o, gpt-4o*, gpt-4.1*, o*, gpt-5* |
ToolCalling | Function / tool calling with structured JSON arguments passed back from the model. | gpt-4o, gpt-4.1*, gpt-*-audio*, o*, gpt-5* |
StructuredOutput | json_schema response format for strict, schema-validated JSON output. | gpt-4o, gpt-4.1*, gpt-*-audio*, o*, gpt-5* |
Reasoning | reasoning_effort parameter for extended o-series chain-of-thought thinking. | o*, gpt-5* |
TextInput | Plain text content in messages. | All text models |
ImageInput | Image URL or data URI embedded in message content. | gpt-4o, gpt-4o*, gpt-4.1*, o*, gpt-5* |
AudioInput | Base64-encoded audio content embedded in message input. | gpt-*-audio* |
FileInput | Base64 or URL file attachments in messages. | gpt-4.1*, gpt-5* |
ImageGeneration | Image generation via /images/generations. | gpt-image-1, dall-e-3, dall-e-2 |
Runtime Capability Checking
Every model handle returned byOpenAI::model() or OpenAI::image() implements the supports() and capability() methods. supports() returns a plain boolean for simple guard checks; capability() returns a richer CapabilitySupport object that includes the support state and its source, which is useful for debugging or logging.
source string tells you why a capability is supported or not:
| Source | Meaning |
|---|---|
'catalog' | Resolved from the built-in models.json catalog entry. |
'user-assumed' | Explicitly opted in via ->assume([...]) on this model handle. |
'unknown-model-fallback' | Model not in catalog; TextGeneration is always allowed as a fallback. |
'user-allowed-unknown-capabilities' | All capabilities allowed because ->allowUnknownCapabilities() was called. |
Assuming Capabilities
When a model is not present in the catalog — for example a preview or custom fine-tuned model — or when you need a capability that the catalog does not yet list for a known model, you can opt in at the model handle level without modifying any package files.->assume(array $capabilities): static
Opts in to a specific set of capabilities for this handle only. TextGeneration is still allowed by the unknown-model fallback and does not need to be listed explicitly, though including it is harmless.
->allowUnknownCapabilities(): static
Bypasses all capability checks for this handle. Every supports() call returns true and the source is recorded as 'user-allowed-unknown-capabilities'. Use this during early-access periods when a model’s full capability set is not yet known.
Capability checks prevent silent failures — the SDK throws
CapabilityNotSupportedException before making the HTTP request if the model does not support a required capability. Neither ->assume() nor ->allowUnknownCapabilities() changes what the provider API accepts; they only tell the SDK to skip its pre-flight enforcement. A rejected request will still produce a normalized SDK exception from the provider response.Registering Custom Models
For models you use repeatedly across requests, preferOpenAI::registerModel() over per-handle ->assume(). A registered model is stored in the provider’s model registry and applies to every handle created for that model ID — no per-call configuration needed.
registerModel() parameter documentation.