> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tacetai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> Send a state and typed questions; get calibrated probabilities back as JSON.

Base URL: `https://api.tacetai.com/v1`

## Authentication

Create a key in the [Tacet console](https://console.tacetai.com) and send it as a bearer token. Keep it on your server; never ship it in a browser or app.

```bash theme={null}
curl https://api.tacetai.com/v1/decide \
  -H "Authorization: Bearer $TACET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "tacet-alpha", "state": "...", "questions": {...}}'
```

## Endpoints

| Method | Path | What it does |
| - | - | - |
| `POST` | `/v1/decide` | Answer questions about one state. |
| `POST` | `/v1/batches` | Start a job from an uploaded JSONL file. |
| `GET` | `/v1/batches/{id}` | Check status and progress. |
| `GET` | `/v1/batches/{id}/results` | Download results as JSONL, one line per record. |
| `POST` | `/v1/batches/{id}/cancel` | Stop a running job. |

For `noul` questions, `probs` has the keys `no` and `yes`, and `top` is whichever is higher.

## Errors

| Status | Code | What to do |
| - | - | - |
| 400 | `invalid_question` | Check the type and that criteria has 2 to 26 options. |
| 401 | `invalid_key` | Check the Authorization header. |
| 404 | `not_found` | Check the batch id. |
| 413 | `state_too_long` | Trim the state or split it across requests. |
| 429 | `rate_limited` | Wait for the time in the Retry-After header, then retry. |
| 500 | `server_error` | Retry with backoff. Contact us if it continues. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.