---
title: "NLWeb /ask over POST (same parameters as a JSON body)"
method: POST
path: "/ask"
tags: ["read"]
---

# NLWeb /ask over POST (same parameters as a JSON body)

`POST /ask`

## Request

- Base URL: `https://cotal.ai`
- URL: `https://cotal.ai/ask`
- Auth: none declared

## Request body

- object
  - `query` string, required
  - `mode` 'list' | 'summarize' | 'generate'
  - `streaming` boolean
  - `prefer` object
    - `streaming` boolean
  - `query_id` string
  - `prev` string[]

## Response `200`

Matching items (JSON), or an SSE stream when streaming was requested.

- AskResponse
  - `query_id` string, required
  - `_meta` object, required
    - `response_type` 'list', required
    - `version` string, required
    - `site` string
    - `mode` string
    - `requested_mode` string
    - `note` string
    - `query` string
    - `count` integer
  - `results` object[], required
    - `url` string, uri, required
    - `name` string, required
    - `site` string, required
    - `score` number, required
    - `description` string, required
    - `schema_object` object, required: schema.org JSON-LD for the item.

## Other responses

- `400`: Malformed body or validation error (`code`: bad_request | validation_error).
- `429`: Rate limited (`code`: rate_limited). Retry after `Retry-After` seconds.
- `default`: Any other failure. The body is always the Error object, with a stable `code` and a `hint`.

---

[API](https://skmtc.dev/cotal/apis/cotal-ai-public-api.md) · [All operations](https://skmtc.dev/cotal/apis/cotal-ai-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cotal/apis/cotal-ai-public-api/revisions/34ab992f2172?raw)
