Skip to content
Context docs
Evals API

Monitors

Serverhttps://context.example.com/api/v1/evals

A monitor is the evaluation that grades a sample of real requests as they finish. It watches 1 to 50 targets (each an agent, skill, applet or Evals workflow at a sample percentage from 1 to 100, or every trace in the organization), grades with 1 to 50 criteria, and passes a request whose weighted score reaches its pass mark, from 0 to 1. A monitor is on or paused, and each change names the revision it read, so a change made after someone else's is refused with 409. Monitors need Monitoring turned on for the organization; until then these endpoints answer 403.


Create a monitor

POST
https://context.example.com/api/v1/evals
/monitors
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

A live evaluation: grades a percent of each target's real requests (agents, skills, applets, workflows, or every trace), on at once. It needs a pass mark and at least one criterion (verifiers it saves, or library criteria it binds). A body that names alerts is refused.

Create a monitor › Headers

Idempotency-Key
​string · maxLength: 255

A key you choose for this request (a UUID works; at most 255 characters; a blank one is refused 400, code idempotency_key_empty). A retry with the same key and the same body answers the first success again instead of acting twice; kept 24 hours. Send one on every create and run start you might retry.

Create a monitor › Request Body

name
​string · minLength: 1 · maxLength: 200 · required
passMark
​number | null · min: 0 · max: 1 · required

A row passes at or above this 0..1 score. A live evaluation needs one; a test set may state none (null)

​object · required

live: the targets it grades (agents, skills, applets, workflows or every trace), each at a percent of its requests, and the library criteria it binds

workspaceId
​string | null · minLength: 1

The workspace to create this in; null = organization-wide (organization admins only); omitted = the caller's only workspace, or every workspace for an organization admin

description
​string | null · maxLength: 2000
​array · maxItems: 50

The evaluation's own verifiers, as JSON definitions or .md files. A test set may have none (its dataset's criteria grade it); a live evaluation needs at least one. A rule is refused: write the check in Python

Default: []

Create a monitor › Responses

Success. A retry with the same Idempotency-Key and the same request answers this again, with Idempotent-Replayed: true.

One evaluation, live or test set, in one shape
​object · required
orgId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required
description
​string | null · required
​required
passMark
​number | null · min: 0 · max: 1 · required

A row passes at or above this 0..1 score; null when the evaluation states none

enabled
​boolean | null · required

Whether a live evaluation admits new requests; null for a test set, which runs when asked

pausedReason
​string | null · enum · required

Why the platform paused a live evaluation (its payer left, is over budget, or the organization is out of credits); null when a person paused it, it is live, or it is a test set

Enum values:
payer_left
payer_over_budget
org_out_of_credits
payerUserId
​string | null · minLength: 1 · maxLength: 200 · required

The person a live evaluation's checks bill: whoever last turned it on or saved a change; null for a test set (a run bills whoever starts it)

revision
​integer | null · required

A live evaluation's save counter: a change names the revision it read and is refused CONFLICT when another save came first; null for a test set

​object[] · required
verifierCount
​integer · min: 0 · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​array · required

The evaluation's own verifiers in order (a test set's datasets and rows may add checks of their own)

test
​object | null · required

A test set's question (what each run varies and holds) and its default judge model; null when live

webUrl
​string

The evaluation's page, /client/evals/evaluation/<monitor|benchmark>/ on the org's public origin (the one share links carry). Absent from a server older than the field


Get a monitor

GET
https://context.example.com/api/v1/evals
/monitors/{monitorId}
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

The monitor as an update replaces it: name, pass mark, targets at their percents, criteria by reference, and its revision.

Get a monitor › path Parameters

monitorId
​string · minLength: 1 · required

Monitor identifier

Monitor (from the path)

Get a monitor › Responses

Success

One evaluation, live or test set, in one shape
​object · required
orgId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required
description
​string | null · required
​required
passMark
​number | null · min: 0 · max: 1 · required

A row passes at or above this 0..1 score; null when the evaluation states none

enabled
​boolean | null · required

Whether a live evaluation admits new requests; null for a test set, which runs when asked

pausedReason
​string | null · enum · required

Why the platform paused a live evaluation (its payer left, is over budget, or the organization is out of credits); null when a person paused it, it is live, or it is a test set

Enum values:
payer_left
payer_over_budget
org_out_of_credits
payerUserId
​string | null · minLength: 1 · maxLength: 200 · required

The person a live evaluation's checks bill: whoever last turned it on or saved a change; null for a test set (a run bills whoever starts it)

revision
​integer | null · required

A live evaluation's save counter: a change names the revision it read and is refused CONFLICT when another save came first; null for a test set

​object[] · required
verifierCount
​integer · min: 0 · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​array · required

The evaluation's own verifiers in order (a test set's datasets and rows may add checks of their own)

test
​object | null · required

A test set's question (what each run varies and holds) and its default judge model; null when live

webUrl
​string

The evaluation's page, /client/evals/evaluation/<monitor|benchmark>/ on the org's public origin (the one share links carry). Absent from a server older than the field


Replace a monitor's settings

PUT
https://context.example.com/api/v1/evals
/monitors/{monitorId}
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Replaces its name, pass mark, targets and criteria together, under the expectedRevision you read (GET /monitors/{monitorId}); a save in between is refused 409 with the current revision.

Replace a monitor's settings › path Parameters

monitorId
​string · minLength: 1 · required

Monitor identifier

Monitor (from the path)

Replace a monitor's settings › Request Body

name
​string · minLength: 1 · maxLength: 200 · required
expectedRevision
​integer · required

The revision the caller read (get answers it); refused CONFLICT when another save came after it

passMark
​number · min: 0 · max: 1 · required

A row passes at or above this 0..1 score

​object · required
description
​string | null · maxLength: 2000
​array · maxItems: 50

New verifiers this save adds, saved to the library as create saves them (JSON definitions or .md files). The evaluation's current criteria are bound in source.live.criteria by id (get's verifiers[].id), never repeated here

Default: []

Replace a monitor's settings › Responses

Success

One evaluation, live or test set, in one shape
​object · required
orgId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required
description
​string | null · required
​required
passMark
​number | null · min: 0 · max: 1 · required

A row passes at or above this 0..1 score; null when the evaluation states none

enabled
​boolean | null · required

Whether a live evaluation admits new requests; null for a test set, which runs when asked

pausedReason
​string | null · enum · required

Why the platform paused a live evaluation (its payer left, is over budget, or the organization is out of credits); null when a person paused it, it is live, or it is a test set

Enum values:
payer_left
payer_over_budget
org_out_of_credits
payerUserId
​string | null · minLength: 1 · maxLength: 200 · required

The person a live evaluation's checks bill: whoever last turned it on or saved a change; null for a test set (a run bills whoever starts it)

revision
​integer | null · required

A live evaluation's save counter: a change names the revision it read and is refused CONFLICT when another save came first; null for a test set

​object[] · required
verifierCount
​integer · min: 0 · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​array · required

The evaluation's own verifiers in order (a test set's datasets and rows may add checks of their own)

test
​object | null · required

A test set's question (what each run varies and holds) and its default judge model; null when live

webUrl
​string

The evaluation's page, /client/evals/evaluation/<monitor|benchmark>/ on the org's public origin (the one share links carry). Absent from a server older than the field


Resume a monitor

POST
https://context.example.com/api/v1/evals
/monitors/{monitorId}/enable
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Resumes grading under the expectedRevision you read. Resuming makes you the person it charges.

Resume a monitor › path Parameters

monitorId
​string · minLength: 1 · required

Monitor identifier

Monitor (from the path)

Resume a monitor › Request Body

expectedRevision
​integer · required

Configuration revision for optimistic concurrency

Resume a monitor › Responses

Success

One evaluation, live or test set, in one shape
​object · required
orgId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required
description
​string | null · required
​required
passMark
​number | null · min: 0 · max: 1 · required

A row passes at or above this 0..1 score; null when the evaluation states none

enabled
​boolean | null · required

Whether a live evaluation admits new requests; null for a test set, which runs when asked

pausedReason
​string | null · enum · required

Why the platform paused a live evaluation (its payer left, is over budget, or the organization is out of credits); null when a person paused it, it is live, or it is a test set

Enum values:
payer_left
payer_over_budget
org_out_of_credits
payerUserId
​string | null · minLength: 1 · maxLength: 200 · required

The person a live evaluation's checks bill: whoever last turned it on or saved a change; null for a test set (a run bills whoever starts it)

revision
​integer | null · required

A live evaluation's save counter: a change names the revision it read and is refused CONFLICT when another save came first; null for a test set

​object[] · required
verifierCount
​integer · min: 0 · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​array · required

The evaluation's own verifiers in order (a test set's datasets and rows may add checks of their own)

test
​object | null · required

A test set's question (what each run varies and holds) and its default judge model; null when live

webUrl
​string

The evaluation's page, /client/evals/evaluation/<monitor|benchmark>/ on the org's public origin (the one share links carry). Absent from a server older than the field


Pause a monitor

POST
https://context.example.com/api/v1/evals
/monitors/{monitorId}/disable
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Stops grading new requests under the expectedRevision you read; its results stay.

Pause a monitor › path Parameters

monitorId
​string · minLength: 1 · required

Monitor identifier

Monitor (from the path)

Pause a monitor › Request Body

expectedRevision
​integer · required

Configuration revision for optimistic concurrency

Pause a monitor › Responses

Success

One evaluation, live or test set, in one shape
​object · required
orgId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required
description
​string | null · required
​required
passMark
​number | null · min: 0 · max: 1 · required

A row passes at or above this 0..1 score; null when the evaluation states none

enabled
​boolean | null · required

Whether a live evaluation admits new requests; null for a test set, which runs when asked

pausedReason
​string | null · enum · required

Why the platform paused a live evaluation (its payer left, is over budget, or the organization is out of credits); null when a person paused it, it is live, or it is a test set

Enum values:
payer_left
payer_over_budget
org_out_of_credits
payerUserId
​string | null · minLength: 1 · maxLength: 200 · required

The person a live evaluation's checks bill: whoever last turned it on or saved a change; null for a test set (a run bills whoever starts it)

revision
​integer | null · required

A live evaluation's save counter: a change names the revision it read and is refused CONFLICT when another save came first; null for a test set

​object[] · required
verifierCount
​integer · min: 0 · required
createdAt
​string · date-time · required
updatedAt
​string · date-time · required
​array · required

The evaluation's own verifiers in order (a test set's datasets and rows may add checks of their own)

test
​object | null · required

A test set's question (what each run varies and holds) and its default judge model; null when live

webUrl
​string

The evaluation's page, /client/evals/evaluation/<monitor|benchmark>/ on the org's public origin (the one share links carry). Absent from a server older than the field