| import httpx | |
| import json | |
| import asyncio | |
| async def test(): | |
| headers = { | |
| "Content-Type": "application/json", | |
| "Authorization": "Bearer sk-rOiDSQkoe2VgPbWJVbWbLXo2PrmEYVAVoFCrcNjGAMgPmnsOxLQ5XBsSHbGhrStv", | |
| } | |
| body = {"model": "kimi-k2.5", "messages": [{"role": "user", "content": "hello"}]} | |
| async with httpx.AsyncClient(timeout=30) 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()) | |