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

# Together Reasoning Agent

> Select a current Together reasoning model and print its reasoning steps.

<Warning>
  Together retired the source's `Qwen/Qwen3-235B-A22B-Thinking-2507` serverless model. Select a current model from the [Together reasoning model list](https://docs.together.ai/docs/inference/chat/reasoning) before running. See [Together deprecations](https://docs.together.ai/docs/deprecations).
</Warning>

```python reasoning_agent.py theme={null}
"""
Together Reasoning Agent
========================

Cookbook example for `together/reasoning_agent.py`.
"""

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

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=Together(
        id="Qwen/Qwen3-235B-A22B-Thinking-2507",
    ),
    reasoning=True,
)
agent.print_response("How many r are in the word 'strawberry'?", show_reasoning=True)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai
    ```
  </Step>

  <Step title="Export environment variables">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export TOGETHER_API_KEY="your_together_api_key_here"
      export TOGETHER_REASONING_MODEL_ID="your_current_together_reasoning_model_id_here"
      ```

      ```bash Windows theme={null}
      $Env:TOGETHER_API_KEY="your_together_api_key_here"
      $Env:TOGETHER_REASONING_MODEL_ID="your_current_together_reasoning_model_id_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Use the selected reasoning model">
    Add `import os`, then replace `"Qwen/Qwen3-235B-A22B-Thinking-2507"` with `os.environ["TOGETHER_REASONING_MODEL_ID"]` in the saved file.
  </Step>

  <Step title="Run the example">
    Save the code above as `reasoning_agent.py`, then run:

    ```bash theme={null}
    python reasoning_agent.py
    ```
  </Step>
</Steps>

Full source: [cookbook/90\_models/together/reasoning\_agent.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/together/reasoning_agent.py)
