---
title: ข้อมูลอ้างอิง API: Evaluations
description: Platform API v1 ส่วน Evaluations: path, พารามิเตอร์, ฟิลด์ของคำขอและคำตอบ, scope, idempotency และข้อผิดพลาดของทุก operation จาก contract
url: https://agentlab.cresclab.com/docs/th/api/evaluations
language: th
updated: 2026-12-05
---

# ข้อมูลอ้างอิง API: Evaluations

Platform API v1 ส่วน Evaluations: path, พารามิเตอร์, ฟิลด์ของคำขอและคำตอบ, scope, idempotency และข้อผิดพลาดของทุก operation จาก contract

> [!NOTE]
> สร้างจาก API contract (Agent Lab Platform API 1.0.0-alpha.1) คำอธิบายเป็นภาษาอังกฤษตามต้นฉบับใน contract

An application evaluates an agent configuration it passes against cases it keeps, for the
member it acts for. The platform answers each case with the same loop as a run, judges it,
meters it as evaluation and keeps the verdicts; suites, history and the decision to ship are
the application's. An evaluation run belongs to its member and to the installation that
started it.

## Evaluate an agent configuration against cases

`POST /v1/workspaces/{workspaceId}/evaluation-runs`

Asks each case of `cases` of `agent` for the acting member, judges each answer against its
`expectations`, and answers at once with the run `running` and every case unanswered;
follow it with `GET …/evaluation-runs/{evaluationRunId}`. Each case is answered by the same
loop as a run, in a conversation of its own that is not shown to members, and is metered
as evaluation. A tool call that waits for a person is declined: nobody approves during an
evaluation. The cases are kept with the run and asked once; suites, history and overrides
are the application's.

Everything that can refuse the run is decided before anything is asked, and a refusal
stores nothing: `agent` is checked as `POST …/runs` checks it (the same problems, ids and
`model`), and the whole configuration and every case are checked at once
(`RUN_CONFIGURATION_INVALID`, 422, with `problems`); a field this operation does not name is
refused, never ignored. A workspace whose spending limit refuses the run answers
`RUN_BUDGET_REFUSED`: an evaluation answers and judges every case, so it is refused whole
rather than stopped part way.

One installation runs at most five evaluation runs at a time; another start while five are
running is `EVALUATIONS_IN_PROGRESS` (429, `retry`).

Send `Idempotency-Key`: without one, a retried request is a second evaluation, charged
again.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `evaluations:write` | `member` | `installationToken` | รองรับ |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `Idempotency-Key` | header | `string` | ไม่ | Makes a creating call safe to retry. The same key and body within 24 hours answer the first answer again; the same key with a different body is 409. |

### เนื้อหาคำขอ

`application/json`: [EvaluationRunCreate](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationRunCreate)

| ฟิลด์ | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- |
| `agent` | [AgentConfig](https://agentlab.cresclab.com/docs/th/api/schemas.md#AgentConfig) | ใช่ | — |
| `cases` | [EvaluationCase](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationCase)[] | ใช่ | The cases to ask, each with an `id` no other case of the run has. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `202` | `application/json`: [EvaluationRun](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationRun) | The evaluation run, started. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `402` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | `RUN_BUDGET_REFUSED`: the workspace's spending limit refuses the run; nothing ran (`configure`). |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused as `MemberForbidden` says (including `PRODUCT_ACCESS_DENIED`), or `MEMBER_INACTIVE`: the member is no longer an active member, or between the checks and the start the member's seat or the installation stopped admitting the run; nothing ran (`authorize`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `409` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The `Idempotency-Key` was used within 24 hours for a different request (`none`), or its first request is still running (`retry`). |
| `413` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The body is larger than the operation accepts (`PAYLOAD_TOO_LARGE`, `recovery: none`). |
| `422` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused before anything ran or was stored: `RUN_CONFIGURATION_INVALID`, the configuration or input has problems, each in `problems` with its field (`none`); `RUN_MODEL_UNAVAILABLE`, the workspace may not run on the named model (`configure`). |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |

## An evaluation run and its verdicts

`GET /v1/workspaces/{workspaceId}/evaluation-runs/{evaluationRunId}`

The run's status and every case in the order it was supplied, each with its result once
answered and judged (`null` until then). An evaluation run of another member, another
installation or another workspace is not found.

| Scope | ทำในนามของ | การยืนยันตัวตน | Idempotency-Key |
| --- | --- | --- | --- |
| `evaluations:write` | `member` | `installationToken` | — |

### พารามิเตอร์

| ชื่อ | ตำแหน่ง | ชนิด | จำเป็น | คำอธิบาย |
| --- | --- | --- | --- | --- |
| `workspaceId` | path | `string` | ใช่ | The workspace, by id. It must be the installation's. |
| `Agentlab-On-Behalf-Of` | header | `string` | ใช่ | The account id of the member the installation acts for: a current member of the workspace whose sign-in to the application there is still live, neither revoked nor expired. When the member's sign-in expires, the application acts for them again once they sign in again. |
| `evaluationRunId` | path | `string` | ใช่ | The evaluation run, by id. |

### คำตอบ

| สถานะ | เนื้อหา | คำอธิบาย |
| --- | --- | --- |
| `200` | `application/json`: [EvaluationRun](https://agentlab.cresclab.com/docs/th/api/schemas.md#EvaluationRun) | The evaluation run. |
| `400` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | The request itself is wrong, such as a `cursor` this list did not answer (`recovery: none`). |
| `401` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No token, or a token the platform does not honor. |
| `403` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Refused as `MemberForbidden` says (including `PRODUCT_ACCESS_DENIED`), or `MEMBER_INACTIVE`: the member is no longer an active member, or between the checks and the start the member's seat or the installation stopped admitting the run; nothing ran (`authorize`). |
| `404` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | No such operation or resource. |
| `429` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Rate limited (`recovery: retry`). |
| `503` | `application/json`: [Error](https://agentlab.cresclab.com/docs/th/api/schemas.md#Error) | Try again later (`recovery: retry`). |
