API (coming soon)
API-first platform for routing prompts to the best AI.

Vazian API

One API to route prompts across multiple AI models — Smart, Direct, or Compare. Current chat endpoint contracts. Self-service developer API keys and usage-based billing have not launched.

1) Current access
Use the website's signed-in account session for chat requests. Guest previews are limited. Developer API keys are not included in Pro and cannot be generated yet. Authorization: Bearer YOUR_API_KEY
2) Make a request
Send a prompt to one endpoint. Use auto for Smart, single for Direct, compare for Compare, or loop for Debate. Endpoint: POST https://api.vazian.ai/v1/route
3) Pricing & availability
The current Free and Pro chat plans use daily request allowances, not token-based developer billing. See current chat pricing. Contact admin@vazian.ai about future business integrations.
4) Docs & examples
Below are request/response examples for Smart, Direct, and Compare — plus Streaming and Errors. Copy/paste snippets to get started quickly.

POST /v1/route

One endpoint for all modes. Your UI already sends one of these payloads:

Smart (auto)
{
  "prompt": "Explain this like I’m five: what is an LLM router?",
  "mode": "auto"
}
Meaning: “Best AI for your question.”
Direct (single model)
{
  "prompt": "Draft a customer email about a delayed shipment.",
  "mode": "single",
  "model": "gpt"
}
Meaning: user picks one model.
Compare (multi-model)
{
  "prompt": "Summarize this contract in plain English.",
  "mode": "compare",
  "models": ["gpt", "claude", "gemini"]
}
Meaning: same prompt sent to multiple models.
Example JSON response
{
  "status": "pending",
  "request_id": "r_example"
}
HTTP 202 starts a job. Poll GET /v1/result/r_example until done; completed Compare jobs include results arrays.

Quick curl example



curl -X POST "https://api.vazian.ai/v1/route" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "prompt": "Give me 5 bullet points for a product launch plan.",
    "mode": "auto"
  }'


JavaScript fetch example


const url = "https://api.vazian.ai/v1/route";


const res = await fetch(url, {
  method: "POST",
  credentials: "include",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
  body: JSON.stringify({ prompt: "Write a 2-sentence elevator pitch.", mode: "auto" })
});


let data = await res.json();
if (!res.ok) throw new Error(data.error || "Chat request failed");
while (data.status === "pending") {
  await new Promise(resolve => setTimeout(resolve, 1000));
  const poll = await fetch(`https://api.vazian.ai/v1/result/${data.request_id}`, { credentials: "include" });
  data = await poll.json();
  if (!poll.ok && poll.status !== 202) throw new Error(data.error || "Chat job failed");
}
console.log(data.answer);
Authentication: all requests require an API key sent via Authorization: Bearer YOUR_API_KEY.

Decision briefs (live)

After at least two AIs return successful text answers, create one structured brief with shared ground, differences, a recommendation, and next steps. A successful brief uses one existing Compare allowance. It synthesizes the supplied answers; it does not independently verify them.

Create a decision brief
POST /v1/route using the existing account session
{
  "task": "compare_brief",
  "mode": "compare",
  "request_id": "r_brief_example",
  "chat_id": "c_example",
  "comparison_id": "r_comparison_example",
  "prompt": "Evaluate a subscription idea",
  "results": [
    {"key": "gpt", "answer": "Interview customers first."},
    {"key": "grok", "answer": "Validate demand with interviews."}
  ]
}
HTTP 202 starts the job; poll GET /v1/result/r_brief_example.
Completed brief
JSON sections plus a readable Markdown answer
{
  "status": "done",
  "task": "compare_brief",
  "mode": "compare",
  "brief": {
    "summary": "Validate demand first.",
    "agreements": [{"claim": "Interview customers.", "models": ["gpt", "grok"]}],
    "differences": [],
    "recommendation": "Interview five potential customers.",
    "next_steps": ["Recruit interviewees.", "Test their problem."],
    "caveat": "Agreement is not proof. This is not independent verification."
  },
  "answer": "Readable Markdown brief"
}
Empty agreement/difference arrays are valid when the sources do not establish them.
Limits: 2-5 unique successful text sources, at most 16,000 characters each and 60,000 combined; the original task may contain up to 8,000 characters. No API key product has launched.

POST /v1/stream (SSE)

Smart and Direct text requests support text/event-stream. Each data line contains JSON. Compare, Debate, and image generation use /v1/route jobs.

SSE format

HTTP/1.1 200 OK
Content-Type: text/event-stream

data: {"type":"start","provider":"openai","model":"configured-model"}

data: {"type":"token","text":"Hello"}

data: {"type":"done","fullText":"Hello"}

Client example (EventSource-style parsing)

// Your UI already handles this internally.
// If you build your own client:
const res = await fetch("https://api.vazian.ai/v1/stream", { method:"POST", credentials:"include", headers:{ "Content-Type":"application/json" }, body: JSON.stringify({ prompt:"Hi", mode:"auto" }) });
if (!res.ok) throw new Error("Stream request failed");

const reader = res.body.getReader();
const decoder = new TextDecoder();
let buf = "";

while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  buf += decoder.decode(value, { stream: true });
  // If SSE, parse lines like "data: ..."
}
Completion: wait for a JSON done event. A JSON error event or a connection ending before done is a failed request, not a successful partial answer.

Error handling

Keep errors human-readable. The UI will show a friendly message and keep the conversation intact.

Recommended JSON error
{
  "error": "Rate limit exceeded. Try again in 30 seconds."
}
HTTP status suggestions
  • 400 — invalid request (missing prompt, unknown mode)
  • 401 — authentication required for account and billing endpoints
  • 429 — rate limited
  • 500 — backend error
Don’t lose user work: even on errors, keep the chat visible and let the user retry.