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
- Set
ASTRAI_API_KEY in your environment or skill config - Choose your privacy mode (default:
enhanced) - 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 |
|---|
| INLINECODE2 | Yes | Your API key from as-trai.com | — |
| INLINECODE3 |
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 |
|---|
| INLINECODE6 | LLM inference routing | Prompts (with PII stripped if enhanced/max mode) |
| INLINECODE7 |
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
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
Astrai 推理路由器
通过 Astrai 的智能路由器路由每一次 LLM 调用。
节省 40% 以上的 API 成本。内置隐私控制。
功能
- - 智能路由:对每项任务(代码、研究、聊天、创意)进行分类,并选择最优模型
- 成本节省:贝叶斯学习找到满足您质量门槛的最便宜供应商
- 自动故障转移:当某个供应商宕机时,断路器会自动切换供应商
- PII 保护:在到达任何供应商之前,个人身份信息会被剥离
- 欧盟路由:通过单一设置实现符合 GDPR 的仅欧盟路由
- 预算上限:设置每日支出限额,防止成本失控
- 实时追踪:精确查看每次请求节省了多少费用
设置
- 1. 在 as-trai.com 获取免费 API 密钥
- 在您的环境或技能配置中设置 ASTRAIAPI_KEY
- 选择您的隐私模式(默认:enhanced)
- 完成 — 所有 LLM 调用现在都通过 Astrai 路由
隐私模式
- - standard:完整路由智能,正常日志记录
- enhanced:剥离 PII,仅记录元数据,强制区域限制
- max:零数据保留,仅限欧盟,所有 PII 被剥离,不记录提示词
环境变量
| 变量 | 必需 | 描述 | 默认值 |
|---|
| ASTRAIAPIKEY | 是 | 来自 as-trai.com 的 API 密钥 | — |
| PRIVACY_MODE |
否 | standard、enhanced、max | enhanced |
| REGION | 否 | any、eu、us | any |
| DAILY_BUDGET | 否 | 每日最高支出(美元,0 = 无限制) | 10 |
外部端点
| 端点 | 用途 | 发送的数据 |
|---|
| https://as-trai.com/v1/chat/completions | LLM 推理路由 | 提示词(如果为 enhanced/max 模式,PII 会被剥离) |
| https://as-trai.com/v1/signup |
免费 API 密钥注册 | 电子邮件地址 |
安全与隐私
- - 所有请求通过 Authorization 标头中的 API 密钥进行身份验证
- PII 剥离在数据离开您的机器之前本地运行(enhanced/max 模式)
- 欧盟路由模式确保提示词永远不会离开欧洲基础设施
- max 隐私模式下可实现零数据保留
- 技能不存储任何凭证 — 只有环境变量中的 API 密钥
- 源代码完全开放:github.com/beee003/astrai-openclaw
模型调用
此技能拦截外发的 LLM API 调用,并通过 Astrai 网关重新路由。网关根据任务类型、成本和质量选择最优供应商和模型。您的提示词由第三方 LLM 供应商(Anthropic、OpenAI、Google、Mistral 等)根据您的区域和隐私设置进行处理。
定价
- - 免费版:每天 1,000 次请求,智能路由,故障转移
- 专业版(每月 49 美元):无限请求,欧盟路由,PII 剥离,分析功能
- 企业版(每月 199 美元):多代理仪表板,合规导出,SLA