Skip to content
Skip to Content
DevelopersAPI referenceAI

List saved chats

GET
/v1/chat/conversations

Only served with CHAT_MEMORY=true (404 otherwise). The caller's conversations that have not expired, most recently used first (at most 50).

Authorization

bearer
headerAuthorizationBearer <token>

A personal API key (ga_…), sent as Authorization: Bearer ga_…. A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Response Body

Saved conversations

application/json
  1. response
conversations*array<>
Example Request
curl -X GET 'https://example.com/v1/chat/conversations'
Example Response
{  "conversations": [    {      "id": "string",      "preview": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z"    }  ]}

Ask a question about your saved items POST

Ask questions about the caller's own saved items. By default each request is stateless: send the conversation so far (at most 20 messages of up to 4000 characters, ending with a user message) and get the next answer. **Chat memory** (only when the server runs with `CHAT_MEMORY=true`; the answer then carries `conversation_id`). The first turn starts a saved conversation. Send its `conversation_id` with later turns and only the new user message: the server uses the stored messages as the history and ignores any earlier ones sent. A conversation lasts one day from its first message, then it can no longer be read or continued (404 `chat.conversation_not_found`) and is deleted. It holds at most 100 messages (409 `chat.conversation_full`). Each turn turns the latest message into a search query, searches the caller's items (never other people's, not even items shared with them), and answers only from the best matches, citing them as `[n]`. The answer comes back with the sources it cites. A turn uses two model calls from the daily AI allowance (one when nothing matches). Errors: 503 when the server has no AI model, 429 when today's allowance (it resets at midnight UTC) or the hourly chat limit is used up, and 502 when the model fails or returns something unusable. Saved pages are untrusted text, and the model gets them as data only. **Streaming.** Send `Accept: text/event-stream` to get the turn as server-sent events instead of one JSON body: - `query` once, `{"query": "..."}`: the search being run, as soon as it is known. - `delta` any number of times, `{"text": "..."}`: the next piece of the answer. Citations to items that do not exist are already removed, and a half-written `[12` is held back until it is checked. - `done` last, with the same `ChatAnswer` body as the JSON response. Replace the streamed text with its `answer`: it is trimmed and length-capped, so it can differ slightly from the joined pieces. - `error` instead of `done` if the turn fails after events began: `{"error": {"status": 502, "type": "upstream_error", "message": "..."}}`. Pieces already shown were real answer text, but the answer is incomplete. Anything refused before the first event (validation, plan, allowance, rate limit, AI off) is the usual JSON error with its status code. The cost and limits are the same as a plain turn.

Read a saved chat GET

Only served with `CHAT_MEMORY=true`. 404 when it is not the caller's or has expired.