# 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](https://www.chicagopolitics.org/account); see [authentication](https://www.chicagopolitics.org/developers/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

```bash
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](https://www.chicagopolitics.org/developers/errors)).

---
Source: https://www.chicagopolitics.org/developers/api/answer-question · Chicago Politics, an independent, nonpartisan tracker of the Chicago City Council. Guide for agents: https://www.chicagopolitics.org/llms.txt
