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

# Chat Reasoning O3 Mini

> Run o3-mini with high reasoning effort and YFinance tools to write a stock report.

```python reasoning_o3_mini.py theme={null}
"""
Openai Reasoning O3 Mini
========================

Cookbook example for `openai/chat/reasoning_o3_mini.py`.
"""

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.yfinance import YFinanceTools

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

agent = Agent(
    model=OpenAIChat(id="o3-mini", reasoning_effort="high"),
    tools=[YFinanceTools()],
    markdown=True,
)

# Print the response in the terminal
agent.print_response("Write a report on the NVDA, is it a good buy?", stream=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 yfinance
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

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

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

Full source: [cookbook/90\_models/openai/chat/reasoning\_o3\_mini.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/openai/chat/reasoning_o3_mini.py)
