Docs
Ailerix speaks two contracts: OpenRouter-style chat, and TypeSafe System One. Jev classifies task families; software walks the frontier.
const familyCriteria = {
"intelligence": "Open-ended reasoning, writing, analysis. The default family.",
"coding": "Programming, diffs, repository Q&A, stack traces.",
"agents": "Multi-step tool use, browsing, plan-then-act workflows.",
"vision": "Images, screenshots, or diagrams are load-bearing.",
"factual": "Closed-book facts, citations, low hallucination tolerance.",
"long_context": "Long documents, books, multi-file corpora.",
"professional": "Legal, medical, finance, or regulated tone."
};
const response = await fetch("/api/v1/systemone", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
state: "Refund this double charge before payroll.",
model: "jev-latest",
questions: {
task_family: {
type: "choice",
instructions:
"Classify the user's request into exactly one task family.",
criteria: familyCriteria,
},
quality_floor: {
type: "score",
instructions: "How much model quality does this task need?",
legend: [
"Trivial rewrite or lookup",
"Standard production task",
"Hard multi-step reasoning",
"Frontier-only work",
],
},
hallucination_sensitive: {
type: "noul",
instructions:
"Would a confident falsehood be expensive here?",
},
},
}),
});
const { answers } = await response.json();
console.log(answers.task_family.choice, answers.task_family.confidence);const response = await fetch("/api/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "ailerix/auto",
messages: [{ role: "user", content: "Summarize this ticket." }],
policy: "balanced",
}),
});
// Omitting model is also accepted.
// Any other model slug → 400 { code: "model_not_allowed" }
// Body fields models, provider, plugins, preset → 400 parameter_not_allowed
const body = await response.json();
console.log(body.model); // "ailerix/auto"
console.log(body.ailerix?.family, body.ailerix?.cost_per_task_usd);If TYPESAFE_API_KEY is set, Ailerix calls POST https://api.typesafe.ai/v1/systemone with model jev-latest.
Without a key, Ailerix uses a local System One engine that returns the same Choice / Score / Noul shapes so you can develop against the typed contract. Completions stay mocked either way until you add provider credentials.
Agents & MCP
Connect Cursor, Claude Desktop, or any MCP client to route prompts, inspect generations, and manage credits without leaving your editor.
Base URL: https://ailerix.com/api/mcp
OAuth uses Clerk with dynamic client registration (DCR). Cursor registers automatically when you add the server. Read-only tools (discovery and analytics summaries) work without a token; routing, completions, and credit purchases require a signed-in session or bearer token from the OAuth flow.
Anonymous callers get 25 routed requests per day. Paid and signed-in usage draws from your credit balance; exhausted credits return 402 with insufficient_credits.
| Tool | Description |
|---|---|
| route_preview | Classify a prompt and return the frontier walk preview (family, floor, fallback) without charging a completion. |
| create_completion | Run a routed completion for a prompt and optional policy; returns a generation id for follow-up. |
| get_generation | Fetch status and output for a prior generation by id. |
| analytics_summary | Aggregated spend, tokens, and family breakdown for the authenticated account (optional days window). |
| credit_balance | Current USD credit balance for the signed-in user. |
| buy_credits | Start checkout for a credit pack (requires auth and Stripe). |
- MCP server card
- OAuth protected resource
- Agent card
- Agent skills index
- AI catalog
- ACP (agent checkout)
- OpenAPI
- auth.md
- llms.txt
/.well-known/acp.json describes Agentic Commerce Protocol checkout so agents can purchase credit packs on your behalf after OAuth consent.
curl -sS -X POST https://ailerix.com/api/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'