> ## Documentation index
>
> Fetch the complete documentation index at: https://andesine.app/docs/llms.txt
> Use it to find all pages before you explore further.

# Stream an AI answer about current content

`POST https://api.andesine.app/search/current/ask/stream`

Emits sources, textDelta, and completed events over SSE. Uses the same inputs, permissions, AI credits, and rate limit as complete answers. Stream errors use SSE error frames. Never reconnect automatically.

Required API key permissions: ai-answers, read:entries, read:collections. Write permissions also grant read access for the same resource.

## Authentication

Use one of:

- `apiKey` (http, bearer, Andesine API key)
- `oauth` (http, bearer, Andesine OAuth access token)

## Parameters

### Header

- `x-workspace-id` (string, optional): Required for OAuth: ID of the workspace to access. API keys use their own workspace.

## Request body

The body is required.

Content type: `application/json`

- `question` (string, required)
- `collectionID` (string, optional)
- `collectionPath` (string, optional): Decoded content path, such as /Docs/Page or coll_ID/Page. Names are case-sensitive. Do not URL-encode names before passing them to the SDK.
- `collectionSlugPath` (string, optional): Decoded derived slug path, such as /docs/getting-started or coll_ID/getting-started. Use the returned slugPath without URL encoding.
- `filters` (array of `PropertyFilter`, optional): Default: `[]`.
  - Any of: `TextPropertyFilter`
    - `kind` (constant, required): Value: `"text"`.
    - `key` (string, required): Property identifier.
    - `operator` (string, optional): One of: `"any"`, `"all"`, `"none"`. Default: `"any"`.
    - `values` (array of string, required)
  - Any of: `NumberPropertyFilter`
    - `kind` (constant, required): Value: `"number"`.
    - `key` (string, required): Property identifier.
    - `operator` (`ComparisonOperator`, required): One of: `"equals"`, `"notEquals"`, `"greaterThan"`, `"greaterThanOrEqual"`, `"lessThan"`, `"lessThanOrEqual"`.
    - `value` (number, required)
  - Any of: `BooleanPropertyFilter`
    - `kind` (constant, required): Value: `"boolean"`.
    - `key` (string, required): Property identifier.
    - `value` (boolean, required)
  - Any of: `DatePropertyFilter`
    - `kind` (constant, required): Value: `"date"`.
    - `key` (string, required): Property identifier.
    - `operator` (`ComparisonOperator`, required): One of: `"equals"`, `"notEquals"`, `"greaterThan"`, `"greaterThanOrEqual"`, `"lessThan"`, `"lessThanOrEqual"`.
    - `value` (string, required)
- `history` (array of `AnswerHistoryMessage`, optional): Default: `[]`.
  - `role` (string, required): One of: `"user"`, `"assistant"`.
  - `content` (string, required)

## Responses

### 200

OK

Content type: `text/event-stream`

Type: one of.

- One of: Option 1 (object)
  - `event` (constant, required): Value: `"message"`.
  - `data` (`AnswerEvent`, required)
    - Any of: Option 1 (object)
      - `type` (constant, required): Value: `"sources"`.
      - `sources` (array of `AnswerSource`, required)
        - `path` (string, required)
        - `slugPath` (string, required)
        - `anchor` (string, optional)
        - `entryID` (string, required)
        - `collectionID` (string, optional)
        - `collectionPath` (array of string, required)
        - `headingPath` (array of string, required)
        - `title` (string, required)
        - `snippet` (string, required)
        - `properties` (array of `SearchPropertyValue`, required)
          - `key` (string, required)
          - `name` (string, required)
          - `type` (`EntryPropertyKind`, required): One of: `"text"`, `"number"`, `"checkbox"`, `"date"`, `"url"`, `"select"`, `"multi-select"`.
          - `textValue` (array of string, optional)
          - `numberValue` (number, optional)
          - `booleanValue` (boolean, optional)
          - `dateValue` (number, optional)
        - `updatedAt` (string, required)
        - `channel` (`PublishingChannelCode`, optional)
        - `versionID` (string, optional)
        - `snapshotID` (string, optional)
        - `id` (number, required)
        - `relevance` (number, required)
    - Any of: Option 2 (object)
      - `type` (constant, required): Value: `"textDelta"`.
      - `text` (string, required)
    - Any of: Option 3 (object)
      - `answer` (string, required)
      - `sources` (array of `AnswerSource`, required)
      - `type` (constant, required): Value: `"completed"`.
  - `id` (string, optional)
  - `retry` (number, optional)
- One of: Option 2 (object)
  - `event` (constant, required): Value: `"done"`.
  - `data` (any, optional)
  - `id` (string, optional)
  - `retry` (number, optional)
- One of: Option 3 (object)
  - `event` (constant, required): Value: `"error"`.
  - `data` (any, optional)
  - `id` (string, optional)
  - `retry` (number, optional)

### 400

400

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"BAD_REQUEST"`.
  - `status` (constant, required): Value: `400`.
  - `message` (string, required): Default: `"Bad Request"`.
  - `data` (`ValidationErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `issues` (array of `ValidationIssue`, optional)
      - `message` (string, required)
      - `code` (string, optional)
      - `path` (array of any of, optional)
        - Any of: Option 1 (string)
        - Any of: Option 2 (number)
        - Any of: Option 3 (object)
          - `key` (any of, required)
            - Any of: Option 1 (string)
            - Any of: Option 2 (number)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 401

401

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"UNAUTHORIZED"`.
  - `status` (constant, required): Value: `401`.
  - `message` (string, required): Default: `"Unauthorized"`.
  - `data` (`ErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 403

403

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"FORBIDDEN"`.
  - `status` (constant, required): Value: `403`.
  - `message` (string, required): Default: `"Forbidden"`.
  - `data` (`ForbiddenErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `missingPermissions` (array of string, optional)
    - `requiredPlan` (constant, optional): Value: `"pro"`.
    - `action` (string, optional): The requested action that was denied.
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 404

404

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"NOT_FOUND"`.
  - `status` (constant, required): Value: `404`.
  - `message` (string, required): Default: `"Not Found"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 409

409

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"CONFLICT"`.
  - `status` (constant, required): Value: `409`.
  - `message` (string, required): Default: `"Conflict"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 429

429

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"TOO_MANY_REQUESTS"`.
  - `status` (constant, required): Value: `429`.
  - `message` (string, required): Default: `"Too Many Requests"`.
  - `data` (`RateLimitErrorData`, optional)
    - `hints` (array of string, optional): Suggested next steps. Wording can change; use error codes and structured data for program logic.
    - `limit` (string, optional): The limit that was reached: a short-term rate limit, or a monthly API call, AI credit, or spending limit. One of: `"rate"`, `"api-calls"`, `"ai-credits"`, `"spending"`.
    - `retryAfterSeconds` (number, optional): Minimum delay before another attempt, in seconds. Also sent in Retry-After.
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 500

500

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"INTERNAL_SERVER_ERROR"`.
  - `status` (constant, required): Value: `500`.
  - `message` (string, required): Default: `"Internal Server Error"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)

### 503

503

Content type: `application/json`

Type: one of.

- One of: Option 1 (object)
  - `defined` (constant, required): Value: `true`.
  - `code` (constant, required): Value: `"SERVICE_UNAVAILABLE"`.
  - `status` (constant, required): Value: `503`.
  - `message` (string, required): Default: `"Service Unavailable"`.
  - `data` (`ErrorData`, optional)
- One of: Option 2 (object)
  - `defined` (constant, required): Value: `false`.
  - `code` (string, required)
  - `status` (number, required)
  - `message` (string, required)
  - `data` (any, optional)
