| import os | |
| from dotenv import load_dotenv | |
| import requests | |
| load_dotenv() | |
| api_key = os.getenv("ABACUS_API_KEY") | |
| def audit_abacus_models(): | |
| url = "https://routellm.abacus.ai/v1/models" | |
| headers = {"Authorization": f"Bearer {api_key}"} | |
| print("\n--- CONTACTING ABACUS HQ ---") | |
| try: | |
| response = requests.get(url, headers=headers) | |
| if response.status_code != 200: | |
| print(f"Error: {response.status_code} - {response.text}") | |
| return | |
| data = response.json() | |
| model_list = data.get('data', []) | |
| print(f"Found {len(model_list)} models. Filtering for GPT/Claude/Gemini/Sonnet...\n") | |
| # Sort them so they are easier to read | |
| ids = sorted([m.get('id') for m in model_list]) | |
| for model_id in ids: | |
| # Flexible filter | |
| if any(x in model_id.lower() for x in ['gpt', 'claude', 'gemini', 'sonnet']): | |
| print(f"ID: {model_id}") | |
| print("\n[Action] Copy the exact IDs above into your brain.py registry.") | |
| except Exception as e: | |
| print(f"Critical Failure: {e}") | |
| if __name__ == "__main__": | |
| audit_abacus_models() |