Telegram-Bot / test_models.py
H3y-sam's picture
Upload 58 files
b07da3d verified
Raw History Blame Contribute Delete
506 Bytes
import httpx
import asyncio
async def fetch_models():
url = 'https://openrouter.ai/api/v1/models'
async with httpx.AsyncClient() as client:
resp = await client.get(url)
if resp.status_code == 200:
data = resp.json()
free_models = [m['id'] for m in data['data'] if 'free' in m['id']]
print('Free Models:')
for m in free_models:
print(m)
else:
print('Failed to fetch')
asyncio.run(fetch_models())