---
title: "Ask Markdrop AI in a thread"
description: "Posts your question (as \"@AI …\") and Markdrop AI's answer in the thread, for everyone in it."
canonical_url: https://docs.markdrop.in/api/comments/ask-markdrop-ai-in-a-thread
last_updated: 2026-11-20
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Ask Markdrop AI in a thread

`POST https://api.markdrop.in/api/v1/documents/{slug}/comments/{thread_id}/ai/ask`

Posts your question (as "@AI …") and Markdrop AI's answer in the thread, for everyone in it. The answer uses the page, the thread and pages of its workspace that everyone who can see the thread can open. Writing @AI in a comment does the same.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 20 per minute per IP address.
- **Guide:** [AI help](https://docs.markdrop.in/collaboration/suggested-edits#ai-help)

## Path parameters

- `slug` (string, required): The document's address: the part after `markdrop.in/`.
- `thread_id` (string, required): Matches `^[0-9a-f]{24}$`.

## Headers

- `X-Read-Password` (string): The password of a password-protected document.
- `X-Markdrop-Workspace` (string): 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.

- `question` (string, required): 1–1,000 characters.

## Responses

- `201`: Created.
- `401`: No token, or the token is revoked or mistyped.
- `422`: The request didn't validate. `detail` lists each problem, with where it is (`loc`) and why (`msg`).
- `429`: Too many requests from your IP address. Wait the seconds in `Retry-After`.

## Examples

**curl**

```bash
curl -X POST https://api.markdrop.in/api/v1/documents/k3x9q2m/comments/THREAD_ID/ai/ask \
  -H "Authorization: Bearer $MARKDROP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"question":"Which date did we agree on?"}'
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/documents/k3x9q2m/comments/THREAD_ID/ai/ask", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "question": "Which date did we agree on?"
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

r = requests.post(
    "https://api.markdrop.in/api/v1/documents/k3x9q2m/comments/THREAD_ID/ai/ask",
    headers={"Authorization": f"Bearer {os.environ['MARKDROP_TOKEN']}"},
    json={"question": "Which date did we agree on?"},
)
r.raise_for_status()
print(r.json())
```
