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

# Ollama Cloud

> Run gpt-oss:120b on Ollama Cloud with OLLAMA_API_KEY instead of a local Ollama server.

To use Ollama Cloud, you need to set the OLLAMA\_API\_KEY environment variable. Host is set to [https://ollama.com](https://ollama.com) by default.

```python ollama_cloud.py theme={null}
"""To use Ollama Cloud, you need to set the OLLAMA_API_KEY environment variable. Host is set to https://ollama.com by default."""

from agno.agent import Agent
from agno.models.ollama import Ollama

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

agent = Agent(
    model=Ollama(id="gpt-oss:120b-cloud"),
)

agent.print_response("What is the capital of France?", 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 ollama
    ```
  </Step>

  <Step title="Export your Ollama API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OLLAMA_API_KEY="your_ollama_api_key_here"
      ```

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

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

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

Full source: [cookbook/90\_models/ollama/chat/ollama\_cloud.py](https://github.com/agno-agi/agno/blob/main/cookbook/90_models/ollama/chat/ollama_cloud.py)
