Skip to content
Docs
GitHub

Create an eval case

Preview

Inspect agent quality, health, observers, semantic reports and notifications.

Public APIRequires the evals feature flag

POST/v1/evals/{eval_id}/cases

See authentication for credentials and permissions.

eval_id
required
string

Prefixed public identifier

Media typeapplication/json

Request to create an eval case

object
artifacts

Session files to capture after scoring completes.

Array<object> | null

Named session file to collect after an eval case completes.

object
name
required

Export key for this artifact (for example patch or log).

string

Example

patch
path
required

Absolute path in the session filesystem.

string

Example

/workspace/fix.patch

Example

[
{
"name": "patch",
"path": "/workspace/fix.patch"
}
]
conversation

Input messages sent to the agent sequentially. May be empty when a simulated user opens the conversation.

Array<object>

A message to send to the agent during an eval case.

object
content
required

The text content to send.

string

Example

Fix the failing test in src/lib.rs

Example

[
{
"content": "Fix the failing test in src/lib.rs"
}
]
description

Human-readable description. Safe to render in user-facing messages.

string | null

Example

Agent fixes a failing unit test
max_turns

Maximum agent turns before the case stops.

integer | null format: int32

Example

10
name
required

Human-readable name. Safe to render in user-facing messages.

string

Example

fix-failing-test
position

Display order within the eval.

integer | null format: int32

Example

0
post

Verification messages sent after conversation completes and session idles.

Array<object> | null

A message to send to the agent during an eval case.

object
content
required

The text content to send.

string

Example

Fix the failing test in src/lib.rs

Example

[
{
"content": "Run the tests again and report the result"
}
]
scorers
required

Scoring rules applied to the case output.

Array
One of:

Final assistant message contains substring.

object
text
required
string
type
required
string
Allowed values: contains
weight
number format: double

Example

[
{
"text": "tests pass",
"type": "contains"
}
]
simulated_user
One of:

A model that plays the user after the scripted messages, until it is done or reaches its turn limit. Not combined with post.

object
done_when

When the user stops: the simulator ends the conversation once this holds. Defaults to “the goal is met or clearly cannot be”.

string | null

Example

The agent opened a refund ticket with the right order number.
goal
required

What the user wants from the conversation.

string

Example

Get the duplicate charge refunded, or a clear date when it will be.
max_turns

Most messages the simulator sends (default 8, at most 30).

integer | null format: int32
>= 1 <= 30

Example

8
model_id

Model that plays the user. Omitted: the organization’s default model.

string | null

Example

model_01933b5a00007000800000000000022c
persona
required

Who the user is, what they know and how they write.

string

Example

Small shop owner charged twice for the Pro plan. Writes short messages. Gives the order number ORD-48213 only when asked.
virtual_user_id

Virtual user the simulator speaks as, so the agent sees that end user’s identity, connections and memory.

string | null

Example

identity_01933b5a000070008000000000000001
tags

Free-form tags attached to this resource.

Array<string> | null

Example

[
"regression",
"nightly"
]
target
One of:
One of:

Session creation parameters (mirrors CreateSessionRequest).

object
agent_id

Agent to work in this session.

string | null
harness_id

Harness for the session. If omitted, org default harness is used.

string | null
harness_name

Addressable harness name (alternative to harness_id).

string | null
max_iterations

Max LLM iterations per turn.

integer | null
model_id

LLM model override.

string | null
system_prompt

System prompt override (prepended to agent prompt).

string | null
type
required
string
Allowed values: session
timeout_seconds

Per-case timeout in seconds.

integer | null format: int32

Example

120
tool_fixtures

Tools the case gives the agent, each answered with a canned response.

Array<object> | null

A tool the case gives the agent, answered with a canned response.

object
description

What the tool does, as the agent reads it.

string | null

Example

Open a support ticket
name
required

Tool name the agent calls.

string

Example

create_ticket
parameters

JSON Schema of the arguments. Omitted: an object with any fields.

response
required

What every call returns.

Responses

201Created

Created

Media typeapplication/json

A single test case within an eval.

object
artifacts

Session files to collect after scoring completes.

Array<object> | null

Named session file to collect after an eval case completes.

object
name
required

Export key for this artifact (for example patch or log).

string
path
required

Absolute path in the session filesystem.

string
conversation
required

Input messages sent sequentially.

Array<object>

A message to send to the agent during an eval case.

object
content
required

The text content to send.

string
created_at
required

When the case was created.

string format: date-time
description

Optional description of what the case checks.

string | null
id
required

External identifier (evalcase_<32-hex>).

string
max_turns

Max agent turns (default: 10).

integer | null format: int32
name
required

Case name.

string
position
required

Display order.

integer format: int32
post

Verification messages sent after conversation completes and session idles. Scorers run after post messages complete (not after conversation).

Array<object> | null

A message to send to the agent during an eval case.

object
content
required

The text content to send.

string
scorers
required

Scoring rules.

Array
One of:

Final assistant message contains substring.

object
text
required
string
type
required
string
Allowed values: contains
weight
number format: double
simulated_user
One of:

A model that plays the user after the scripted messages.

object
done_when

When the user stops: the simulator ends the conversation once this holds. Defaults to “the goal is met or clearly cannot be”.

string | null
goal
required

What the user wants from the conversation.

string
max_turns

Most messages the simulator sends (default 8, at most 30).

integer | null format: int32
>= 1 <= 30
model_id

Model that plays the user. Omitted: the organization’s default model.

string | null
persona
required

Who the user is, what they know and how they write.

string
virtual_user_id

Virtual user the simulator speaks as, so the agent sees that end user’s identity, connections and memory.

string | null
tags

Free-form tags for filtering runs.

Array<string>
target
One of:
One of:

Session creation parameters (mirrors CreateSessionRequest).

object
agent_id

Agent to work in this session.

string | null
harness_id

Harness for the session. If omitted, org default harness is used.

string | null
harness_name

Addressable harness name (alternative to harness_id).

string | null
max_iterations

Max LLM iterations per turn.

integer | null
model_id

LLM model override.

string | null
system_prompt

System prompt override (prepended to agent prompt).

string | null
type
required
string
Allowed values: session
timeout_seconds

Per-case timeout in seconds (default: 120).

integer | null format: int32
tool_fixtures

Tools the case gives the agent, answered with canned responses.

Array<object> | null

A tool the case gives the agent, answered with a canned response.

object
description

What the tool does, as the agent reads it.

string | null
name
required

Tool name the agent calls.

string
parameters

JSON Schema of the arguments. Omitted: an object with any fields.

response
required

What every call returns.

updated_at
required

When the case was last updated.

string format: date-time

Example

{
"artifacts": [
{
"name": "patch",
"path": "/workspace/fix.patch"
}
],
"conversation": [
{
"content": "Fix the failing test in src/lib.rs"
}
],
"created_at": "2026-01-15T10:30:00Z",
"description": "Agent fixes a failing unit test",
"id": "evalcase_01933b5a000070008000000000000001",
"max_turns": 10,
"name": "fix-failing-test",
"position": 0,
"post": [
{
"content": "Run the tests again and report the result"
}
],
"scorers": [
{
"text": "tests pass",
"type": "contains"
}
],
"simulated_user": {
"done_when": "The agent opened a refund ticket with the right order number.",
"goal": "Get the duplicate charge refunded, or a clear date when it will be.",
"max_turns": 8,
"model_id": "model_01933b5a00007000800000000000022c",
"persona": "Small shop owner charged twice for the Pro plan. Writes short messages. Gives the order number ORD-48213 only when asked.",
"virtual_user_id": "identity_01933b5a000070008000000000000001"
},
"tags": [
"regression",
"nightly"
],
"target": {
"type": "session"
},
"timeout_seconds": 120,
"tool_fixtures": [
{
"description": "Open a support ticket",
"name": "create_ticket"
}
],
"updated_at": "2026-01-15T10:30:00Z"
}