Developers
Developers/Ask AI and templates
BUILD / API V1

Ask AI and templates

Turn a question or research template into collected data and a written analysis.

From a question to an analysis

Ask AI turns a plain-English question into a plan of ordinary collection jobs, runs them once you approve, and writes an analysis from the collected data: the takeaway, what stands out and what to do next. Templates do the same with fixed steps and a flat price per run.

plannedSteps and max credits→runningOne job per step→answeringWriting the analysis→answeredanswer is set

1. Ask a question

POST /v1/assistant/plans returns a plan. Review steps and estimated_credits; nothing has run yet. If the question is ambiguous the plan comes back with kind: "clarify" and a follow-up question in message.

cURL
curl -X POST https://api.caelario.com/v1/assistant/plans \
  -H "X-API-Key: $CAELARIO_API_KEY" -H "Content-Type: application/json" \
  -d '{"question": "Which brands sponsor mkbhd on YouTube?"}'
Response200 OKcontent-type: application/json
JSON
{
  "id": "plan_01H...",
  "question": "Which brands sponsor mkbhd on YouTube?",
  "status": "planned",
  "kind": "plan",
  "source": "ai",
  "title": "YouTube sponsors for mkbhd",
  "steps": [
    { "platform": "youtube", "operation": "sponsored_videos", "target": "mkbhd", "limit": 30,
      "purpose": "Recent videos with sponsors", "job_id": null, "status": null }
  ],
  "estimated_credits": 60,
  "answer": null
}

2. Or start from a template

GET /v1/assistant/templates lists research templates with their inputs, steps and flat price. Fill one in to get the same kind of plan, without using the model to plan.

cURL
curl -X POST https://api.caelario.com/v1/assistant/templates/creator-brand-deals/plans \
  -H "X-API-Key: $CAELARIO_API_KEY" -H "Content-Type: application/json" \
  -d '{"inputs": {"handle": "mkbhd"}}'
Response200 OKcontent-type: application/json
JSON
{
  "id": "plan_01H...",
  "question": "Which brands sponsor mkbhd on YouTube?",
  "status": "planned",
  "kind": "plan",
  "source": "template",
  "title": "YouTube sponsors for mkbhd",
  "steps": [
    { "platform": "youtube", "operation": "sponsored_videos", "target": "mkbhd", "limit": 30,
      "purpose": "Recent videos with sponsors", "job_id": null, "status": null }
  ],
  "estimated_credits": 60,
  "answer": null
}

3. Approve, then poll for the answer

POST /v1/assistant/plans/{plan_id}/approve submits one job per step with normal credit reservation. Poll the plan until status is answered; answer then holds the analysis and each step links to its job_id for the raw results and exports.

Python
import os, time, requests

headers = {"X-API-Key": os.environ["CAELARIO_API_KEY"]}
base = "https://api.caelario.com/v1/assistant/plans"
plan = requests.post(base, json={"question": "What is trending on TikTok in GB?"}, headers=headers).json()
print(plan["steps"], plan["estimated_credits"])          # review before approving
requests.post(f"{base}/{plan['id']}/approve", headers=headers).raise_for_status()
while (plan := requests.get(f"{base}/{plan['id']}", headers=headers).json())["status"] not in ("answered", "failed", "cancelled"):
    time.sleep(5)
print(plan["answer"])
Response200 OKcontent-type: application/json
JSON
{
  "id": "plan_01H...",
  "status": "answered",
  "steps": [
    { "platform": "youtube", "operation": "sponsored_videos", "target": "mkbhd",
      "job_id": "job_01H...", "status": "completed", "result_count": 9, "billed_credits": 18 }
  ],
  "answer": "Tech and software brands account for most deals...\n\n**What stands out**\n- ...\n\n**What you could do**\n- ...",
  "answered_at": "2026-11-20T10:04:12Z"
}

Billing and limits

BilledCollected data only

A question bills each step like a normal job. A template run is one flat price, less if it returns under half the usual data and free if it returns nothing. Writing the answer is included.

Daily limitTyped questions

Questions have a daily limit per workspace. Template runs do not count toward it.