Docs

Ailerix speaks two contracts: OpenRouter-style chat, and TypeSafe System One. Jev classifies task families; software walks the frontier.

POST
/api/v1/route
Jev + frontier walk. Send { prompt, policy? }. Returns family, aa_id, cost_per_task_usd, floor, fallback_aa_id, decisions, mock output. model is always ailerix/auto.
POST
/api/v1/systemone
Jev-compatible System One endpoint. Send state + typed questions.
POST
/api/v1/chat/completions
OpenAI-shaped chat. model must be omitted or ailerix/auto; any other slug returns 400 model_not_allowed.
GET
/api/v1/models
Returns only ailerix/auto — the sole public model id. No provider catalog.
TypeScript: routing questions (task family)
Production routing uses nine questions — one Choice over families, three Scores, five Nouls. No catalog ids in criteria.
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);
Chat completions: ailerix/auto only
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);
Live Jev vs local engine

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.