MisarMisar Docs
MisarMailMisarBlogMisarReachMisarPostMisarDevMisarCoderMisarSEOMisar PlatformMisar SSO
API Reference

AI Tools

AI-powered writing tools — SEO title generation and streaming research via the MisarBlog API.

Generate Title Suggestions

POST/blog/v1/ai/titles

Generates SEO/AEO/GEO-optimized article titles. Two modes: generate titles from an existing article's content, or from a keyword/topic prompt. Authenticated with your API key (Authorization: Bearer mbk_...).

Request body

actionstringbody

suggest | seo (default: seo).
suggest — generate titles from existing article content (requires context).
seo — generate high-visibility titles from a keyword/topic prompt (requires prompt).

promptstringbody

Topic or keyword phrase. Required when action is seo.

contextstringbody

Article content used as source/context (max 8000 chars). Required when action is suggest; optional for seo.

Response fields

titlesArray<{ title: string; hint: string }>

Up to 5 title suggestions. Each item has a title and a short hint explaining the keyword strategy or search intent it targets.

rawstring

The unparsed model output, in case you want to render it directly.

Request
{
  "action": "seo",
  "prompt": "How to build a real-time chat app with Next.js and WebSockets"
}
200 — OK
{
  "titles": [
    {
      "title": "How to Build Real-Time Chat with Next.js and WebSockets",
      "hint": "Front-loads the primary keyword; 'How to' pattern targets tutorial intent."
    },
    {
      "title": "Next.js WebSockets: A Complete Guide to Real-Time Apps",
      "hint": "Long-tail phrase 'Next.js WebSockets' with low competition."
    }
  ],
  "raw": "1. How to Build Real-Time Chat with Next.js and WebSockets\n→ ..."
}
Request — cURL
curl -X POST https://api.misar.io/blog/v1/ai/titles \
  -H "Authorization: Bearer mbk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action":"seo","prompt":"real-time chat with Next.js"}'

Generic Completion

POST/blog/v1/ai/complete

Runs a generic system + user prompt completion and returns the model text. This backs the MCP prompt templates. Authenticated with your API key (Authorization: Bearer mbk_...).

Spends credits. Returns 402 when the wallet balance / plan quota is exhausted.

Request body

systemstringbody

System prompt that steers the model.

promptstringbodyrequired

The user prompt to complete.

max_tokensintegerbody

Maximum tokens to generate.

Response fields

textstring

The completion text.

Request
curl -X POST https://api.misar.io/blog/v1/ai/complete \
  -H "Authorization: Bearer mbk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "system": "You are a concise technical editor.",
    "prompt": "Rewrite this intro to be tighter: ...",
    "max_tokens": 300
  }'
201 — Created
{ "text": "..." }

AI Research (Streaming)

POST/blog/v1/ai/research

Streams AI-generated research on a topic as Server-Sent Events (text/event-stream). The request is proxied to the assisters.dev agent stream and passed through directly.

Session-authenticated

This endpoint is used by the MisarBlog editor and authenticates with your logged-in session (cookie), not an API key. It is not part of the Bearer mbk_... public API-key surface.

Request body

querystringbodyrequired

The research topic or question. (The alias topic is also accepted.)

Response

A 200 OK returns a text/event-stream (Content-Type: text/event-stream). The body is the upstream agent's SSE stream forwarded verbatim — consume it as raw Server-Sent Events. The exact event payload shape is defined by the assisters.dev agent stream.

Request
{
  "query": "Impact of large language models on software development productivity"
}
200 — text/event-stream
Content-Type: text/event-stream
Cache-Control: no-cache

data: ...

data: ...
Example — consume the stream with fetch
const res = await fetch("https://api.misar.io/blog/v1/ai/research", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  credentials: "include", // send the session cookie
  body: JSON.stringify({ query: "LLMs in software development" }),
});

const reader = res.body!.getReader();
const decoder = new TextDecoder();
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  process.stdout.write(decoder.decode(value));
}

For more details on streaming, see the Streaming guide.

Status codes

  • 400 — Missing required field (prompt/context for titles; query for research) or invalid JSON
  • 401 — Invalid or missing credentials
  • 402 — Insufficient credits / plan quota (title generation and /ai/complete, when the universal wallet is enabled)
  • 429 — Rate limit exceeded (100 req/min per key)
  • 502 — Upstream AI generation error