Routes each request to the cheapest model that can handle it — one that sees images if you send one, calls tools if you send tools, and fits your conversation — and moves up to a stronger model if that one fails. No fixed price: you pay for whichever models ran, at their listed prices, capped by max_spend (default $0.10 per request). Without a verify schema it escalates on errors and refusals only, not on answer quality.
Not one model but a rule for choosing one: each request starts on the cheapest capable model and moves up only when it has to, under a spend ceiling you set. Every reply carries a receipt naming the model that answered and what it cost.
alphaneural/autoAny OpenAI client works: point it at backend.alfnrl.io/v1 and send alphaneural/auto as the model. Add an X-Thread-Id header to keep a conversation going across models; the quickstart shows it.
Checking whether you are signed in…
Prices are what AlphaNeural AI bills, in USD, and can change when the upstream provider changes theirs. The catalogue is refreshed from the gateway every few minutes.
curl https://backend.alfnrl.io/v1/chat/completions \
-H "Authorization: Bearer $ALPHANEURAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "alphaneural/auto",
"max_spend": 0.1,
"messages": [{"role": "user", "content": "Explain what a context window is, in two sentences."}]
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://backend.alfnrl.io/v1",
api_key=os.environ["ALPHANEURAL_API_KEY"],
)
reply = client.chat.completions.create(
model="alphaneural/auto",
messages=[{"role": "user", "content": "Explain what a context window is, in two sentences."}],
# A ceiling on what this request may bill, whichever models answer.
extra_body={"max_spend": 0.1},
)
print(reply.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://backend.alfnrl.io/v1",
apiKey: process.env.ALPHANEURAL_API_KEY,
});
const reply = await client.chat.completions.create({
model: "alphaneural/auto",
messages: [{ role: "user", content: "Explain what a context window is, in two sentences." }],
// A ceiling on what this request may bill, whichever models answer.
// @ts-expect-error max_spend is an AlphaNeural extension.
max_spend: 0.1,
});
console.log(reply.choices[0].message.content);