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

> ## Agent Instructions
> Call https://api.feyn.ai only; the hosts behind it are not public.
> Authenticate with a workspace API key in the Authorization header: `Authorization: Bearer fn_...`. Keep keys server-side.
> For chat completions, use the official OpenAI SDK with base_url https://api.feyn.ai/v1 and a model ID from GET /v1/models.
> On 429, wait for the Retry-After header before retrying. Failed requests are not charged.

# Scores

> A score is one named value on a trace: whether the run was right, by the measure you care about.

Score names are defined on the project, on the dashboard's **Scores** page. There you set the name and its type (boolean, number or string). A trace holds one value per name. To have a model score traces for you, add a [judge](https://docs.usefeyn.com/observability/judges.md).

Your app can write a value too, with `POST /v1/scores`:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl https://api.feyn.ai/v1/scores \
  -H "Authorization: Bearer $FEYN_API_KEY" \
  -H "X-Feyn-Project: inbox-triage" \
  -H "Content-Type: application/json" \
  -d '{"traceKey": "run_123:decide", "name": "notify", "value": true}'
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{ "id": "kx2..." }
```

**traceKey** `string` *required*

The `traceKey` you wrote the trace with.

**name** `string` *required*

A score name defined on the project.

**value** `number | string | boolean` *required*

The value. It must match the type the name was defined with.

Writing the same name on the same trace again replaces the value.

`volume`, `cost` and `latency` (in any case) are reserved for the built-in trace metrics; a score with one of those names is rejected with `400`.

A score can arrive before its trace: it is stored under the `traceKey` and shows up once the trace is written. A score whose trace is never written is kept but never shown, so check the `traceKey` if a score is missing.

## Delete a score

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X DELETE https://api.feyn.ai/v1/scores \
  -H "Authorization: Bearer $FEYN_API_KEY" \
  -H "X-Feyn-Project: analysis-decide" \
  -H "Content-Type: application/json" \
  -d '{"traceKey": "run_123:decide", "name": "notify"}'
```

Answers `202 {"id": "run_123:decide"}` and removes that name from the trace, usually within a second. Deleting a score that doesn't exist does nothing.


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