{
  "$schema": "https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json",
  "protocolVersion": "2026-07-28",
  "serverInfo": {
    "name": "ailerix",
    "title": "Ailerix routing API",
    "version": "1.0.0"
  },
  "description": "Route LLM requests with Jev task-family classification and Artificial Analysis cost-per-task frontier walking. Public model id ailerix/auto only.",
  "transport": {
    "type": "streamable-http",
    "endpoint": "https://ailerix.com/api/mcp"
  },
  "authentication": {
    "type": "oauth2",
    "resource_metadata": "https://ailerix.com/.well-known/oauth-protected-resource"
  },
  "tools": [
    {
      "name": "route_preview",
      "description": "Classify a prompt and return the frontier routing decision without executing a provider completion.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "prompt": { "type": "string", "description": "User task text to route." },
          "policy": {
            "type": "string",
            "enum": ["balanced", "cheap", "quality", "latency"],
            "description": "Optional routing policy hint."
          }
        },
        "required": ["prompt"]
      }
    },
    {
      "name": "create_completion",
      "description": "Run a routed chat completion (non-streaming) and return assistant content plus the ailerix trace.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "prompt": { "type": "string", "description": "User message text." },
          "policy": {
            "type": "string",
            "enum": ["balanced", "cheap", "quality", "latency"]
          }
        },
        "required": ["prompt"]
      }
    },
    {
      "name": "get_generation",
      "description": "Fetch a persisted route event by generation id (from X-Ailerix-Generation-Id or completion id).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "generation_id": { "type": "string", "description": "gen_ UUID from a prior response." }
        },
        "required": ["generation_id"]
      }
    },
    {
      "name": "analytics_summary",
      "description": "Aggregate routing analytics (requests, spend, latency percentiles, family breakdown).",
      "inputSchema": {
        "type": "object",
        "properties": {
          "days": { "type": "integer", "enum": [7, 30], "description": "Rolling window length." }
        }
      }
    },
    {
      "name": "credit_balance",
      "description": "Return USD balance and usage for the authenticated account, or anonymous tier status when auth is disabled.",
      "inputSchema": {
        "type": "object",
        "properties": {}
      }
    },
    {
      "name": "buy_credits",
      "description": "Start a Stripe checkout session for a credit pack and return the hosted checkout URL.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pack": {
            "type": "string",
            "enum": ["CREDITS-5", "CREDITS-20", "CREDITS-100"],
            "description": "Credit pack identifier."
          }
        },
        "required": ["pack"]
      }
    }
  ],
  "documentation": "https://ailerix.com/auth.md"
}
