astrai-inference-router

Route all LLM calls through Astrai for 40%+ cost savings with intelligent routing and privacy controls

3,891 stars

Best use case

astrai-inference-router is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Route all LLM calls through Astrai for 40%+ cost savings with intelligent routing and privacy controls

Teams using astrai-inference-router should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/astrai-inference-router/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/beee003/astrai-inference-router/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/astrai-inference-router/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How astrai-inference-router Compares

Feature / Agentastrai-inference-routerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Route all LLM calls through Astrai for 40%+ cost savings with intelligent routing and privacy controls

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Astrai Inference Router

Route every LLM call through Astrai's intelligent router.
Save 40%+ on API costs. Privacy controls built in.

## What it does

- **Smart routing**: Classifies each task (code, research, chat, creative) and picks the optimal model
- **Cost savings**: Bayesian learning finds the cheapest provider that meets your quality threshold
- **Auto-failover**: Circuit breaker switches providers when one goes down
- **PII protection**: Personally identifiable information stripped before reaching any provider
- **EU routing**: GDPR-compliant European-only routing with one setting
- **Budget caps**: Set daily spend limits to prevent runaway costs
- **Real-time tracking**: See exactly how much you're saving per request

## Setup

1. Get a free API key at [as-trai.com](https://as-trai.com)
2. Set `ASTRAI_API_KEY` in your environment or skill config
3. Choose your privacy mode (default: `enhanced`)
4. Done — all LLM calls now route through Astrai

## Privacy Modes

- **standard**: Full routing intelligence, normal logging
- **enhanced**: PII stripped, metadata-only logging, region enforced
- **max**: Zero data retention, EU-only, all PII stripped, no prompt logging

## Environment Variables

| Variable | Required | Description | Default |
|---|---|---|---|
| `ASTRAI_API_KEY` | Yes | Your API key from as-trai.com | — |
| `PRIVACY_MODE` | No | standard, enhanced, max | enhanced |
| `REGION` | No | any, eu, us | any |
| `DAILY_BUDGET` | No | Max daily spend in USD (0 = unlimited) | 10 |

## External Endpoints

| Endpoint | Purpose | Data Sent |
|---|---|---|
| `https://as-trai.com/v1/chat/completions` | LLM inference routing | Prompts (with PII stripped if enhanced/max mode) |
| `https://as-trai.com/v1/signup` | Free API key registration | Email address |

## Security & Privacy

- All requests authenticated via API key in Authorization header
- PII stripping runs locally before any data leaves your machine (enhanced/max modes)
- EU routing mode ensures prompts never leave European infrastructure
- Zero data retention available in max privacy mode
- No credentials are stored by the skill — only your API key in environment variables
- Source code is fully open: [github.com/beee003/astrai-openclaw](https://github.com/beee003/astrai-openclaw)

## Model Invocation

This skill intercepts outgoing LLM API calls and reroutes them through the Astrai gateway. The gateway selects the optimal provider and model based on task type, cost, and quality. Your prompts are processed by third-party LLM providers (Anthropic, OpenAI, Google, Mistral, etc.) according to your region and privacy settings.

## Pricing

- **Free**: 1,000 requests/day, smart routing, failover
- **Pro** ($49/mo): Unlimited requests, EU routing, PII stripping, analytics
- **Business** ($199/mo): Multi-agent dashboards, compliance exports, SLA

Related Skills

llm-router

3891
from openclaw/skills

Unified LLM Gateway - One API for 70+ AI models. Route to GPT, Claude, Gemini, Qwen, Deepseek, Grok and more with a single API key.

LLM Management & Routing

clawrouter

3891
from openclaw/skills

Smart LLM router — save 67% on inference costs. Routes every request to the cheapest capable model across 41 models from OpenAI, Anthropic, Google, DeepSeek, and xAI.

AI Optimization & Cost Savings

mlx-local-inference

3891
from openclaw/skills

Use when calling local AI on this Mac — text generation, embeddings, speech-to-text, OCR, or image understanding. LLM/VLM via oMLX gateway at localhost:8000/v1. Embedding/ASR/OCR via Python libraries (mlx-lm, mlx-vlm, mlx-audio). Works offline. Use instead of cloud APIs for privacy or low latency.

astrai-code-review

3891
from openclaw/skills

AI-powered code review with intelligent model routing — saves 40%+ vs always using the most expensive model

openrouter-image-generation

3891
from openclaw/skills

Generate or edit images through OpenRouter's multimodal image generation endpoint (`/api/v1/chat/completions`) using OpenRouter-compatible image models. Use for text-to-image or image-to-image requests when the user wants OpenRouter, `OPENROUTER_API_KEY`, model overrides, or provider-specific `image_config` options.

smart-router

3891
from openclaw/skills

No description provided.

llmcouncil-router

3891
from openclaw/skills

Route any prompt to the best-performing LLM using peer-reviewed council rankings from LLM Council

memory-router

3891
from openclaw/skills

Central dispatch layer for OpenClaw Memory Stack. Routes memory queries to the best backend via signal detection, class-based dispatch, and sequential fallback.

wheels-router

3891
from openclaw/skills

Plan public transit trips globally using Wheels Router (Hong Kong) and Transitous (worldwide)

react-router-v7

3891
from openclaw/skills

React Router v7 best practices for data-driven routing. Use when implementing routes, loaders, actions, Form components, fetchers, navigation guards, protected routes, or URL search params. Triggers on createBrowserRouter, RouterProvider, useLoaderData, useActionData, useFetcher, NavLink, Outlet.

react-router-code-review

3891
from openclaw/skills

Reviews React Router code for proper data loading, mutations, error handling, and navigation patterns. Use when reviewing React Router v6.4+ code, loaders, actions, or navigation logic.

llmrouter

3891
from openclaw/skills

Intelligent LLM proxy that routes requests to appropriate models based on complexity. Save money by using cheaper models for simple tasks. Tested with Anthropic, OpenAI, Gemini, Kimi/Moonshot, and Ollama.