Ask a question
AI answer to a question, from the documents only, with citations (counts as an AI call). Cached answers to the same question within a day don't use an AI call.
POST https://www.chicagopolitics.org/api/v1/answers
Authorizations
| Header | Value |
|---|---|
Authorization | Bearer <key>. Get a key; see authentication. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
question | string | yes | |
kind | string | One of: matter, meeting. | |
year | integer |
Response
200 Answer
| Field | Type | Description |
|---|---|---|
question | string | |
answer | string | Cites sources inline as [n] |
citations | object[] | |
model | string | null | |
cached | boolean |
Example request
curl -X POST "https://www.chicagopolitics.org/api/v1/answers" \
-H "Authorization: Bearer $CHICAGO_POLITICS_KEY" \
-H "Content-Type: application/json" \
-d '{"question":"What did the City Council approve for Foundry Park?"}'
Errors: 400, 401, 429 (see errors).