File size: 1,095 Bytes
ce48984
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""Test ATHENEA Modal endpoint"""
import requests
import json

URL = "https://anthonypacheco289--athenea-v2-atheneaapi-serve.modal.run"
API_KEY = "sk-athenea-v2-2026"

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

# Test 1: Health
print("=== Testing /health ===")
try:
    r = requests.get(f"{URL}/health", timeout=60)
    print(f"Status: {r.status_code}")
    print(r.json())
except Exception as e:
    print(f"Error: {e}")

# Test 2: Chat Completions
print("\n=== Testing /v1/chat/completions ===")
payload = {
    "model": "atheneav2-j-q6_k",
    "messages": [
        {"role": "user", "content": "Hola, quien eres?"}
    ],
    "temperature": 0.7,
    "max_tokens": 256
}

try:
    r = requests.post(f"{URL}/v1/chat/completions", headers=headers, json=payload, timeout=120)
    print(f"Status: {r.status_code}")
    if r.status_code == 200:
        result = r.json()
        print(f"Response: {result['choices'][0]['message']['content'][:300]}...")
    else:
        print(f"Error: {r.text}")
except Exception as e:
    print(f"Error: {e}")