> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# What are Models?

> Configure the language model that an Agent or Team uses, including provider selection and request retries.

```python theme={null}
from agno.agent import Agent
from agno.models.openai import OpenAIResponses

agent = Agent(
    model=OpenAIResponses(id="gpt-5.4"),
    markdown=True,
)

agent.print_response("Share a two-sentence horror story.", stream=True)
```

Models connect Agents and Teams to model-provider APIs. The model class determines the API implementation, while `id` selects the provider's model or deployment.

Install the provider integration and set its credentials before running the example:

```bash theme={null}
uv pip install "agno[openai]"
export OPENAI_API_KEY="your-api-key"
```

Model capabilities vary by provider, API, and model ID. Check [model compatibility](https://agno-v2.mintlify.site/models/compatibility.md) before relying on features such as multimodal input or native structured output.

## Configure a Model

| Configuration | Use it when |
| - | - |
| `model="openai:gpt-5.4"` | You need a built-in provider class with its default settings |
| `model=OpenAIResponses(id="gpt-5.4", ...)` | You need provider parameters, custom clients, endpoints, or retry settings |

The string form constructs the registered provider class with the supplied model ID. See [Model as String](https://agno-v2.mintlify.site/models/model-as-string.md) for provider keys and API variants.

## Retry Model Requests

Configure retries on the model class for transient provider errors such as rate limits and server errors:

```python theme={null}
from agno.models.openai import OpenAIResponses

model = OpenAIResponses(
    id="gpt-5.4",
    retries=2,
    delay_between_retries=1,
    exponential_backoff=True,
)
```

| Parameter | Default | Description |
| - | -: | - |
| `retries` | `0` | Additional request attempts after the first attempt |
| `delay_between_retries` | `1` | Seconds to wait before the first retry |
| `exponential_backoff` | `False` | Double the delay after each failed attempt |

Model retries skip non-retryable errors such as authentication failures, invalid requests, and context-window errors. A retry after a streaming error restarts the entire model stream. Chunks emitted before the failure remain visible to the caller.

> [!NOTE]
>
> Set `retries`, `delay_between_retries`, and `exponential_backoff` on an Agent or Team to retry the full run instead of an individual model request.

## Learn More

> **[Supported Model Providers](https://agno-v2.mintlify.site/models/providers/model-index.md)**
>
> Choose a provider and configure its credentials.

> **[Model as String](https://agno-v2.mintlify.site/models/model-as-string.md)**
>
> Select a registered provider class with `provider:model_id` syntax.

> **[Compatibility](https://agno-v2.mintlify.site/models/compatibility.md)**
>
> Compare features across model implementations.

> **[Cache Response](https://agno-v2.mintlify.site/models/cache-response.md)**
>
> Cache provider responses to avoid duplicate requests.

> **[Fallback Models](https://agno-v2.mintlify.site/models/fallback-models.md)**
>
> Switch models after rate limits, outages, or context-window errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.