| import requests |
| import json |
| import time |
| import sys |
|
|
| |
| base_url = "https://anonsarb-antigravity.hf.space" |
| api_key = "sk-4ab798eb352e4e049715985d3b26bcf1" |
| headers = { |
| "Authorization": f"Bearer {api_key}", |
| "Content-Type": "application/json" |
| } |
|
|
| def test_rotation(): |
| print(f"--- Starting Rotation Test (10 requests) ---") |
| success_count = 0 |
| failure_count = 0 |
| |
| for i in range(1, 11): |
| print(f"\n[Request #{i}] Testing gemini-3-flash...") |
| payload = { |
| "model": "gemini-3-flash", |
| "messages": [{"role": "user", "content": f"Test #{i}. Say 'OK' and nothing else."}], |
| "stream": False |
| } |
| try: |
| response = requests.post(f"{base_url}/v1/chat/completions", headers=headers, json=payload, timeout=30) |
| if response.status_code == 200: |
| content = response.json()['choices'][0]['message']['content'] |
| print(f"SUCCESS: {content.strip()}") |
| success_count += 1 |
| else: |
| print(f"FAILURE: {response.status_code}") |
| try: |
| err_data = response.json() |
| msg = str(err_data) |
| print(f" Error: {msg[:200]}...") |
| except: |
| pass |
| failure_count += 1 |
| except Exception as e: |
| print(f"EXCEPTION: {e}") |
| failure_count += 1 |
| |
| time.sleep(0.5) |
|
|
| print(f"\n--- Final Results ---") |
| print(f"Success: {success_count}") |
| print(f"Failures: {failure_count}") |
|
|
| if __name__ == "__main__": |
| test_rotation() |
|
|