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

# 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

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

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno ollama
```

**2. Export your Ollama API key**

```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"
```

**3. Run the example**

Save the code above as `ollama_cloud.py`, then run:

```bash theme={null}
python ollama_cloud.py
```

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


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