> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.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](/models/compatibility) 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](/models/model-as-string) 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.
</Note>

## Learn More

<CardGroup cols={2}>
  <Card title="Supported Model Providers" icon="layer-group" href="/models/providers/model-index">
    Choose a provider and configure its credentials.
  </Card>

  <Card title="Model as String" icon="code" href="/models/model-as-string">
    Select a registered provider class with `provider:model_id` syntax.
  </Card>

  <Card title="Compatibility" icon="code-compare" href="/models/compatibility">
    Compare features across model implementations.
  </Card>

  <Card title="Cache Response" icon="database" href="/models/cache-response">
    Cache provider responses to avoid duplicate requests.
  </Card>

  <Card title="Fallback Models" icon="rotate" href="/models/fallback-models">
    Switch models after rate limits, outages, or context-window errors.
  </Card>
</CardGroup>
