POST/api/v1/ai/pages/{slug}/ask

Ask about a page

Answers a question about a page you can read, from its content and the embedded items you can open. Send earlier turns in history to follow up. Streams the answer as server-sent events: delta events, then done.

API token requiredOr edit secret30 per minute per IP

Guide: AI in pages

Code samples and Try it

Path parameters

#
  • slugstringRequired

    The document's address: the part after markdrop.in/.

Headers

#
  • X-Read-Passwordstring

    The password of a password-protected document.

  • X-Edit-Secretstring

    The document's edit secret (sk_…), for a document published without an account. See Edit key.

  • X-Markdrop-Workspacestring

    A workspace's id: answer only if the document is in that workspace, else 404. Workspace domains send it; you rarely need it.

Request body

#

application/json, required

  • questionstringRequired

    Your question. Up to 4,000 characters.

  • historyarray of any

    Earlier questions and answers in this conversation, as {q, a}, oldest first. Up to 40 items.

Responses

#
  • 200OK.
  • 401No token, or the token is revoked or mistyped.
  • 422The request didn't validate. detail lists each problem, with where it is (loc) and why (msg).
  • 429Too many requests from your IP address. Wait the seconds in Retry-After.
Did this page help?