Skip to content

AI execution

Evaluations API

Score a conversation transcript against a rubric you define. Roye owns the method, the conversation-rubric@1 profile; you own the criteria, levels, transcripts and context. A run returns, for each criterion, a level and the quotes it rests on.

Local preview

Contract 1 preview of the profile, rubric, plan and run routes and of the lookup of a run's bill. No hosted environment serves Evaluations, and no judge model is qualified: qualification.state is unqualified for every model and language pair. A deployment serves the Evaluations routes only with ROYE_EVALUATIONS_ENABLED set, off by default; elsewhere every /v1/evaluations route answers not_found and GET /v1/capabilities omits the module. The bill lookup is served whatever the flag says, so a run's bill stays readable after the flag is turned off. The SDK client is in the private @roye-ai/client package, which is not published. This guide does not authorize use or show the API is enabled for your project.

Quickstart

Call Evaluations from your trusted backend, over HTTP as below or with the SDK client. Create a rubric.

Create a rubric
POST /v1/evaluations/rubrics
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-rubric-1",
  "name": "Debate practice",
  "criteria": [
    {
      "kind": "ordinal",
      "id": "rebuttal",
      "title": "Rebuttal",
      "definition": "How well the speaker answers the opponent's main claim.",
      "applicability": {
        "requires": [
          "opposingTurns"
        ]
      },
      "uses": [
        "argumentMap"
      ],
      "levels": [
        {
          "id": "0",
          "descriptor": "Does not respond to the opposing claim."
        },
        {
          "id": "1",
          "descriptor": "Mentions the claim without answering it."
        },
        {
          "id": "2",
          "descriptor": "Answers the claim with an assertion."
        },
        {
          "id": "3",
          "descriptor": "Answers the claim with a reason."
        },
        {
          "id": "4",
          "descriptor": "Answers the claim with a reason and evidence."
        }
      ]
    },
    {
      "kind": "binary",
      "id": "stayedOnMotion",
      "title": "Stayed on the motion",
      "definition": "Every argument addresses the motion in the context."
    },
    {
      "kind": "metric",
      "id": "talkShare",
      "title": "Talk share",
      "metric": "talk_share"
    }
  ],
  "aggregate": {
    "overall": "weighted_mean"
  }
}

Then disclose the plan for revision 1: the judge calls a run of this request would make. A plan reserves and charges nothing. Where the profile lists no models, it answers unsupported_capability.

Disclose a plan
POST /v1/evaluations/plans
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 1
  },
  "profile": {
    "id": "conversation-rubric",
    "revision": "1"
  },
  "model": "provider/judge-model",
  "transcript": {
    "language": "en",
    "speakers": [
      {
        "id": "student",
        "label": "Student"
      },
      {
        "id": "opponent",
        "label": "AI opponent"
      }
    ],
    "turns": [
      {
        "id": "t1",
        "speaker": "opponent",
        "text": "School uniforms limit how students express themselves."
      },
      {
        "id": "t2",
        "speaker": "student",
        "text": "Uniforms remove pressure to buy expensive clothes, so students can focus on learning."
      },
      {
        "id": "t3",
        "speaker": "opponent",
        "text": "But self-expression matters more than cost."
      },
      {
        "id": "t4",
        "speaker": "student",
        "text": "Students still express themselves through clubs and their work, and a survey at our school found most families saved money."
      }
    ]
  },
  "target": {
    "speakerIds": [
      "student"
    ]
  },
  "context": {
    "text": "Motion: This house would require school uniforms."
  },
  "outputLanguage": "ko"
}

To score the transcript, send the same body with an idempotencyKey as a run. Roye scores it in the background; read it with waitMs or follow its events (Start a run).

Two uses, one contract

Unrelated products send the same fields; Roye has no customer-specific route, prompt, rubric or branch.

  • Debate practice: an ordinal rebuttal judged against the argument map, talk_share and a weighted_mean overall. The learner faces AI opponents, with the motion as context and rationales in the learner's language.
  • Contact-center scorecard: binary items, some critical, and longest_turn_share. The agent faces the customer, with policy text as context and rationales in the reviewers' language.

Concepts

IDs are opaque; rubrics and runs belong to one project and environment. Characters are Unicode code points; KiB counts UTF-8 bytes.

ResourceMeaning
Profile conversation-rubric@1Roye's read-only method. A pinned revision never changes behavior.
Rubric (evr_)id, latestRevision, createdAt, updatedAt. Criteria live in immutable revisions with a digest, expiring after 30 days.
Run (evx_)One evaluation of a transcript against a pinned rubric revision. Roye drives every admitted run to a terminal state.
Run eventA content-free record of a run's status, stage or criterion change, read in order by cursor.

Authentication and versions

  • Send the backend project key, never from a browser, with X-Roye-Project and X-Roye-Environment (development or production). Actor, operating and processor credentials are refused; a scoped key needs evaluations.
  • Only GET /runs/{runId} takes waitMs and only GET /runs/{runId}/events takes cursor; no other route takes a query parameter.
  • Roye-Contract-Version: 1 selects contract 1 and is echoed. Versions are unpinned previews: no header means 1, another is contract_version_unsupported.
  • Where a deployment serves it, GET /v1/capabilities lists evaluations in preview with profiles, rubrics, revisions, plans, runs, events, cancel, purge and the conversation-rubric profile (SDK guide). Closed sets such as criterion kinds, metrics and not-applicable reasons may grow: handle unknown values.
Headers
# Every Evaluations request, sent from your trusted backend only.
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

Profile catalog entry

Plans pin the method revision this entry describes: the served stages (argument_map, criterion) and samples (one), output token limits per stage, the planned-call maximum, and the text rules' unicodeVersion, whose upgrade can move a metric or quote span within one profile revision.

models lists the allowed judge models, empty by default, each with qualification records per transcript and output language. None exists yet, so every pair is unqualified.

Read the catalog entry
GET /v1/evaluations/profiles/conversation-rubric/revisions/1
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200, Roye-Contract-Version: 1. models is empty by default; provider/judge-model stands in for an allowed model.
{
  "id": "conversation-rubric",
  "revision": "1",
  "contractVersions": [
    1
  ],
  "acquisition": "native-json",
  "unicodeVersion": "16.0",
  "stages": [
    "argument_map",
    "criterion"
  ],
  "samples": [
    1
  ],
  "models": [
    {
      "id": "provider/judge-model",
      "qualification": []
    }
  ],
  "limits": {
    "maxCriterionOutputTokens": 4096,
    "maxArgumentMapOutputTokens": 8192,
    "maxFeedbackOutputTokens": 8192,
    "maxPlannedCalls": 64
  }
}

Rubric body

Request schemas are strict: an unknown field is invalid_request and nothing is defaulted, so the operation digest covers the body as sent. The stored body, defaults applied, is itself a valid request body with the same digest, the SHA-256 of its canonical JSON. The 64 KiB bound applies to the body as sent, and the defaults make the stored body larger, so a stored body near the bound can exceed it. Near the bound, keep the body you sent and resend that. IDs are unique within their rubric or criterion.

FieldBounds and default
name, criteria[].title1 to 80 and 1 to 120 characters.
criteria1 to 20, in report order.
criteria[].idA lowercase letter, then up to 39 letters, digits or _.
criteria[].kindordinal or binary (pass or fail), judged by a model call; metric, computed with none.
definition, weightOrdinal, binary: 1 to 2,000 characters; weight 0 to 1, default 1.
levelsOrdinal: 2 to 11 { id, descriptor }, lowest first. id 1 to 16 letters, digits, - or _, not cannot_judge or __…__; descriptor up to 600 characters.
checklist, examplesUp to 8 items of 200 characters; up to 3 { excerpt, level, rationale } of 2,000 and 400, level one of its levels.
evidence{ required, maxQuotes }, 1 to 5 quotes. Default { required: true, maxQuotes: 3 }.
applicability.requiresUp to 4 of opposingTurns, timestamps, audioFeatures, videoFeatures. Audio and video are never applicable in contract 1.
uses[] or ["argumentMap"], to judge against the argument map.
criticalBinary: default false.
metricturn_count, talk_share, longest_turn_share, mean_turn_chars or lexical_uptake.
aggregate.overallnone (default) or weighted_mean.
feedback.maxSuggestions0 to 5, default 0. Above 0 is refused in this preview.
201 response
{
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "latestRevision": 1,
    "createdAt": 1793000000000,
    "updatedAt": 1793000000000
  },
  "revision": {
    "rubricId": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 1,
    "digest": "ec7883d11fa3b47c545d0e8780808821e66fd480d9327a4c82d82259a596964a",
    "body": {
      "name": "Debate practice",
      "criteria": [
        {
          "kind": "ordinal",
          "id": "rebuttal",
          "title": "Rebuttal",
          "definition": "How well the speaker answers the opponent's main claim.",
          "evidence": {
            "required": true,
            "maxQuotes": 3
          },
          "applicability": {
            "requires": [
              "opposingTurns"
            ]
          },
          "uses": [
            "argumentMap"
          ],
          "weight": 1,
          "levels": […]
        },
        {
          "kind": "binary",
          "id": "stayedOnMotion",
          "title": "Stayed on the motion",
          "definition": "Every argument addresses the motion in the context.",
          "evidence": {
            "required": true,
            "maxQuotes": 3
          },
          "weight": 1,
          "critical": false
        },
        {
          "kind": "metric",
          "id": "talkShare",
          "title": "Talk share",
          "metric": "talk_share"
        }
      ],
      "aggregate": {
        "overall": "weighted_mean"
      },
      "feedback": {
        "maxSuggestions": 0
      }
    },
    "operation": {
      "operationId": "op_3f841de9f62c9ff598a0b4c342890328",
      "idempotencyKey": "debate-rubric-1",
      "inputDigest": "41d493701ffb4344ef76ed2d428416e0aadd64226e4d67b7a778b612532aabd5"
    },
    "createdAt": 1793000000000,
    "expiresAt": 1795592000000
  }
}

Revise and read

  • To change a rubric, send its full body with a new idempotencyKey and expectedRevision, the latestRevision you read. The 201 answer { rubric, revision } shows the new latestRevision and updatedAt.
  • A stale expectedRevision is 409 revision_conflict, naming the latest in error.expectedRevision. Resend with it and a new key.
  • A revision expires at expiresAt, 30 days after creation; reads, plans and runs do not extend it. Reads, plans and new runs naming it then answer not_found; a run admitted before is unaffected. The rubric keeps only its ID, latest number and times.
  • To keep a rubric, add a revision with the body you sent: the digest matches. Project export includes unexpired revisions and deletion removes them (Project exit and export).
Revise a rubric
POST /v1/evaluations/rubrics/evr_55cb3e93643989b563ca29e2560ee818/revisions
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

# The full body again, criteria as in the create request.
{
  "idempotencyKey": "debate-rubric-2",
  "expectedRevision": 1,
  "name": "Debate practice (v2)",
  "criteria": […],
  "aggregate": {
    "overall": "weighted_mean"
  }
}

# 201, Roye-Contract-Version: 1
{
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "latestRevision": 2,
    "createdAt": 1793000000000,
    "updatedAt": 1793000060000
  },
  "revision": {
    "rubricId": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 2,
    "digest": "ef082615ef1e4dad2c490de4fc1cb4f1b172ab1bdffbcac037e299e35b978c1e",
    "body": {
      "name": "Debate practice (v2)",
      "criteria": […],
      "aggregate": {
        "overall": "weighted_mean"
      },
      "feedback": {
        "maxSuggestions": 0
      }
    },
    "operation": {
      "operationId": "op_27b3b7a1f200791332139aeeefa06d76",
      "idempotencyKey": "debate-rubric-2",
      "inputDigest": "8bf69e2dbcbf94fa32e62acc40ea2e89206b7bf90f050f893f5293ae8837a4b6"
    },
    "createdAt": 1793000060000,
    "expiresAt": 1795592060000
  }
}

# The same body with a new key, debate-rubric-3, and the stale expectedRevision 1:
# 409 revision_conflict, with error.expectedRevision 2. Read the rubric, then send expectedRevision 2 with a new key.
# Sending debate-rubric-2 again replays the 201 above with Roye-Replayed: true.
Read a rubric and a revision
GET /v1/evaluations/rubrics/evr_55cb3e93643989b563ca29e2560ee818
# 200
{
  "id": "evr_55cb3e93643989b563ca29e2560ee818",
  "latestRevision": 2,
  "createdAt": 1793000000000,
  "updatedAt": 1793000060000
}

GET /v1/evaluations/rubrics/evr_55cb3e93643989b563ca29e2560ee818/revisions/2
# 200: the revision object of the 201 above, the same until it expires.

Disclose a plan

A plan takes the run request without a key. It creates no operation or reservation and is not admission. It has one argument_map call when an applicable criterion uses the map, then one call per applicable model criterion and sample, numbered from 1. A criterion that needs opposingTurns is not applicable when no target turn follows an opposing turn.

When the project's tariff is ready, the plan adds maximumMicros, the most the run can charge in USD micros, with its policyRevision. Both appear together, follow the retail rules of POST /v1/billing/quote, and are exactly what admission reserves. No judge model is measured yet, so every call's maxInputTokens is the model's input ceiling.

FieldBounds
rubric{ id, revision }, revision 1 or more.
profile{ id: "conversation-rubric", revision: "1" }, revision a string.
modelA listed provider/model, up to 200 characters.
transcript.language, outputLanguageBCP 47, 2 to 35 characters. Rationales use outputLanguage; quotes stay verbatim.
transcript.speakers1 to 16 { id, label? }, label up to 80 characters.
transcript.turns1 to 2,000 { id, speaker, text, startMs?, endMs? } in order, text up to 20,000 characters, 0 ≤ startMs ≤ endMs.
Turn and speaker IDs1 to 32 letters, digits, - or _, unique, speakers declared.
target.speakerIds1 to 4. Other speakers' turns are opposing turns.
context.textOptional motion or policy text, up to 64 KiB.
sampling.samplesOptional, 1.

Served: profile revision 1, listed models and the profile stages and samples. Anything else is unsupported_capability with error.field naming it: a rubric setting such as /feedback/maxSuggestions above 0 when you create the rubric, a plan or run field such as /sampling/samples 3 when the plan is made. The amount in the example below is illustrative.

200 response
{
  "callCount": 3,
  "calls": [
    {
      "stage": "argument_map",
      "model": "provider/judge-model",
      "maxInputTokens": 200000,
      "maxOutputTokens": 8192
    },
    {
      "stage": "criterion",
      "criterionId": "rebuttal",
      "sample": 1,
      "model": "provider/judge-model",
      "maxInputTokens": 200000,
      "maxOutputTokens": 4096
    },
    {
      "stage": "criterion",
      "criterionId": "stayedOnMotion",
      "sample": 1,
      "model": "provider/judge-model",
      "maxInputTokens": 200000,
      "maxOutputTokens": 4096
    }
  ],
  "maximumMicros": 742500,
  "policyRevision": "retail-2026-10"
}

Start a run

POST /v1/evaluations/runs takes the plan request plus an idempotencyKey. Admission reserves the plan's maximumMicros and answers 202 with the run view in queued.

  • The run ID, evx_ and 64 hexadecimal digits, derives from the project, environment, module, kind and key, so one key always names one run.
  • The same key and body replay the original 202 bytes with Roye-Replayed: true, even after the rubric revision expired or the model left the catalog. A changed body is idempotency_conflict.
  • Never resend with a new key: it starts a second run. After a lost response, recover the admission.
  • inputDigest is the operation digest of the body without its key, so runs of the same body share it.
Start a run
POST /v1/evaluations/runs
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

# The plan request plus an idempotencyKey; transcript and context as in the plan request.
{
  "idempotencyKey": "debate-run-1",
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 2
  },
  "profile": {
    "id": "conversation-rubric",
    "revision": "1"
  },
  "model": "provider/judge-model",
  "transcript": {…},
  "target": {
    "speakerIds": [
      "student"
    ]
  },
  "context": {…},
  "outputLanguage": "ko"
}
202 response
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "queued",
  "terminalReason": null,
  "rubric": {
    "id": "evr_55cb3e93643989b563ca29e2560ee818",
    "revision": 2,
    "digest": "ef082615ef1e4dad2c490de4fc1cb4f1b172ab1bdffbcac037e299e35b978c1e"
  },
  "profile": {
    "id": "conversation-rubric",
    "revision": "1"
  },
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": null,
  "plan": {
    "callCount": 3,
    "argumentMapCalls": 1,
    "criterionCalls": 2,
    "feedbackCalls": 0
  },
  "qualification": {
    "state": "unqualified"
  },
  "criteria": [],
  "executionSettled": false,
  "meteringSettled": false,
  "accounting": "reserved",
  "createdAt": 1793000120000
}

Run states and results

GET /v1/evaluations/runs/{runId} returns the run view. With waitMs it answers when the run is terminal or the wait ends, whichever comes first; a wait cancels nothing. Times are in limits.

StatusMeaning
queuedAdmitted, waiting to start. Ends expired when not started in time.
runningRoye makes the planned calls until they finish or the run deadline passes.
cancellingA cancel or purge reached a running run. Unstarted calls never start, calls in flight are interrupted, and it ends cancelled once they settle.
completedResults committed. terminalReason completed, or deadline when the deadline cut off unfinished calls.
failedNo results. all_criteria_failed, deadline, or authority_revoked when the project's authority no longer holds.
cancelledNo results. caller_cancelled, run_purged or project_deleted.
expiredNo results. Never started; terminalReason deadline.
  • A run with an applicable model criterion ends failed (all_criteria_failed) when every such criterion failed. Otherwise it ends completed, failed criteria included.
  • Only a completed run commits results: criteria in rubric order, critical when the rubric has a critical criterion, overall for weighted_mean, and outputDigest, the SHA-256 of the committed result. Other runs have empty criteria and a null outputDigest.
  • A criterion's status is scored, computed (a metric value), cannot_judge, not_applicable (with a reason), insufficient_evidence or failed.
  • A scored criterion has its level, a score from 0 for the lowest level to 1 for the highest, verified quotes and a rationale in outputLanguage. A quote's start and end are code-point offsets into the turn's original text, end exclusive; match is exact or normalized.
  • A failed criterion has a content-free diagnostic whose cause is call, argument_map or deadline.
  • At the run deadline, calls in flight are interrupted and every unfinished criterion fails with cause deadline, plus uncertain: true when supplier work may have happened. The run then ends by the first rule with terminalReason deadline; a run whose calls all finished in time keeps completed or all_criteria_failed.
Wait for the result
GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9?waitMs=30000
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200 once the run is terminal, or when the wait ends with the run still queued or running.
200 response
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "completed",
  "terminalReason": "completed",
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": "35bd780826cfef881c8f0206c281e407c0b8d08ad83c93fb0447b3bc57c8b1f3",
  "plan": {…},
  "qualification": {…},
  "criteria": [
    {
      "id": "rebuttal",
      "kind": "ordinal",
      "status": "scored",
      "level": "3",
      "score": 0.75,
      "evidenceRejected": 0,
      "rationale": "복장이 아니어도 동아리와 과제로 자신을 표현할 수 있다는 이유를 들어 반론에 답했습니다. 설문 결과는 비용에 관한 근거라서 자기표현 주장을 직접 뒷받침하지는 않습니다.",
      "evidence": [
        {
          "id": "rebuttal-1",
          "turnId": "t4",
          "speaker": "student",
          "quote": "Students still express themselves through clubs and their work",
          "start": 0,
          "end": 62,
          "match": "exact"
        }
      ]
    },
    {
      "id": "stayedOnMotion",
      "kind": "binary",
      "status": "scored",
      "level": "pass",
      "score": 1,
      "evidenceRejected": 0,
      "rationale": "모든 주장이 교복 의무화라는 논제를 다룹니다.",
      "evidence": [
        {
          "id": "stayedOnMotion-1",
          "turnId": "t2",
          "speaker": "student",
          "quote": "Uniforms remove pressure to buy expensive clothes",
          "start": 0,
          "end": 49,
          "match": "exact"
        }
      ]
    },
    {
      "id": "talkShare",
      "kind": "metric",
      "status": "computed",
      "value": 0.6819672131147541
    }
  ],
  "overall": {
    "score": 0.88,
    "basis": [
      "rebuttal",
      "stayedOnMotion"
    ]
  },
  "executionSettled": true,
  "meteringSettled": true,
  "accounting": "settled",
  "createdAt": 1793000120000,
  "startedAt": 1793000120800,
  "finishedAt": 1793000139300
}

Follow a run

GET /v1/evaluations/runs/{runId}/events returns up to 64 events in order, with the page's cursor, executionSettled and meteringSettled. Send ?cursor= to read the events after it. An empty page keeps the cursor, so poll again with the same one.

TypeCarries
run.statusstatus.
run.stagestage, argument_map or criterion, when the stage's first call starts.
run.criterioncriterionId and status.

Every event has eventId, module evaluations, a source (domain evaluations, type run, the run ID), causalOperationId (the admission, cancel or purge that caused it, or null), at and cursor. Events never carry transcript, quote or rationale text; read the run for its results.

Read run events
GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/events
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200. No transcript, quote or rationale text.
200 response
{
  "events": [
    {
      "eventId": "eve_fb3596f6c7ed10dc0ba55da056e5f6ac",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
      "at": 1793000120000,
      "cursor": "1",
      "type": "run.status",
      "status": "queued"
    },
    {
      "eventId": "eve_1dcc68d09392ebe9b1f2fe4203938a4d",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000120800,
      "cursor": "2",
      "type": "run.status",
      "status": "running"
    },
    {
      "eventId": "eve_a5457692fd8d371d2ccce92cc410e637",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000120850,
      "cursor": "3",
      "type": "run.stage",
      "stage": "argument_map"
    },
    {
      "eventId": "eve_6af22a74a9592a41b4b183fe1f49e2cc",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000131200,
      "cursor": "4",
      "type": "run.stage",
      "stage": "criterion"
    },
    {
      "eventId": "eve_dce74eab7face32aeee11b2a1c46e0a0",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000137400,
      "cursor": "5",
      "type": "run.criterion",
      "criterionId": "rebuttal",
      "status": "scored"
    },
    {
      "eventId": "eve_23553e56c4b78ff811ff9b6318e5da44",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000139100,
      "cursor": "6",
      "type": "run.criterion",
      "criterionId": "stayedOnMotion",
      "status": "scored"
    },
    {
      "eventId": "eve_07df47e205eac7990c5b8b0d57e94358",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000139300,
      "cursor": "7",
      "type": "run.criterion",
      "criterionId": "talkShare",
      "status": "computed"
    },
    {
      "eventId": "eve_cac7bd0abc286b044166ac6793da8978",
      "module": "evaluations",
      "source": {
        "domain": "evaluations",
        "type": "run",
        "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
      },
      "causalOperationId": null,
      "at": 1793000139300,
      "cursor": "8",
      "type": "run.status",
      "status": "completed"
    }
  ],
  "cursor": "8",
  "executionSettled": true,
  "meteringSettled": true
}
Read the next page
GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/events?cursor=8
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200 with no new events: { "events": [], "cursor": "8", ... }. Poll again with the same cursor.

Cancel and purge

Both routes take a body with only an idempotencyKey, with the runId as target. In every state they answer 200 with the content-free run view: criterion status, level, score and diagnostic, without evidence or rationales. Read results with GET /runs/{runId}.

  • Cancel: a queued run ends cancelled at once. A running run moves to cancelling and ends cancelled (caller_cancelled) once calls in flight settle. A cancelled run commits no result; cancelling a terminal run changes nothing.
  • Purge: a run that is not terminal is cancelled first (run_purged). Purge then removes the request, transcript, context, evidence and rationales and sets purgedAt. The run's identity, status, digests, content-free results and billing record remain. An export made before the purge stops serving the run's content too.
  • Without a purge, the same run content expires 30 days after admission. A completed run then keeps the content-free view.
  • Project export includes unexpired run content and the content-free view of every run, however old; that item's expiresAt is the export's own expiry. Project deletion removes the content.
Cancel a running run
# A second run, admitted with the key debate-run-2, is running.
POST /v1/evaluations/runs/evx_e92efcbcec15071a513864d5b3038eeb3ed3e2fae21fd377bfe082d9c6666afd/cancel
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-run-2-cancel"
}

# 200. Calls in flight are interrupted; the run ends cancelled (caller_cancelled) once they settle,
# with empty criteria and a null outputDigest. A queued run would be cancelled at once.
{
  "id": "evx_e92efcbcec15071a513864d5b3038eeb3ed3e2fae21fd377bfe082d9c6666afd",
  "operation": {
    "operationId": "op_f63a683299c17f99fe6f4f972795224c",
    "idempotencyKey": "debate-run-2",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "cancelling",
  "terminalReason": null,
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": null,
  "plan": {…},
  "qualification": {…},
  "criteria": [],
  "executionSettled": false,
  "meteringSettled": false,
  "accounting": "reserved",
  "createdAt": 1793000200000,
  "startedAt": 1793000200600
}
Cancel a completed run
POST /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/cancel
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-run-1-cancel"
}

# 200. The completed run is unchanged. A cancel answers the content-free view in every state:
# criterion results without evidence or rationales. Read the results with GET /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9.
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "completed",
  "terminalReason": "completed",
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": "35bd780826cfef881c8f0206c281e407c0b8d08ad83c93fb0447b3bc57c8b1f3",
  "plan": {…},
  "qualification": {…},
  "criteria": [
    {
      "id": "rebuttal",
      "kind": "ordinal",
      "status": "scored",
      "level": "3",
      "score": 0.75,
      "evidenceRejected": 0
    },
    {
      "id": "stayedOnMotion",
      "kind": "binary",
      "status": "scored",
      "level": "pass",
      "score": 1,
      "evidenceRejected": 0
    },
    {
      "id": "talkShare",
      "kind": "metric",
      "status": "computed",
      "value": 0.6819672131147541
    }
  ],
  "overall": {
    "score": 0.88,
    "basis": [
      "rebuttal",
      "stayedOnMotion"
    ]
  },
  "executionSettled": true,
  "meteringSettled": true,
  "accounting": "settled",
  "createdAt": 1793000120000,
  "startedAt": 1793000120800,
  "finishedAt": 1793000139300
}
Purge a run
POST /v1/evaluations/runs/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9/purge
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{
  "idempotencyKey": "debate-run-1-purge"
}

# 200. The content-free view above with purgedAt; the request, transcript, evidence and rationales are gone.
{
  "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9",
  "operation": {
    "operationId": "op_c38dcfde2cd1d8af04be1c1e25068f2a",
    "idempotencyKey": "debate-run-1",
    "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908"
  },
  "status": "completed",
  "terminalReason": "completed",
  "rubric": {…},
  "profile": {…},
  "model": "provider/judge-model",
  "contractVersion": 1,
  "serviceRevision": "roye-2026-10-27.1",
  "inputDigest": "2c92039278f263e3af3247fa55f00691876f806cd5f656568bc4e0916b365908",
  "outputDigest": "35bd780826cfef881c8f0206c281e407c0b8d08ad83c93fb0447b3bc57c8b1f3",
  "plan": {…},
  "qualification": {…},
  "criteria": […],
  "overall": {
    "score": 0.88,
    "basis": [
      "rebuttal",
      "stayedOnMotion"
    ]
  },
  "executionSettled": true,
  "meteringSettled": true,
  "accounting": "settled",
  "createdAt": 1793000120000,
  "startedAt": 1793000120800,
  "finishedAt": 1793000139300,
  "purgedAt": 1793000400000
}

Endpoints

Routes are under /v1/evaluations and take the backend key. Writes take an idempotencyKey scoped to project, environment, module, kind and target.

RoutePurposeAnswer
GET /profiles/conversation-rubric/revisions/1Read the catalog entry.200. Others are 404 not_found.
POST /rubricsCreate a rubric.201 { rubric, revision }. Kind rubrics.create, target {}.
POST /rubrics/{rubricId}/revisionsRevise a rubric.201 { rubric, revision }. Kind rubrics.revise, target { rubricId }.
GET /rubrics/{rubricId}Read a rubric.200 with latestRevision.
GET /rubrics/{rubricId}/revisions/{revision}Read a revision.200 with digest and body.
POST /plansDisclose a plan.200 { callCount, calls }, with maximumMicros and policyRevision once the tariff is ready. No key.
POST /runsStart a run.202 with the run view in queued. Kind runs.create, target {}.
GET /runs/{runId}Read a run.200 with the run view. waitMs 0 to 30,000 waits for a terminal state.
GET /runs/{runId}/eventsRead run events.200 { events, cursor, executionSettled, meteringSettled }.
POST /runs/{runId}/cancelCancel a run.200 with the content-free run view. Kind runs.cancel, target { runId }.
POST /runs/{runId}/purgePurge a run's content.200 with the run view and purgedAt. Kind runs.purge, target { runId }.

Limits

Nothing is truncated: a bound is payload_limit, except the argument-map bound. Output token bounds cap Roye's calls and never refuse. Project policy may be stricter.

BoundValue
Rubric, transcript64 KiB and 256 KiB of canonical JSON.
Request body1 MiB.
Planned calls64 per run.
Output tokens4,096 per criterion call, 8,192 for argument map and feedback.
Argument map200 turns. Beyond that, criteria using it are not applicable (transcript_too_long_for_map) and get no call.
Events per page64.
waitMs0 to 30,000 ms.
Queued runEnds expired when not started within 24 hours.
Run deadline1,200,000 ms (20 minutes) after the run starts.

Errors

Errors use the shared envelope. A field error names a JSON Pointer in error.field, such as /criteria/0/levels/2/id, and an unknown field its own, such as /criteria/0/notes. A whole-body bound names none. Run admission also uses the platform's quota, funding and availability codes.

CodeHTTPCause and what to do
invalid_request400An unknown, missing, duplicate, undeclared or out-of-bounds value, such as fewer than 2 levels, a reserved level ID or a lone surrogate. Also a query parameter the route does not take, waitMs outside 0 to 30,000 or an event cursor ahead of the run.
payload_limit413Above a limit or a count, such as more than 11 levels. A body above 1 MiB is refused unparsed.
unsupported_capability400Not served, a profile revision not in capabilities, or an unlisted model.
not_found404A missing, out-of-scope, expired or erased rubric or revision, on reads and when a plan or new run names it; an unknown profile revision; a missing or out-of-scope run; an unserved module.
revision_conflict409Stale expectedRevision. Read the rubric, resend with a new key.
idempotency_conflict409The key was used with another body. Recover the original.
not_ready409Run admission while the project's tariff or funding is not ready. Nothing is admitted or reserved.
budget_exhausted409Run admission when available credit cannot fund the plan's maximumMicros. Nothing is admitted or reserved.
contract_version_unsupported400Use contract 1.

Recovery

Keys are 1 to 80 letters, digits, - or _. Persist the key with the body before sending, and never retry an uncertain write with a new key. The same key and body replay the original with Roye-Replayed: true. Rubric writes finish in their request; a run goes on after admission, so stop it with cancel. Reads, plans and events need no key.

SituationWhat to do
Lost write responseResend with the same key, or call POST /v1/operations/recover with module evaluations, the kind and target from endpoints and the original key.
Lost run admissionRecover it the same way, kind runs.create and target {}. A new key starts a second run.
Recovery answers not_foundNothing was committed. Resend with the same key.
Same key, other workUse a new key.
Recover a lost response
POST /v1/operations/recover
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Content-Type: application/json

{
  "module": "evaluations",
  "kind": "rubrics.revise",
  "target": {
    "rubricId": "evr_55cb3e93643989b563ca29e2560ee818"
  },
  "idempotencyKey": "debate-rubric-2"
}

# 200: the operation record of the original revise.
# 404 not_found: nothing was committed under the key, so send the same request with the same key.

# A lost run admission is recovered the same way, never with a new key.
{
  "module": "evaluations",
  "kind": "runs.create",
  "target": {},
  "idempotencyKey": "debate-run-1"
}

Roye drives every admitted run to a terminal state after every client disconnects. You never keep a connection open, repair a queue or finish a run; reads, waits and events only observe.

  • A call whose supplier work is recorded or may have happened is never issued again. After a lost worker the run resumes, and that call's criterion fails with uncertain: true.
  • A local error that stops a call before it reaches the supplier ends only that attempt. Calls in flight finish, and Roye sends the stopped call on a later attempt, until the run deadline.

Usage and charges

Admission reserves the plan's maximumMicros, and the run is charged when it ends. The view's accounting is reserved until then, settled once the charge is final, or uncertain while a call's usage stays uncertain. Replays, reads, waits and events never charge, and neither do profile reads, rubric writes and plans.

OutcomeCharge
completedMeasured usage of every call it made, failed criteria included.
failed, expiredNothing.
cancelledOnly the trusted consumed units of calls that already ran.
Usage that stays uncertainReleased under the 72-hour goodwill policy (Funding and usage).

GET /v1/billing/usage lists the run's usage row with source module evaluations, type run and the run ID. A row whose plan has more than eight calls carries no pricing; the plan already lists each call's bounds.

Read a run's bill with GET /v1/billing/usage/evaluations/RUN_ID under billing contract 1, or with roye.billing.usage.getEvaluationRun. A scoped key needs billing. A run that does not exist, belongs to another project or environment, or planned no model call has no bill and answers not_found, which never means a zero charge. Purge keeps the bill.

Read a run's bill
GET /v1/billing/usage/evaluations/evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9
Authorization: Bearer ryk_…
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

# 200 under billing contract 1, once the completed run above has settled. The charge is illustrative. pricing, the frozen
# disclosure of each call's bound, is left out here; a run of more than eight calls has none. original is deprecated:
# read source.
{
  "id": "use_00025e433b7eccc13f3d83666d484d8179dc32a4df74a599041dd3df3c3a7d2d",
  "scope": {
    "projectId": "my-project",
    "environment": "development"
  },
  "source": {
    "module": "evaluations",
    "type": "run",
    "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
  },
  "original": {
    "namespace": "royeEvaluationRuns",
    "id": "evx_036a6a09f240127a8e9b55f47ef92fda729a5ec3d57676fd4a456e171f55bdd9"
  },
  "currency": "USD",
  "maximumMicros": 742500,
  "heldMicros": 0,
  "chargedMicros": 3150,
  "releasedMicros": 739350,
  "state": "settled",
  "reason": "completed",
  "companyId": null,
  "createdAt": 1793000120000,
  "releaseAt": 1793259320000,
  "settledAt": 1793000139300
}

# A run that planned no model call, a run ID that was never admitted and another project's run: 404 not_found.

SDK client

roye.evaluations in @roye-ai/client calls the routes above as they are. The package is private and not published. Each method sends one request to one route and selects contract 1.

  • The methods are profiles.get; rubrics.create, revise, get and getRevision; plans.create; and runs.create, get, wait, events, cancel and purge. roye.billing.usage.getEvaluationRun reads a run's bill.
  • Rubric and run writes need an idempotencyKey: pass a key you stored, or inject an intent store. With a store the SDK stores the key before sending, and after a restart roye.intents.resume() recovers the original by that key, never with a new one.
  • The SDK checks your input before sending. It retries only transient failures and rate_limited, with the same key and body.
  • runs.wait takes waitMs from 0 to 30,000, default 30,000. Pass runs.events the previous page's cursor.
  • A value the preview adds comes back as a string, without an error, in a run view, event page or catalog entry. Run statuses, terminal reasons, criterion kinds, not-applicable reasons and stages are examples. A criterion result's status and an event's type take only known values, because they decide the record's fields, and so do the catalog's samples, which you send back in a request.
  • A stored revision body parses as a request body, but near the 64 KiB bound resend the body you sent (Rubric body). The SDK reads revision bodies strictly, so a criterion kind or metric it does not define fails to parse.
SDK client
import { EphemeralIntentStore, Roye } from '@roye-ai/client';

// EphemeralIntentStore is for tests and scripts; give production code your own durable IntentStore.
const roye = new Roye({ baseURL, token: () => backendKey, projectId, environment: 'development', intents: new EphemeralIntentStore() });

const entry = await roye.evaluations.profiles.get('conversation-rubric', '1');
// Keep the body you sent: the stored revision body holds the defaults and can exceed 64 KiB near the bound.
const body = { name: 'Debate practice', criteria, aggregate };
const created = await roye.evaluations.rubrics.create({ idempotencyKey: 'debate-rubric-1', ...body });
const { rubric, revision } = await roye.evaluations.rubrics.revise(created.rubric.id, {
  idempotencyKey: 'debate-rubric-2', expectedRevision: created.rubric.latestRevision,
  ...body, name: 'Debate practice (v2)',
});
const request = {
  rubric: { id: rubric.id, revision: revision.revision },
  profile: { id: 'conversation-rubric', revision: '1' },
  model: 'provider/judge-model', // one of entry.models
  transcript, target: { speakerIds: ['student'] }, context: { text: motion }, outputLanguage: 'ko',
};
const plan = await roye.evaluations.plans.create(request); // reserves and charges nothing
const run = await roye.evaluations.runs.create({ idempotencyKey: 'debate-run-1', ...request });
const done = await roye.evaluations.runs.wait(run.id, { waitMs: 30000 });
const page = await roye.evaluations.runs.events(run.id);
const later = await roye.evaluations.runs.events(run.id, { cursor: page.cursor });
const bill = await roye.billing.usage.getEvaluationRun(run.id);
await roye.evaluations.runs.purge(run.id, { idempotencyKey: 'debate-run-1-purge' });

// After a restart, with the same durable store: recovers unresolved writes by their keys, never with a new key.
const resumed = await roye.intents.resume();