File size: 501 Bytes
122cc3c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""List available models on the configured API."""

import os

import requests
from dotenv import load_dotenv

load_dotenv()

API_KEY = os.getenv("API_KEY") or os.getenv("ZENMUX_API_KEY")
BASE_URL = os.getenv("BASE_URL") or os.getenv("ZENMUX_BASE_URL")

headers = {"Authorization": f"Bearer {API_KEY}"}

try:
    resp = requests.get(f"{BASE_URL}/models", headers=headers, timeout=30)
    print(f"Status: {resp.status_code}")
    print(resp.text[:2000])
except Exception as e:
    print(f"Error: {e}")