File size: 913 Bytes
61bb677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import sys
import asyncio

def run():
    from fastapi.testclient import TestClient
    from free_claude_code.runtime.bootstrap import build_asgi_app
    from free_claude_code.config.settings import Settings
    from free_claude_code.api.dependencies import require_proxy_auth

    app = build_asgi_app(Settings(nvidia_nim_api_key="FAKE"))
    
    # Bypass proxy auth completely
    app.dependency_overrides[require_proxy_auth] = lambda: None

    client = TestClient(app, raise_server_exceptions=True)

    try:
        response = client.post(
            "/v1/messages",
            json={
                "model": "nvidia/nemotron",
                "messages": [{"role": "user", "content": "hi"}],
                "max_tokens": 10
            }
        )
        print(response.status_code)
        print(response.text)
    except Exception as e:
        import traceback
        traceback.print_exc()

run()