---
title: "Chat over your memories"
method: POST
path: "/chat"
tags: ["Search & chat"]
---

# Chat over your memories

`POST /chat`

## Request

- Base URL: `https://api.mymemory.dev/v1`
- URL: `https://api.mymemory.dev/v1/chat`
- Auth: HTTP bearer

Answers the latest user message from your memories, in the language you asked in. Streams by default (Vercel AI SDK data stream; the thread ID is in the `Supermemory-Thread-Uuid` header). Set `stream: false` for one JSON response.

## Request body

- object
  - `messages` object[], required
    - `role` 'user' | 'assistant'
    - `content` string
  - `threadId` string: Continue an existing thread (the `threadId` from an earlier response).
  - `spaces` string[]: Only use memories in these spaces.
  - `stream` boolean
  - `before` string, date-time: Only use memories on or before this date.
  - `after` string, date-time: Only use memories on or after this date.
  - `recencyBias` number

## Response `200`

The answer. JSON when `stream` is false; a data stream otherwise.

- object
  - `text` string: The answer. Cites memories as [1], [2], …
  - `threadId` string: Pass back as `threadId` to continue the conversation.
  - `refused` boolean: True when no memory was relevant enough to answer from.
  - `citations` object[]: The memories the answer cites.

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `429`: Too many requests. For a rate limit (`error`: `rate_limited`), wait the seconds in the `Retry-After` header; for an AI budget error, until the budget renews.

---

[API](https://skmtc.dev/mymemory/apis/mymemory-api.md) · [All operations](https://skmtc.dev/mymemory/apis/mymemory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mymemory/apis/mymemory-api/revisions/a6cdb469f9e8?raw)
