File size: 822 Bytes
ecfad22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import httpx
import json
import asyncio


async def test():
    headers = {
        "Content-Type": "application/json",
        "Authorization": "Bearer sk-rOiDSQkoe2VgPbWJVbWbLXo2PrmEYVAVoFCrcNjGAMgPmnsOxLQ5XBsSHbGhrStv",
    }
    body = {
        "model": "kimi-k2.5",
        "temperature": 0.7,
        "messages": [
            {
                "role": "system",
                "content": "You are an AI agent designed to operate in an iterative loop to automate browser tasks.",
            }
        ],
    }
    async with httpx.AsyncClient(timeout=60) as client:
        resp = await client.post(
            "https://opencode.ai/zen/go/v1/chat/completions", json=body, headers=headers
        )
        print(f"Status: {resp.status_code}")
        print(f"Response: {resp.text[:1000]}")


asyncio.run(test())