[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76XTK4V1DENFF0AM7PG9DTQ":3,"skill-same:01M76XTK4V1DENFF0AM7PG9DTQ":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":40,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M76XTK4V1DENFF0AM7PG9DTQ","llm-router",null,"Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Frenning22\u002Fasia-llm-router-skills\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: llm-router\ndescription: \"Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key.\"\nhomepage: https:\u002F\u002Fopenclaw.ai\nmetadata: {\"openclaw\":{\"emoji\":\"🧠\",\"requires\":{\"bins\":[\"curl\",\"python3\"],\"env\":[\"AISA_API_KEY\"]},\"primaryEnv\":\"AISA_API_KEY\"}}\n---\n\n# OpenClaw LLM Router 🧠\n\n**Unified LLM Gateway for autonomous agents. Powered by AIsa.**\n\nOne API key. 70+ models. OpenAI-compatible.\n\nReplace 100+ API keys with one. Access GPT-4, Claude-3, Gemini, Qwen, Deepseek, Grok, and more through a unified, OpenAI-compatible API.\n\n## 🔥 What Can You Do?\n\n### Multi-Model Chat\n```\n\"Chat with GPT-4 for reasoning, switch to Claude for creative writing\"\n```\n\n### Model Comparison\n```\n\"Compare responses from GPT-4, Claude, and Gemini for the same question\"\n```\n\n### Vision Analysis\n```\n\"Analyze this image with GPT-4o - what objects are in it?\"\n```\n\n### Cost Optimization\n```\n\"Route simple queries to fast\u002Fcheap models, complex queries to GPT-4\"\n```\n\n### Fallback Strategy\n```\n\"If GPT-4 fails, automatically try Claude, then Gemini\"\n```\n\n## Why LLM Router?\n\n| Feature | LLM Router | Direct APIs |\n|---------|------------|-------------|\n| API Keys | 1 | 10+ |\n| SDK Compatibility | OpenAI SDK | Multiple SDKs |\n| Billing | Unified | Per-provider |\n| Model Switching | Change string | Code rewrite |\n| Fallback Routing | Built-in | DIY |\n| Cost Tracking | Unified | Fragmented |\n\n## Supported Model Families\n\n| Family | Developer | Example Models |\n|--------|-----------|----------------|\n| GPT | OpenAI | gpt-4.1, gpt-4o, gpt-4o-mini, o1, o1-mini, o3-mini |\n| Claude | Anthropic | claude-3-5-sonnet, claude-3-opus, claude-3-sonnet |\n| Gemini | Google | gemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash |\n| Qwen | Alibaba | qwen-max, qwen-plus, qwen2.5-72b-instruct |\n| Deepseek | Deepseek | deepseek-chat, deepseek-coder, deepseek-v3, deepseek-r1 |\n| Grok | xAI | grok-2, grok-beta |\n\n> **Note**: Model availability may vary. Check [marketplace.aisa.one\u002Fpricing](https:\u002F\u002Fmarketplace.aisa.one\u002Fpricing) for the full list of currently available models and pricing.\n\n## Quick Start\n\n```bash\nexport AISA_API_KEY=\"your-key\"\n```\n\n## API Endpoints\n\n### OpenAI-Compatible Chat Completions\n\n```\nPOST https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\n```\n\n#### Request\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"gpt-4.1\",\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n      {\"role\": \"user\", \"content\": \"Explain quantum computing in simple terms.\"}\n    ],\n    \"temperature\": 0.7,\n    \"max_tokens\": 1000\n  }'\n```\n\n#### Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `model` | string | Yes | Model identifier (e.g., `gpt-4.1`, `claude-3-sonnet`) |\n| `messages` | array | Yes | Conversation messages |\n| `temperature` | number | No | Randomness (0-2, default: 1) |\n| `max_tokens` | integer | No | Maximum response tokens |\n| `stream` | boolean | No | Enable streaming (default: false) |\n| `top_p` | number | No | Nucleus sampling (0-1) |\n| `frequency_penalty` | number | No | Frequency penalty (-2 to 2) |\n| `presence_penalty` | number | No | Presence penalty (-2 to 2) |\n| `stop` | string\u002Farray | No | Stop sequences |\n\n#### Message Format\n\n```json\n{\n  \"role\": \"user|assistant|system\",\n  \"content\": \"message text or array for multimodal\"\n}\n```\n\n#### Response\n\n```json\n{\n  \"id\": \"chatcmpl-xxx\",\n  \"object\": \"chat.completion\",\n  \"created\": 1234567890,\n  \"model\": \"gpt-4.1\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"Quantum computing uses...\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 50,\n    \"completion_tokens\": 200,\n    \"total_tokens\": 250,\n    \"cost\": 0.0025\n  }\n}\n```\n\n### Streaming Response\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"claude-3-sonnet\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write a poem about AI.\"}],\n    \"stream\": true\n  }'\n```\n\nStreaming returns Server-Sent Events (SSE):\n\n```\ndata: {\"id\":\"chatcmpl-xxx\",\"choices\":[{\"delta\":{\"content\":\"In\"}}]}\ndata: {\"id\":\"chatcmpl-xxx\",\"choices\":[{\"delta\":{\"content\":\" circuits\"}}]}\n...\ndata: [DONE]\n```\n\n### Vision \u002F Image Analysis\n\nAnalyze images by passing image URLs or base64 data:\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"gpt-4o\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\"type\": \"text\", \"text\": \"What is in this image?\"},\n          {\"type\": \"image_url\", \"image_url\": {\"url\": \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"}}\n        ]\n      }\n    ]\n  }'\n```\n\n### Function Calling\n\nEnable tools\u002Ffunctions for structured outputs:\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"gpt-4.1\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What is the weather in Tokyo?\"}],\n    \"functions\": [\n      {\n        \"name\": \"get_weather\",\n        \"description\": \"Get current weather for a location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\"type\": \"string\", \"description\": \"City name\"},\n            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]}\n          },\n          \"required\": [\"location\"]\n        }\n      }\n    ],\n    \"function_call\": \"auto\"\n  }'\n```\n\n### Google Gemini Format\n\nFor Gemini models, you can also use the native format:\n\n```\nPOST https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fmodels\u002F{model}:generateContent\n```\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fmodels\u002Fgemini-2.0-flash:generateContent\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"contents\": [\n      {\n        \"role\": \"user\",\n        \"parts\": [{\"text\": \"Explain machine learning.\"}]\n      }\n    ],\n    \"generationConfig\": {\n      \"temperature\": 0.7,\n      \"maxOutputTokens\": 1000\n    }\n  }'\n```\n\n## Python Client\n\n### Installation\n\nNo installation required - uses standard library only.\n\n### CLI Usage\n\n```bash\n# Basic completion\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model gpt-4.1 --message \"Hello, world!\"\n\n# With system prompt\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model claude-3-sonnet --system \"You are a poet\" --message \"Write about the moon\"\n\n# Streaming\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model gpt-4o --message \"Tell me a story\" --stream\n\n# Multi-turn conversation\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model qwen-max --messages '[{\"role\":\"user\",\"content\":\"Hi\"},{\"role\":\"assistant\",\"content\":\"Hello!\"},{\"role\":\"user\",\"content\":\"How are you?\"}]'\n\n# Vision analysis\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py vision --model gpt-4o --image \"https:\u002F\u002Fexample.com\u002Fimage.jpg\" --prompt \"Describe this image\"\n\n# List supported models\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py models\n\n# Compare models\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py compare --models \"gpt-4.1,claude-3-sonnet,gemini-2.0-flash\" --message \"What is 2+2?\"\n```\n\n### Python SDK Usage\n\n```python\nfrom llm_router_client import LLMRouterClient\n\nclient = LLMRouterClient()  # Uses AISA_API_KEY env var\n\n# Simple chat\nresponse = client.chat(\n    model=\"gpt-4.1\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}]\n)\nprint(response[\"choices\"][0][\"message\"][\"content\"])\n\n# With options\nresponse = client.chat(\n    model=\"claude-3-sonnet\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": \"Explain relativity.\"}\n    ],\n    temperature=0.7,\n    max_tokens=500\n)\n\n# Streaming\nfor chunk in client.chat_stream(\n    model=\"gpt-4o\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a story.\"}]\n):\n    print(chunk, end=\"\", flush=True)\n\n# Vision\nresponse = client.vision(\n    model=\"gpt-4o\",\n    image_url=\"https:\u002F\u002Fexample.com\u002Fimage.jpg\",\n    prompt=\"What's in this image?\"\n)\n\n# Compare models\nresults = client.compare_models(\n    models=[\"gpt-4.1\", \"claude-3-sonnet\", \"gemini-2.0-flash\"],\n    message=\"Explain quantum computing\"\n)\nfor model, result in results.items():\n    print(f\"{model}: {result['response'][:100]}...\")\n```\n\n## Use Cases\n\n### 1. Cost-Optimized Routing\n\nUse cheaper models for simple tasks:\n\n```python\ndef smart_route(message: str) -> str:\n    # Simple queries -> fast\u002Fcheap model\n    if len(message) \u003C 50:\n        model = \"gpt-3.5-turbo\"\n    # Complex reasoning -> powerful model\n    else:\n        model = \"gpt-4.1\"\n    \n    return client.chat(model=model, messages=[{\"role\": \"user\", \"content\": message}])\n```\n\n### 2. Fallback Strategy\n\nAutomatic fallback on failure:\n\n```python\ndef chat_with_fallback(message: str) -> str:\n    models = [\"gpt-4.1\", \"claude-3-sonnet\", \"gemini-2.0-flash\"]\n    \n    for model in models:\n        try:\n            return client.chat(model=model, messages=[{\"role\": \"user\", \"content\": message}])\n        except Exception:\n            continue\n    \n    raise Exception(\"All models failed\")\n```\n\n### 3. Model A\u002FB Testing\n\nCompare model outputs:\n\n```python\nresults = client.compare_models(\n    models=[\"gpt-4.1\", \"claude-3-opus\"],\n    message=\"Analyze this quarterly report...\"\n)\n\n# Log for analysis\nfor model, result in results.items():\n    log_response(model=model, latency=result[\"latency\"], cost=result[\"cost\"])\n```\n\n### 4. Specialized Model Selection\n\nChoose the best model for each task:\n\n```python\nMODEL_MAP = {\n    \"code\": \"deepseek-coder\",\n    \"creative\": \"claude-3-opus\",\n    \"fast\": \"gpt-3.5-turbo\",\n    \"vision\": \"gpt-4o\",\n    \"chinese\": \"qwen-max\",\n    \"reasoning\": \"gpt-4.1\"\n}\n\ndef route_by_task(task_type: str, message: str) -> str:\n    model = MODEL_MAP.get(task_type, \"gpt-4.1\")\n    return client.chat(model=model, messages=[{\"role\": \"user\", \"content\": message}])\n```\n\n## Error Handling\n\nErrors return JSON with `error` field:\n\n```json\n{\n  \"error\": {\n    \"code\": \"model_not_found\",\n    \"message\": \"Model 'xyz' is not available\"\n  }\n}\n```\n\nCommon error codes:\n- `401` - Invalid or missing API key\n- `402` - Insufficient credits\n- `404` - Model not found\n- `429` - Rate limit exceeded\n- `500` - Server error\n\n## Best Practices\n\n1. **Use streaming** for long responses to improve UX\n2. **Set max_tokens** to control costs\n3. **Implement fallback** for production reliability\n4. **Cache responses** for repeated queries\n5. **Monitor usage** via response metadata\n6. **Use appropriate models** - don't use GPT-4 for simple tasks\n\n## OpenAI SDK Compatibility\n\nJust change the base URL and key:\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"AISA_API_KEY\"],\n    base_url=\"https:\u002F\u002Fapi.aisa.one\u002Fv1\"\n)\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4.1\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}]\n)\nprint(response.choices[0].message.content)\n```\n\n## Pricing\n\nToken-based pricing varies by model. Check [marketplace.aisa.one\u002Fpricing](https:\u002F\u002Fmarketplace.aisa.one\u002Fpricing) for current rates.\n\n| Model Family | Approximate Cost |\n|--------------|------------------|\n| GPT-4.1 \u002F GPT-4o | ~$0.01 \u002F 1K tokens |\n| Claude-3-Sonnet | ~$0.01 \u002F 1K tokens |\n| Gemini-2.0-Flash | ~$0.001 \u002F 1K tokens |\n| Qwen-Max | ~$0.005 \u002F 1K tokens |\n| DeepSeek-V3 | ~$0.002 \u002F 1K tokens |\n\nEvery response includes `usage.cost` and `usage.credits_remaining`.\n\n## Get Started\n\n1. Sign up at [aisa.one](https:\u002F\u002Faisa.one)\n2. Get your API key from the dashboard\n3. Add credits (pay-as-you-go)\n4. Set environment variable: `export AISA_API_KEY=\"your-key\"`\n\n## Full API Reference\n\nSee [API Reference](https:\u002F\u002Faisa.mintlify.app\u002Fapi-reference\u002Fintroduction) for complete endpoint documentation.\n","# OpenClaw LLM Router 🧠\n\n**Unified LLM Gateway for autonomous agents. Powered by AIsa.**\n\nOne API key. 70+ models. OpenAI-compatible.\n\nReplace 100+ API keys with one. Access GPT-4, Claude-3, Gemini, Qwen, Deepseek, Grok, and more through a unified, OpenAI-compatible API.\n\n## 🔥 What Can You Do?\n\n### Multi-Model Chat\n```\n\"Chat with GPT-4 for reasoning, switch to Claude for creative writing\"\n```\n\n### Model Comparison\n```\n\"Compare responses from GPT-4, Claude, and Gemini for the same question\"\n```\n\n### Vision Analysis\n```\n\"Analyze this image with GPT-4o - what objects are in it?\"\n```\n\n### Cost Optimization\n```\n\"Route simple queries to fast\u002Fcheap models, complex queries to GPT-4\"\n```\n\n### Fallback Strategy\n```\n\"If GPT-4 fails, automatically try Claude, then Gemini\"\n```\n\n## Why LLM Router?\n\n| Feature | LLM Router | Direct APIs |\n|---------|------------|-------------|\n| API Keys | 1 | 10+ |\n| SDK Compatibility | OpenAI SDK | Multiple SDKs |\n| Billing | Unified | Per-provider |\n| Model Switching | Change string | Code rewrite |\n| Fallback Routing | Built-in | DIY |\n| Cost Tracking | Unified | Fragmented |\n\n## Supported Model Families\n\n| Family | Developer | Example Models |\n|--------|-----------|----------------|\n| GPT | OpenAI | gpt-4.1, gpt-4o, gpt-4o-mini, o1, o1-mini, o3-mini |\n| Claude | Anthropic | claude-3-5-sonnet, claude-3-opus, claude-3-sonnet |\n| Gemini | Google | gemini-2.0-flash, gemini-1.5-pro, gemini-1.5-flash |\n| Qwen | Alibaba | qwen-max, qwen-plus, qwen2.5-72b-instruct |\n| Deepseek | Deepseek | deepseek-chat, deepseek-coder, deepseek-v3, deepseek-r1 |\n| Grok | xAI | grok-2, grok-beta |\n\n> **Note**: Model availability may vary. Check [marketplace.aisa.one\u002Fpricing](https:\u002F\u002Fmarketplace.aisa.one\u002Fpricing) for the full list of currently available models and pricing.\n\n## Quick Start\n\n```bash\nexport AISA_API_KEY=\"your-key\"\n```\n\n## API Endpoints\n\n### OpenAI-Compatible Chat Completions\n\n```\nPOST https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\n```\n\n#### Request\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"gpt-4.1\",\n    \"messages\": [\n      {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n      {\"role\": \"user\", \"content\": \"Explain quantum computing in simple terms.\"}\n    ],\n    \"temperature\": 0.7,\n    \"max_tokens\": 1000\n  }'\n```\n\n#### Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `model` | string | Yes | Model identifier (e.g., `gpt-4.1`, `claude-3-sonnet`) |\n| `messages` | array | Yes | Conversation messages |\n| `temperature` | number | No | Randomness (0-2, default: 1) |\n| `max_tokens` | integer | No | Maximum response tokens |\n| `stream` | boolean | No | Enable streaming (default: false) |\n| `top_p` | number | No | Nucleus sampling (0-1) |\n| `frequency_penalty` | number | No | Frequency penalty (-2 to 2) |\n| `presence_penalty` | number | No | Presence penalty (-2 to 2) |\n| `stop` | string\u002Farray | No | Stop sequences |\n\n#### Message Format\n\n```json\n{\n  \"role\": \"user|assistant|system\",\n  \"content\": \"message text or array for multimodal\"\n}\n```\n\n#### Response\n\n```json\n{\n  \"id\": \"chatcmpl-xxx\",\n  \"object\": \"chat.completion\",\n  \"created\": 1234567890,\n  \"model\": \"gpt-4.1\",\n  \"choices\": [\n    {\n      \"index\": 0,\n      \"message\": {\n        \"role\": \"assistant\",\n        \"content\": \"Quantum computing uses...\"\n      },\n      \"finish_reason\": \"stop\"\n    }\n  ],\n  \"usage\": {\n    \"prompt_tokens\": 50,\n    \"completion_tokens\": 200,\n    \"total_tokens\": 250,\n    \"cost\": 0.0025\n  }\n}\n```\n\n### Streaming Response\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"claude-3-sonnet\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Write a poem about AI.\"}],\n    \"stream\": true\n  }'\n```\n\nStreaming returns Server-Sent Events (SSE):\n\n```\ndata: {\"id\":\"chatcmpl-xxx\",\"choices\":[{\"delta\":{\"content\":\"In\"}}]}\ndata: {\"id\":\"chatcmpl-xxx\",\"choices\":[{\"delta\":{\"content\":\" circuits\"}}]}\n...\ndata: [DONE]\n```\n\n### Vision \u002F Image Analysis\n\nAnalyze images by passing image URLs or base64 data:\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"gpt-4o\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": [\n          {\"type\": \"text\", \"text\": \"What is in this image?\"},\n          {\"type\": \"image_url\", \"image_url\": {\"url\": \"https:\u002F\u002Fexample.com\u002Fimage.jpg\"}}\n        ]\n      }\n    ]\n  }'\n```\n\n### Function Calling\n\nEnable tools\u002Ffunctions for structured outputs:\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fchat\u002Fcompletions\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"model\": \"gpt-4.1\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"What is the weather in Tokyo?\"}],\n    \"functions\": [\n      {\n        \"name\": \"get_weather\",\n        \"description\": \"Get current weather for a location\",\n        \"parameters\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"location\": {\"type\": \"string\", \"description\": \"City name\"},\n            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]}\n          },\n          \"required\": [\"location\"]\n        }\n      }\n    ],\n    \"function_call\": \"auto\"\n  }'\n```\n\n### Google Gemini Format\n\nFor Gemini models, you can also use the native format:\n\n```\nPOST https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fmodels\u002F{model}:generateContent\n```\n\n```bash\ncurl -X POST \"https:\u002F\u002Fapi.aisa.one\u002Fv1\u002Fmodels\u002Fgemini-2.0-flash:generateContent\" \\\n  -H \"Authorization: Bearer $AISA_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"contents\": [\n      {\n        \"role\": \"user\",\n        \"parts\": [{\"text\": \"Explain machine learning.\"}]\n      }\n    ],\n    \"generationConfig\": {\n      \"temperature\": 0.7,\n      \"maxOutputTokens\": 1000\n    }\n  }'\n```\n\n## Python Client\n\n### Installation\n\nNo installation required - uses standard library only.\n\n### CLI Usage\n\n```bash\n# Basic completion\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model gpt-4.1 --message \"Hello, world!\"\n\n# With system prompt\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model claude-3-sonnet --system \"You are a poet\" --message \"Write about the moon\"\n\n# Streaming\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model gpt-4o --message \"Tell me a story\" --stream\n\n# Multi-turn conversation\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py chat --model qwen-max --messages '[{\"role\":\"user\",\"content\":\"Hi\"},{\"role\":\"assistant\",\"content\":\"Hello!\"},{\"role\":\"user\",\"content\":\"How are you?\"}]'\n\n# Vision analysis\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py vision --model gpt-4o --image \"https:\u002F\u002Fexample.com\u002Fimage.jpg\" --prompt \"Describe this image\"\n\n# List supported models\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py models\n\n# Compare models\npython3 {baseDir}\u002Fscripts\u002Fllm_router_client.py compare --models \"gpt-4.1,claude-3-sonnet,gemini-2.0-flash\" --message \"What is 2+2?\"\n```\n\n### Python SDK Usage\n\n```python\nfrom llm_router_client import LLMRouterClient\n\nclient = LLMRouterClient()  # Uses AISA_API_KEY env var\n\n# Simple chat\nresponse = client.chat(\n    model=\"gpt-4.1\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}]\n)\nprint(response[\"choices\"][0][\"message\"][\"content\"])\n\n# With options\nresponse = client.chat(\n    model=\"claude-3-sonnet\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n        {\"role\": \"user\", \"content\": \"Explain relativity.\"}\n    ],\n    temperature=0.7,\n    max_tokens=500\n)\n\n# Streaming\nfor chunk in client.chat_stream(\n    model=\"gpt-4o\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a story.\"}]\n):\n    print(chunk, end=\"\", flush=True)\n\n# Vision\nresponse = client.vision(\n    model=\"gpt-4o\",\n    image_url=\"https:\u002F\u002Fexample.com\u002Fimage.jpg\",\n    prompt=\"What's in this image?\"\n)\n\n# Compare models\nresults = client.compare_models(\n    models=[\"gpt-4.1\", \"claude-3-sonnet\", \"gemini-2.0-flash\"],\n    message=\"Explain quantum computing\"\n)\nfor model, result in results.items():\n    print(f\"{model}: {result['response'][:100]}...\")\n```\n\n## Use Cases\n\n### 1. Cost-Optimized Routing\n\nUse cheaper models for simple tasks:\n\n```python\ndef smart_route(message: str) -> str:\n    # Simple queries -> fast\u002Fcheap model\n    if len(message) \u003C 50:\n        model = \"gpt-3.5-turbo\"\n    # Complex reasoning -> powerful model\n    else:\n        model = \"gpt-4.1\"\n    \n    return client.chat(model=model, messages=[{\"role\": \"user\", \"content\": message}])\n```\n\n### 2. Fallback Strategy\n\nAutomatic fallback on failure:\n\n```python\ndef chat_with_fallback(message: str) -> str:\n    models = [\"gpt-4.1\", \"claude-3-sonnet\", \"gemini-2.0-flash\"]\n    \n    for model in models:\n        try:\n            return client.chat(model=model, messages=[{\"role\": \"user\", \"content\": message}])\n        except Exception:\n            continue\n    \n    raise Exception(\"All models failed\")\n```\n\n### 3. Model A\u002FB Testing\n\nCompare model outputs:\n\n```python\nresults = client.compare_models(\n    models=[\"gpt-4.1\", \"claude-3-opus\"],\n    message=\"Analyze this quarterly report...\"\n)\n\n# Log for analysis\nfor model, result in results.items():\n    log_response(model=model, latency=result[\"latency\"], cost=result[\"cost\"])\n```\n\n### 4. Specialized Model Selection\n\nChoose the best model for each task:\n\n```python\nMODEL_MAP = {\n    \"code\": \"deepseek-coder\",\n    \"creative\": \"claude-3-opus\",\n    \"fast\": \"gpt-3.5-turbo\",\n    \"vision\": \"gpt-4o\",\n    \"chinese\": \"qwen-max\",\n    \"reasoning\": \"gpt-4.1\"\n}\n\ndef route_by_task(task_type: str, message: str) -> str:\n    model = MODEL_MAP.get(task_type, \"gpt-4.1\")\n    return client.chat(model=model, messages=[{\"role\": \"user\", \"content\": message}])\n```\n\n## Error Handling\n\nErrors return JSON with `error` field:\n\n```json\n{\n  \"error\": {\n    \"code\": \"model_not_found\",\n    \"message\": \"Model 'xyz' is not available\"\n  }\n}\n```\n\nCommon error codes:\n- `401` - Invalid or missing API key\n- `402` - Insufficient credits\n- `404` - Model not found\n- `429` - Rate limit exceeded\n- `500` - Server error\n\n## Best Practices\n\n1. **Use streaming** for long responses to improve UX\n2. **Set max_tokens** to control costs\n3. **Implement fallback** for production reliability\n4. **Cache responses** for repeated queries\n5. **Monitor usage** via response metadata\n6. **Use appropriate models** - don't use GPT-4 for simple tasks\n\n## OpenAI SDK Compatibility\n\nJust change the base URL and key:\n\n```python\nimport os\nfrom openai import OpenAI\n\nclient = OpenAI(\n    api_key=os.environ[\"AISA_API_KEY\"],\n    base_url=\"https:\u002F\u002Fapi.aisa.one\u002Fv1\"\n)\n\nresponse = client.chat.completions.create(\n    model=\"gpt-4.1\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}]\n)\nprint(response.choices[0].message.content)\n```\n\n## Pricing\n\nToken-based pricing varies by model. Check [marketplace.aisa.one\u002Fpricing](https:\u002F\u002Fmarketplace.aisa.one\u002Fpricing) for current rates.\n\n| Model Family | Approximate Cost |\n|--------------|------------------|\n| GPT-4.1 \u002F GPT-4o | ~$0.01 \u002F 1K tokens |\n| Claude-3-Sonnet | ~$0.01 \u002F 1K tokens |\n| Gemini-2.0-Flash | ~$0.001 \u002F 1K tokens |\n| Qwen-Max | ~$0.005 \u002F 1K tokens |\n| DeepSeek-V3 | ~$0.002 \u002F 1K tokens |\n\nEvery response includes `usage.cost` and `usage.credits_remaining`.\n\n## Get Started\n\n1. Sign up at [aisa.one](https:\u002F\u002Faisa.one)\n2. Get your API key from the dashboard\n3. Add credits (pay-as-you-go)\n4. Set environment variable: `export AISA_API_KEY=\"your-key\"`\n\n## Full API Reference\n\nSee [API Reference](https:\u002F\u002Faisa.mintlify.app\u002Fapi-reference\u002Fintroduction) for complete endpoint documentation.\n",{"name":5,"homepage":24,"metadata":25,"description":7},"https:\u002F\u002Fopenclaw.ai",{"openclaw":26},{"emoji":27,"requires":28,"primaryEnv":30},"🧠",{"env":29,"bins":31},[30],"AISA_API_KEY",[32,33],"curl","python3","main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Frenning22\u002Fasia-llm-router-skills",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill llm-router",{"tool":49,"command":50},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill llm-router",{"tool":52,"command":53},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill llm-router","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Frenning22\u002Fasia-llm-router-skills\u002FSKILL.md",true,[],[58,66,73,80,87,94],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":65},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":65},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":65},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":65},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":65},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":65},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]