> ## 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.

# Together

> Use Together AI models with Agno agents.

Together is a platform for providing endpoints for large language models.
See the current [serverless model catalog](https://docs.together.ai/docs/serverless/models). Together retires model IDs on a rolling schedule, so verify availability and required capabilities before deployment.

We recommend experimenting to find the best-suited model for your use case.

Together uses dynamic per-model rate limits that adjust to your usage instead of fixed tiers. See the [rate limit docs](https://docs.together.ai/docs/rate-limits).

## Authentication

Set your `TOGETHER_API_KEY` environment variable. Get your key [from Together here](https://api.together.xyz/settings/api-keys).

```bash Mac theme={null}
export TOGETHER_API_KEY=***
export TOGETHER_MODEL_ID=your-model-id
```

```powershell Windows theme={null}
$Env:TOGETHER_API_KEY="your_api_key"
$Env:TOGETHER_MODEL_ID="your_model_id"
```

## Example

Install the `openai` package:

```shell theme={null}
uv pip install -U agno openai
```

Use `Together` with your `Agent`:

```python agent.py theme={null}
import os

from agno.agent import Agent
from agno.models.together import Together

agent = Agent(
    model=Together(id=os.environ["TOGETHER_MODEL_ID"]),
    markdown=True
)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")
```

> [!NOTE]
>
> View more examples [here](https://agno-v2.mintlify.site/models/providers/gateways/together/usage/basic-stream.md).

## Params

| Parameter | Type | Default | Description |
| - | - | - | - |
| `id` | `str` | `"MiniMaxAI/MiniMax-M2.7"` | The id of the Together model to use |
| `name` | `str` | `"Together"` | The name of the model |
| `provider` | `str` | `"Together"` | The provider of the model |
| `api_key` | `Optional[str]` | `None` | The API key for Together (defaults to TOGETHER\_API\_KEY env var) |
| `base_url` | `str` | `"https://api.together.xyz/v1"` | The base URL for the Together API |

`Together` also supports the params of [OpenAI](https://agno-v2.mintlify.site/reference/models/openai.md).


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