---
title: "Conversational AI over the RRM Research Library"
method: POST
path: "/api/ask"
---

# Conversational AI over the RRM Research Library

`POST /api/ask`

## Request

- Base URL: `https://rrmacademy.org`
- URL: `https://rrmacademy.org/api/ask`
- Auth: none required

Answers questions scoped to restorative reproductive medicine using the RRM Library corpus. Two auth paths:

**Session-authenticated (20 req/day):** Include the `session` cookie from `/api/auth/login`. Supports both JSON and SSE response formats based on the `Accept` header.

**Anonymous (2 req/day/IP):** No cookie required. Always returns `text/event-stream`. Rate-limited per IP.

Set `Accept: text/event-stream` to receive a streaming SSE response regardless of auth state.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `message` string, required: The question to ask the RRM Library AI

## Response `200`

Answer with citations. Content-Type is `application/json` for authenticated requests without SSE Accept header, or `text/event-stream` for anonymous requests and any SSE-accepting request.

- AskResponse
  - `answer` string, required: AI-generated answer scoped to RRM Library content
  - `citations` object[], required
    - `url` string, uri, required
    - `title` string
  - `fallback` boolean: true when no relevant library content was found and a fallback message is returned

## Other responses

- `400`: Idempotency-Key header is malformed. Must be 16-128 printable ASCII characters.
- `422`: The Idempotency-Key was previously used with a different request body. Use a new key for a new request.
- `429`: Rate limit exceeded. Session path: 20/day reset at midnight UTC. Anonymous path: 2/day, 48h TTL.
- `503`: Upstream service unavailable

---

[API](https://skmtc.dev/rrmacademy/apis/rrm-academy-agent-api.md) · [All operations](https://skmtc.dev/rrmacademy/apis/rrm-academy-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/rrmacademy/apis/rrm-academy-agent-api/revisions/0e3589a38b0c?raw)
