> This page is for version v1 (default).
> For other versions, use one of these documentation indexes:
> - v1 (default): https://docs.butterix.com/en/llms.txt
> - v0: https://docs.butterix.com/en/v0/llms.txt

> For the MDX source of any page, append .mdx to the page URL.
> For a complete documentation index, see https://docs.butterix.com/en/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.butterix.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.butterix.com/_biti/feedback/agent.

# Upload a docs eval result

`POST /sites/{site}/evals`

Requires the `editor` role; usually called by `biti eval --site`. The score is computed from `results`.

Base URL: https://api.butterix.com/v1

Authentication: bearer token in Authorization header or API key in cookie `biti_session`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `site` | string | yes | Site slug or id |

## Request body

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `min` | integer | no | Pass mark (percent) |
| `model` | string | no | Model that answered |
| `judge` | string | no | Model that graded |
| `commit` | string | no | Commit of the docs |
| `results` | list of objects | yes |  |
| `results[].id` | string | no |  |
| `results[].question` | string | yes |  |
| `results[].pass` | boolean | no |  |
| `results[].met` | list of booleans | no | Whether each point is made |
| `results[].missing` | list of strings | no | Missing points |
| `results[].said` | list of strings | no | What the answer says but must not |
| `results[].unseen` | list of strings | no | Pages search didn't find |
| `results[].sources` | list of strings | no |  |
| `results[].answer` | string | no |  |
| `results[].note` | string | no | A remark from grading |
| `results[].error` | string | no | Why it couldn't be answered or graded |

## Example request

```bash
curl -X POST https://api.butterix.com/v1/sites/acme-payments/evals \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
         "results": [
           {
             "question": "How long does a refund take?"
           }
         ]
       }'
```

## Responses

### 201

Saved

Content type: `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | no |  |
| `createdAt` | integer | no |  |
| `score` | integer | no | Percent answered correctly |
| `passed` | integer | no |  |
| `total` | integer | no |  |
| `min` | integer | no | Pass mark |
| `ok` | boolean | no |  |
| `model` | string | no |  |
| `judge` | string | no |  |
| `commit` | string | no |  |

### Example response (201)

```json
{
  "id": "eval_k2m9",
  "createdAt": 1764115200000,
  "score": 85,
  "passed": 17,
  "total": 20,
  "min": 80,
  "ok": true,
  "model": "deepseek-flash",
  "judge": "deepseek-flash",
  "commit": "0123abcd"
}
```
