import asyncio, httpx, json

async def test():
    cfg = json.load(open("/root/.nanobot/config.json"))
    api_key = cfg["providers"]["openai"]["apiKey"]
    async with httpx.AsyncClient(timeout=30) as client:
        r = await client.post(
            "https://codeproxy.dev/v1/responses",
            headers={
                "Authorization": f"Bearer {api_key}",
                "Content-Type": "application/json",
                "OpenAI-Beta": "responses-2024-12-01"
            },
            json={"model": "gpt-5.4", "input": [{"type": "message", "role": "user", "content": [{"type": "input_text", "text": "hi"}]}]}
        )
        print(r.status_code, r.text[:300])

asyncio.run(test())
