Ollama & Open WebUI — Quick Guide @ UiS

Hosted Endpoints

Authentication required. Generate your API key from Open WebUI (Settings → Account) to use with the Ollama API.

1) Get Your API Key

Log in to Open WebUI at https://openwebui.ux.uis.no with your UiS credentials, then generate an API key from Settings → Account.

Store your key securely and never commit it to version control.

2) Quick Check

Make sure the service is up and which models are available.

curl https://ollama.ux.uis.no/status
Which should respond with:
Ollama is running
Check available models with:
curl https://ollama.ux.uis.no/api/tags \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer YOUR_API_KEY"

Need a model pulled (e.g. llama3.3)? Contact Jostein Hagen Lindhom (jostein.lindhom@uis.no) or Theodor Ivesdal (theodor.ivesdal@uis.no).

3) Minimal cURL example

curl https://ollama.ux.uis.no/api/generate \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "model": "llama3.3:70b",
    "prompt": "What is the capital of Norway?",
    "stream": false
  }'

4) Minimal Python example

Requirements: Python ≥ 3.8, ollama package.

from ollama import Client

client = Client(
    host="https://ollama.ux.uis.no",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
    }
)
resp = client.generate(
    model="llama3.3:70b",
    prompt="What is the capital of Norway?",
)
print(resp.get("response") or resp)

API details: Ollama REST API

Troubleshooting

  • 401 Unauthorized: Check that your API key is correct and included in the Authorization header.
  • 404 or 5xx: Check the status page. If down, email the contacts above.
  • Model not found: The name in model must match one from /api/tags.

Copy‑paste snippets

# List models
curl https://ollama.ux.uis.no/api/tags \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer YOUR_API_KEY"

# Simple generate
curl https://ollama.ux.uis.no/api/generate \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{"model":"llama3.3:70b","prompt":"Hi","stream":false}'

# Python (pip install ollama)
from ollama import Client
client = Client(host="https://ollama.ux.uis.no", headers={"Authorization": "Bearer YOUR_API_KEY"})
print(client.generate(model="llama3.3:70b", prompt="Hi"))