Skip to main content

Evals API

This page documents the 102 gateway endpoints tagged evals in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
POST/eval/datasets/from_logsBuild an eval dataset from logged production requests
GET/eval/logs/previewPreview the logged requests a dataset would be built from
POST/eval/datasets/from_sessionsBuild an eval dataset from whole logged conversations
GET/eval/sessions/previewPreview the conversations a dataset would be built from
GET/eval/datasetsList eval datasets
POST/eval/datasetsCreate an eval dataset from items you send
POST/eval/datasets/importCreate an eval dataset from a JSONL or CSV file
GET/eval/datasets/{dataset_id}Read one eval dataset with its items
PATCH/eval/datasets/{dataset_id}Rename an eval dataset or replace its items
DELETE/eval/datasets/{dataset_id}Delete an eval dataset with its runs
GET/eval/datasets/{dataset_id}/versionsList the versions of an eval dataset
GET/eval/datasets/{dataset_id}/versions/{version}Read one version of an eval dataset
DELETE/eval/datasets/{dataset_id}/versions/{version}Delete an earlier version of an eval dataset
GET/eval/scorersList the scorers an eval run can use
GET/eval/runsList eval runs
POST/eval/runsStart an eval run of a dataset across models
GET/eval/runs/{run_id}Read one eval run and its summary
DELETE/eval/runs/{run_id}Delete a finished eval run with its results
GET/eval/runs/{run_id}/resultsList the results of an eval run
GET/eval/runs/{run_id}/results/{result_id}Read one eval result with its transcript
POST/eval/runs/{run_id}/cancelCancel an eval run
GET/eval/shadowList shadow eval verdicts as eval results
POST/eval/compareCompare eval runs item by item
POST/eval/playgroundTry a prompt on a few dataset items
GET/eval/runs/{run_id}/verdictGet the pass or fail verdict of an eval run
GET/eval/redteam/catalogueList the vulnerabilities and attacks a red team run can use
GET/eval/redteam/runsList red team runs
POST/eval/redteam/runsStart a red team run against a model
GET/eval/redteam/runs/{run_id}Read a red team run and its summary
DELETE/eval/redteam/runs/{run_id}Delete a finished red team run
GET/eval/redteam/runs/{run_id}/resultsList the attacks of a red team run with their outcomes
POST/eval/redteam/runs/{run_id}/cancelCancel a red team run
POST/eval/datasets/synthesizeGenerate an eval dataset from your own documents
GET/eval/schedulesList eval schedules
POST/eval/schedulesCreate an eval schedule
GET/eval/schedules/{schedule_id}Get an eval schedule
PATCH/eval/schedules/{schedule_id}Change an eval schedule
DELETE/eval/schedules/{schedule_id}Delete an eval schedule
POST/eval/schedules/{schedule_id}/run_nowRun an eval schedule now
GET/eval/remote_scorersList remote scorers
POST/eval/remote_scorersRegister a remote scorer
GET/eval/remote_scorers/{scorer_id}Read one remote scorer
PATCH/eval/remote_scorers/{scorer_id}Change a remote scorer
DELETE/eval/remote_scorers/{scorer_id}Delete a remote scorer
POST/eval/remote_scorers/{scorer_id}/rotate_secretRotate a remote scorer's signing secret
POST/eval/scorers/testTry a scorer on one output
GET/eval/online/rulesList the online scoring rules
POST/eval/online/rulesCreate an online scoring rule
GET/eval/online/rules/{rule_id}Read one online scoring rule
PATCH/eval/online/rules/{rule_id}Change an online scoring rule
DELETE/eval/online/rules/{rule_id}Delete an online scoring rule
GET/eval/online/scoresList the scores online rules gave to requests
GET/eval/online/summarySummarize online scores per hour or day
POST/eval/online/rules/testTry an online scoring rule before saving it
POST/eval/online/rules/cost_previewPreview what an online scoring rule will cost
GET/eval/online/rules/{rule_id}/samplingExplain whether a rule samples a request
GET/eval/online/rules/{rule_id}/versionsList the saved versions of an online scoring rule
POST/eval/online/rules/{rule_id}/versions/{version}/restoreRestore a saved version of an online scoring rule
GET/eval/online/rules/{rule_id}/agreementCompare an online scoring rule with human reviewers
GET/eval/online/rules/{rule_id}/backfillsList the backfills of an online scoring rule
POST/eval/online/rules/{rule_id}/backfillsScore past traffic with an online scoring rule
GET/eval/online/rules/{rule_id}/backfills/{backfill_id}Read one backfill of an online scoring rule
POST/eval/online/rules/{rule_id}/backfills/{backfill_id}/cancelCancel a running backfill
GET/eval/review/queuesList review queues
POST/eval/review/queuesCreate a review queue
GET/eval/review/queues/{queue_id}Get a review queue
PATCH/eval/review/queues/{queue_id}Change a review queue
DELETE/eval/review/queues/{queue_id}Delete a review queue
POST/eval/review/queues/{queue_id}/from_runAdd eval run results to a review queue
POST/eval/review/queues/{queue_id}/from_logsAdd sampled production responses to a review queue
POST/eval/review/queues/{queue_id}/from_shadowAdd shadowed requests to a review queue
GET/eval/review/queues/{queue_id}/itemsList the items of a review queue
GET/eval/review/queues/{queue_id}/items/{review_item_id}Get a review item with its labels
DELETE/eval/review/queues/{queue_id}/items/{review_item_id}Remove an item from a review queue
GET/eval/review/queues/{queue_id}/calibrationCompare human labels with automated scorers
POST/eval/review/queues/{queue_id}/to_datasetExport decided review items as a golden dataset
GET/eval/review/assignedList the review queues assigned to you
POST/eval/review/queues/{queue_id}/nextClaim the next item to review
GET/eval/review/items/{review_item_id}Get an item you are reviewing
POST/eval/review/items/{review_item_id}/labelLabel a review item
POST/eval/review/items/{review_item_id}/skipSkip a review item
GET/eval/review/queues/{queue_id}/boardShow who is working on a review queue
POST/eval/review/queues/{queue_id}/assignAssign review items to reviewers
POST/eval/review/queues/{queue_id}/unassignTake review items back from reviewers
GET/eval/review/queues/{queue_id}/agreementShow how far reviewers agree with each other
GET/eval/feedbackList end-user ratings
POST/eval/feedbackRate a gateway request on behalf of an end user
DELETE/eval/feedback/{feedback_id}Delete one end-user rating
GET/eval/runs/{run_id}/itemsRead the items a submitted eval run needs answered
POST/eval/runs/{run_id}/outputsSubmit answers to a submitted eval run
POST/eval/runs/{run_id}/finishFinish a submitted eval run
GET/v1/evalsList the evaluations at the model provider
POST/v1/evalsCreate an evaluation at the model provider
GET/v1/evals/{eval_id}Read one evaluation
POST/v1/evals/{eval_id}Rename an evaluation or change its labels
DELETE/v1/evals/{eval_id}Delete an evaluation
POST/v1/evals/{eval_id}/cancelCancel an evaluation
GET/v1/evals/{eval_id}/runsList the runs of an evaluation
POST/v1/evals/{eval_id}/runsStart a run of an evaluation
GET/v1/evals/{eval_id}/runs/{run_id}Read one run and its results
POST/v1/evals/{eval_id}/runs/{run_id}Cancel a run
DELETE/v1/evals/{eval_id}/runs/{run_id}Delete a run

Endpoints​

POST /eval/datasets/from_logs​

Build an eval dataset from logged production requests

Turns real traffic into a test set. The gateway samples spend log rows that match the filters, and each chosen row becomes one item whose input is the logged chat transcript, whose expected answer is the logged response when include_outputs_as_expected is set, and whose metadata records the request id, model, team, tags, cost and latency. Only rows that kept their bodies qualify, which needs general_settings.store_prompts_in_spend_logs. A caller acting for a team or an organization only ever draws that team's or organization's rows. Only proxy admins may call it. Answers 400 when no row matches or none kept its body.

Request body (application/json, schema NewEvalDatasetFromLogs):

FieldTypeRequiredDescription
namestringYesThe dataset name, unique within your team or organization
descriptionstring or nullNoWhat the dataset tests
filtersLogFiltersYesWhich logged requests to draw from
sampleLogSampleYesHow many requests to take and how to pick them
include_outputs_as_expectedbooleanNoUse the logged answer as each item's expected answer

Example request:

curl -X POST "http://localhost:4000/eval/datasets/from_logs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "support-traffic-november",
"description": "Sampled support bot requests",
"filters": {
"start": "2026-11-01T00:00:00Z",
"end": "2026-11-20T00:00:00Z",
"models": [
"gpt-5.5"
],
"teams": [
"team-support"
],
"status": "success"
},
"sample": {
"size": 50,
"strategy": "random"
},
"include_outputs_as_expected": true
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

GET /eval/logs/preview​

Preview the logged requests a dataset would be built from

Shows the newest spend log rows the filters select, how many rows match in total, and whether any of them kept the request and response bodies a dataset needs, so you can check the filters before building a dataset from logs. Proxy admins and proxy admin viewers may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
limitqueryintegerNo
startquerystringYes
endquerystringYes
modelsqueryarray of string or nullNo
tagsqueryarray of string or nullNo
teamsqueryarray of string or nullNo
keysqueryarray of string or nullNo
statusqueryenum: "success", "failure", "all"No
min_tokensqueryinteger or nullNo
max_tokensqueryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/eval/logs/preview?start=string&end=string" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json LogPreview
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
itemsarray of LogPreviewItemYesThe newest matching requests
totalintegerYesHow many requests match the filters
bodies_availablebooleanYesWhether any of them kept the prompt and answer a dataset needs

POST /eval/datasets/from_sessions​

Build an eval dataset from whole logged conversations

Turns whole conversations into a test set, one item per session: the transcript of its request with the longest history (tool calls and tool results included) plus the logged reply. Sessions come from spend logs by session id or log filters, or from Lens by trace id. Redacted sessions are skipped, and so are sessions whose tool arguments or results were truncated when logged unless include_truncated is set. Each item keeps the data policy of the request it came from, and a caller acting for a team or an organization reads only its own spend logs. Only proxy admins may call it. Answers 400 when no session qualifies and 501 when Lens is asked for but not configured.

Request body (application/json, schema NewSessionsDataset):

FieldTypeRequiredDescription
namestringYesThe dataset name, unique within your team or organization
descriptionstring or nullNoWhat the dataset tests
sourceSpendLogSessionSource or LensTraceSourceYesWhere the conversations come from, spend logs or Lens traces
include_truncatedbooleanNoKeep sessions whose tool calls were cut short when logged

Example request:

curl -X POST "http://localhost:4000/eval/datasets/from_sessions" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "billing-conversations",
"description": "Multi-turn billing chats with tool calls",
"source": {
"type": "spend_logs",
"session_ids": [
"sess-7d2a9c4e",
"sess-1b3d5f7a"
]
},
"include_truncated": false
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail
501The evals extra is not installed on this gatewayapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

GET /eval/sessions/preview​

Preview the conversations a dataset would be built from

Shows at most 50 sessions the way from_sessions would turn them into items, with turn and tool call counts, how many were skipped and why, and whether logged bodies and Lens are available. Send session_id, or start and end, for spend logs, or trace_id for Lens. It reveals the same bodies as the log preview. Proxy admins and proxy admin viewers may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
sourcequeryenum: "spend_logs", "lens"No
session_idqueryarray of string or nullNo
trace_idqueryarray of string or nullNo
startquerystring or nullNo
endquerystring or nullNo
include_truncatedquerybooleanNo
limitqueryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/sessions/preview" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json SessionPreview
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail
501The evals extra is not installed on this gatewayapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
sessionsarray of SessionPreviewRowYesThe sessions that would become items
skipped_redactedintegerYesSessions skipped because their bodies were redacted
skipped_truncatedintegerYesSessions skipped because tool calls were cut short
skipped_unreadableintegerYesSessions skipped because their logs could not be read
skipped_policyintegerYesSessions skipped because their data policy could not be read
bodies_availablebooleanYesWhether the gateway stores prompts and answers in spend logs
lens_availablebooleanYesWhether Lens traces can be read on this gateway

GET /eval/datasets​

List eval datasets

Lists the eval datasets the caller can see, newest first, without their items, however large they are. A caller acting for a team or an organization sees only its own. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/datasets" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json EvalDatasetListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
datasetsarray of EvalDatasetSummaryYesThe datasets on this page, newest first
totalintegerYesHow many rows match in all
pageintegerYesThe page number, counting from 1
page_sizeintegerYesHow many rows a page holds

POST /eval/datasets​

Create an eval dataset from items you send

Creates a named test set from the items in the request body. Each item is a question or conversation, optionally with the answer you expect. Items without an item_id get one, and repeated ids are refused with 400. Proxy admins and custom roles with write access may call it.

Request body (application/json, schema NewEvalDataset):

FieldTypeRequiredDescription
namestringYesThe dataset name, unique within your team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of NewEvalItemYesThe questions, each with the answer you expect if any

Example request:

curl -X POST "http://localhost:4000/eval/datasets" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "refund-questions",
"description": "Support questions about refunds with the answer we expect",
"items": [
{
"input": "How long do refunds take?",
"expected": "Refunds are issued within 14 days."
},
{
"input": "Can I get a refund on a gift card?",
"expected": "Gift cards cannot be refunded."
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

POST /eval/datasets/import​

Create an eval dataset from a JSONL or CSV file

Creates a named test set from the text of a file you already have: JSONL with one item object per line, or CSV with an input column and optional expected, context, retrieval_context and metadata columns. Rows that do not parse are refused with 400. Proxy admins and custom roles with write access may call it.

Request body (application/json, schema ImportEvalDataset):

FieldTypeRequiredDescription
namestringYesThe dataset name, unique within your team or organization
descriptionstring or nullNoWhat the dataset tests
formatenum: "jsonl", "csv"Yesjsonl for one item object per line, csv for a header row and one item per row
contentstringYesThe text of the file

Example request:

curl -X POST "http://localhost:4000/eval/datasets/import" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "refund-questions",
"description": "Imported from the support FAQ",
"format": "csv",
"content": "input,expected\nHow long do refunds take?,Refunds are issued within 14 days.\n"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

GET /eval/datasets/{dataset_id}​

Read one eval dataset with its items

Returns one eval dataset with its current items. Answers 404 when the id is unknown or outside the caller's team or organization. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
dataset_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/datasets/dataset_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

PATCH /eval/datasets/{dataset_id}​

Rename an eval dataset or replace its items

Renames a dataset, changes its description, or replaces its items wholesale. New items become the dataset's next version unless they are identical to the current ones, and earlier runs keep their results and the version they ran. Proxy admins and custom roles with write access may call it, and the change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
dataset_idpathstringYes

Request body (application/json, schema UpdateEvalDataset):

FieldTypeRequiredDescription
namestring or nullNoA new name for the dataset
descriptionstring or nullNoA new description
itemsarray of NewEvalItem or nullNoItems that replace every current item and become the next version

Example request:

curl -X PATCH "http://localhost:4000/eval/datasets/dataset_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"description": "Refund questions, updated for the new 30 day policy",
"items": [
{
"item_id": "refund-time",
"input": "How long do refunds take?",
"expected": "Refunds are issued within 30 days."
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

DELETE /eval/datasets/{dataset_id}​

Delete an eval dataset with its runs

Deletes a dataset with every run and result of it. Refused with 409 while a run of it is still going. Proxy admins and custom roles with write access may call it, and the change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
dataset_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/datasets/dataset_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

GET /eval/datasets/{dataset_id}/versions​

List the versions of an eval dataset

Lists every saved version of a dataset, newest first, without the items. A new version is saved each time the items are replaced, so earlier runs can still be traced to the exact items they used. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
dataset_idpathstringYes
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/datasets/dataset_id-123/versions" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json EvalDatasetVersionListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
versionsarray of EvalDatasetVersionSummaryYesEvery saved version, newest first
current_versionintegerYesThe version the dataset uses now

GET /eval/datasets/{dataset_id}/versions/{version}​

Read one version of an eval dataset

Returns one saved version of a dataset with the items it held at that time. Answers 404 when the dataset or the version does not exist. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
dataset_idpathstringYes
versionpathintegerYes

Example request:

curl -X GET "http://localhost:4000/eval/datasets/dataset_id-123/versions/version-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalDatasetVersion
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe dataset this version belongs to
versionintegerYesThe version number, counting up from 1
item_countintegerYesHow many items the version holds
items_digeststringYesA SHA-256 fingerprint of the items, equal for identical items
created_bystring or nullNoWho saved this version
created_atstring or nullNoWhen this version was saved
itemsarray of EvalItemYesThe items this version held

DELETE /eval/datasets/{dataset_id}/versions/{version}​

Delete an earlier version of an eval dataset

Deletes an earlier version of a dataset for good, for example one holding an item that must not be kept. The current version cannot be deleted, so replace the items first, and neither can a version a run still in progress is pinned to. Finished runs of it keep their results, and comparing them reads the current items. Proxy admins and custom roles with write access may call it, and the change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
dataset_idpathstringYes
versionpathintegerYes

Example request:

curl -X DELETE "http://localhost:4000/eval/datasets/dataset_id-123/versions/version-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json EvalDatasetVersionSummary
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe dataset this version belongs to
versionintegerYesThe version number, counting up from 1
item_countintegerYesHow many items the version holds
items_digeststringYesA SHA-256 fingerprint of the items, equal for identical items
created_bystring or nullNoWho saved this version
created_atstring or nullNoWhen this version was saved

GET /eval/scorers​

List the scorers an eval run can use

Lists every scorer type a run can grade answers with, with its config fields and the item fields it needs, so the Admin UI can build the run form. Scorers that need a component this gateway does not have are listed with available false. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Example request:

curl -X GET "http://localhost:4000/eval/scorers" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json array of ScorerDescription
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
500The database is not connectedapplication/json ErrorDetail

GET /eval/runs​

List eval runs

Lists eval runs newest first, narrowed by dataset, status, the schedule that started them, the prompt they rendered, their mode, their baseline key or the git ref CI reported. Only the caller's own runs are listed. Proxy admins, proxy admin viewers, custom roles with read access and ci keys may call it, and a ci key lists only the runs it started. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
dataset_idquerystring or nullNo
statusqueryenum: "pending", "running", "completed", "failed", "cancelled" or nullNo
schedule_idquerystring or nullNo
prompt_idquerystring or nullNo
modequeryenum: "single", "replay", "agent", "logged" or nullNo
baseline_keyquerystring or nullNo
git_refquerystring or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/runs" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json EvalRunListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
runsarray of Spanway_EvalRunTableYesThe runs on this page, newest first
totalintegerYesHow many rows match in all
pageintegerYesThe page number, counting from 1
page_sizeintegerYesHow many rows a page holds

POST /eval/runs​

Start an eval run of a dataset across models

Tests one dataset against one or more models and grades every answer with the chosen scorer, so you can compare models or prompts before changing what production uses. The run starts in the background and comes back pending, then moves to running and completed. Every model, the judge included, must be served by the gateway, and a prompt_id must name a managed prompt the gateway has loaded. Transcript scorers need replay, agent or logged mode, agent mode needs tools on every item, and replay and logged need conversations. A remote scorer must be registered and enabled, and the run is pinned to its current revision.

Proxy admins and ci keys may start runs. A ci key's run must use an allowlisted dataset and models the key and its team may call, its key and team budgets must have room, and its completions count against the key's rate limits. The run is a trusted baseline only when an admin or a baseline writer ci key started it on an allowed ref and no pull request.

Request body (application/json, schema NewEvalRun):

FieldTypeRequiredDescription
dataset_idstring or nullNoThe dataset to test, or name it with dataset_name instead
dataset_namestring or nullNoThe name of the dataset to test, or send dataset_id instead
dataset_versioninteger or nullNoAn earlier version of the items to test, the current one by default
outputs_sourceenum: "dataset", "submitted"Nodataset to call models, submitted to score outputs you send in later
modelsarray of stringNoThe models to send every item to, as named on the gateway
scorerobjectYesHow to grade answers, with type and settings, see the scorers list
namestring or nullNoA label for the run
concurrencyintegerNoHow many items are sent at once, from 1 to 32
prompt_idstring or nullNoA managed prompt to render every item through
prompt_versioninteger or nullNoThe version of that prompt, the current one by default
prompt_environmentstring or nullNoThe environment to take that version from, the one requests get by default when unset
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
max_stepsinteger or nullNoThe most agent steps per item in agent mode, up to 25
templatePromptTemplate or nullNoA system prompt or user template applied to every item
paramsInferenceParams or nullNoSampling settings sent with every call
baseline_keystring or nullNoThe key CI compares runs under, letters, digits, dot, dash and underscore
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
ciCiContext or nullNoDetails about the CI job that started the run

Example request:

curl -X POST "http://localhost:4000/eval/runs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dataset_name": "refund-questions",
"models": [
"gpt-5.5",
"claude-sonnet-5-5"
],
"scorer": {
"type": "contains",
"substrings": [
"14 days"
]
},
"name": "refund answers, two models",
"concurrency": 4
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalRunTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
429A ci key already has as many runs in progress as EVAL_CI_MAX_ACTIVE_RUNS allowsapplication/json ErrorDetail
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the eval run
dataset_idstringYesThe dataset the run tests
dataset_versioninteger or nullNoThe dataset version the run is pinned to
namestring or nullNoA label for the run
modelsarray of stringYesThe models the run sends every item to
scorerobjectYesHow answers are graded, with the scorer type and its settings
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryEvalSummary or nullNoThe per model totals, once the run completed
errorstring or nullNoWhy the run failed
schedule_idstring or nullNoThe schedule that started the run
prompt_idstring or nullNoThe managed prompt the run rendered
prompt_versioninteger or nullNoThe version of the managed prompt the run used
prompt_environmentstring or nullNoThe prompt environment the version was taken from
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
outputs_sourceenum: "dataset", "submitted"Nodataset when the gateway calls models, submitted when outputs are sent in
max_stepsinteger or nullNoThe most agent steps per item in agent mode
templateStoredPromptTemplate or nullNoThe prompt template applied to every item
paramsStoredInferenceParams or nullNoThe sampling settings sent with every call
items_digeststring or nullNoThe fingerprint of the items the run tested
baseline_keystring or nullNoThe key CI compares runs under
git_refstring or nullNoThe git branch or tag CI reported
git_shastring or nullNoThe git commit CI reported
ciCiContext or nullNoDetails CI sent about the pipeline that started the run
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
trusted_baselinebooleanNoWhether later CI runs may be compared with this one
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the first item was sent
completed_atstring or nullNoWhen the run finished

GET /eval/runs/{run_id}​

Read one eval run and its summary

Returns one eval run with its status and, once it completed, the per model summary of scores, pass rate, latency and cost and the best model. Proxy admins, proxy admin viewers, custom roles with read access and ci keys may call it, and a ci key sees only the runs it started. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalRunTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the eval run
dataset_idstringYesThe dataset the run tests
dataset_versioninteger or nullNoThe dataset version the run is pinned to
namestring or nullNoA label for the run
modelsarray of stringYesThe models the run sends every item to
scorerobjectYesHow answers are graded, with the scorer type and its settings
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryEvalSummary or nullNoThe per model totals, once the run completed
errorstring or nullNoWhy the run failed
schedule_idstring or nullNoThe schedule that started the run
prompt_idstring or nullNoThe managed prompt the run rendered
prompt_versioninteger or nullNoThe version of the managed prompt the run used
prompt_environmentstring or nullNoThe prompt environment the version was taken from
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
outputs_sourceenum: "dataset", "submitted"Nodataset when the gateway calls models, submitted when outputs are sent in
max_stepsinteger or nullNoThe most agent steps per item in agent mode
templateStoredPromptTemplate or nullNoThe prompt template applied to every item
paramsStoredInferenceParams or nullNoThe sampling settings sent with every call
items_digeststring or nullNoThe fingerprint of the items the run tested
baseline_keystring or nullNoThe key CI compares runs under
git_refstring or nullNoThe git branch or tag CI reported
git_shastring or nullNoThe git commit CI reported
ciCiContext or nullNoDetails CI sent about the pipeline that started the run
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
trusted_baselinebooleanNoWhether later CI runs may be compared with this one
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the first item was sent
completed_atstring or nullNoWhen the run finished

DELETE /eval/runs/{run_id}​

Delete a finished eval run with its results

Deletes a finished eval run with its results. A run still going must be cancelled first. Proxy admins and custom roles with write access may call it, and the change is written to the audit log.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalRunTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the eval run
dataset_idstringYesThe dataset the run tests
dataset_versioninteger or nullNoThe dataset version the run is pinned to
namestring or nullNoA label for the run
modelsarray of stringYesThe models the run sends every item to
scorerobjectYesHow answers are graded, with the scorer type and its settings
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryEvalSummary or nullNoThe per model totals, once the run completed
errorstring or nullNoWhy the run failed
schedule_idstring or nullNoThe schedule that started the run
prompt_idstring or nullNoThe managed prompt the run rendered
prompt_versioninteger or nullNoThe version of the managed prompt the run used
prompt_environmentstring or nullNoThe prompt environment the version was taken from
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
outputs_sourceenum: "dataset", "submitted"Nodataset when the gateway calls models, submitted when outputs are sent in
max_stepsinteger or nullNoThe most agent steps per item in agent mode
templateStoredPromptTemplate or nullNoThe prompt template applied to every item
paramsStoredInferenceParams or nullNoThe sampling settings sent with every call
items_digeststring or nullNoThe fingerprint of the items the run tested
baseline_keystring or nullNoThe key CI compares runs under
git_refstring or nullNoThe git branch or tag CI reported
git_shastring or nullNoThe git commit CI reported
ciCiContext or nullNoDetails CI sent about the pipeline that started the run
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
trusted_baselinebooleanNoWhether later CI runs may be compared with this one
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the first item was sent
completed_atstring or nullNoWhen the run finished

GET /eval/runs/{run_id}/results​

List the results of an eval run

Lists the graded answers of one run, oldest first, one row per item and model with the output, score, pass or fail, latency and cost. Filter by model or by passed. Proxy admins, proxy admin viewers, custom roles with read access and ci keys may call it, and a ci key reads only the runs it started. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes
modelquerystring or nullNo
passedqueryboolean or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/runs/run_id-123/results" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json EvalResultListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
resultsarray of Spanway_EvalResultTableYesThe results on this page, oldest first
totalintegerYesHow many rows match in all
pageintegerYesThe page number, counting from 1
page_sizeintegerYesHow many rows a page holds

GET /eval/runs/{run_id}/results/{result_id}​

Read one eval result with its transcript

Returns one graded answer with the full conversation transcript its replay, agent or logged run stored, and why the conversation stopped. Result lists never carry the transcript. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes
result_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/runs/run_id-123/results/result_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json EvalResultDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
resultSpanway_EvalResultTableYesThe graded answer
transcriptarray of SystemMessage or UserMessage or AssistantMessage or ToolMessage or nullYesThe whole conversation for replay, agent and logged runs
stopenum: "finished", "max_steps", "logged" or nullYesWhy the conversation ended
trace_idstring or nullYesThe trace of the conversation, when tracing is on

POST /eval/runs/{run_id}/cancel​

Cancel an eval run

Stops a pending or running eval run before its next item. Results already stored stay. Proxy admins, custom roles with write access and ci keys may call it, a ci key cancels only the runs it started, and the cancellation is written to the audit log.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Request body (application/json, schema CancelEvalRun):

FieldTypeRequiredDescription
reasonstring or nullNoWhy the run is stopped, kept in the audit log

Example request:

curl -X POST "http://localhost:4000/eval/runs/run_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Started against the wrong dataset"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_EvalRunTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the eval run
dataset_idstringYesThe dataset the run tests
dataset_versioninteger or nullNoThe dataset version the run is pinned to
namestring or nullNoA label for the run
modelsarray of stringYesThe models the run sends every item to
scorerobjectYesHow answers are graded, with the scorer type and its settings
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryEvalSummary or nullNoThe per model totals, once the run completed
errorstring or nullNoWhy the run failed
schedule_idstring or nullNoThe schedule that started the run
prompt_idstring or nullNoThe managed prompt the run rendered
prompt_versioninteger or nullNoThe version of the managed prompt the run used
prompt_environmentstring or nullNoThe prompt environment the version was taken from
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
outputs_sourceenum: "dataset", "submitted"Nodataset when the gateway calls models, submitted when outputs are sent in
max_stepsinteger or nullNoThe most agent steps per item in agent mode
templateStoredPromptTemplate or nullNoThe prompt template applied to every item
paramsStoredInferenceParams or nullNoThe sampling settings sent with every call
items_digeststring or nullNoThe fingerprint of the items the run tested
baseline_keystring or nullNoThe key CI compares runs under
git_refstring or nullNoThe git branch or tag CI reported
git_shastring or nullNoThe git commit CI reported
ciCiContext or nullNoDetails CI sent about the pipeline that started the run
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
trusted_baselinebooleanNoWhether later CI runs may be compared with this one
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the first item was sent
completed_atstring or nullNoWhen the run finished

GET /eval/shadow​

List shadow eval verdicts as eval results

Lists the verdicts that shadow eval jobs stored, newest first, in the shape of eval results. A shadow eval sends a copy of live requests to a second model and has a judge compare the answers, so you can see whether a cheaper or newer model holds up on real traffic. The model filter matches either the shadow or the live model. Proxy admins, proxy admin viewers and custom roles with read access may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
modelquerystring or nullNo
startquerystring or nullNo
endquerystring or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/shadow" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json ShadowEvalListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
resultsarray of ShadowEvalResultYesThe verdicts on this page, newest first
totalintegerYesHow many rows match in all
pageintegerYesThe page number, counting from 1
page_sizeintegerYesHow many rows a page holds

POST /eval/compare​

Compare eval runs item by item

Put two to four eval runs of one dataset side by side to see which items got better or worse, for example before promoting a new prompt version. Proxy admins and admin viewers may call it, and nothing is stored. Arm 0 is the baseline. Each arm's change on an item is decided in order by a missing result (incomparable), an error on one side only (new_error, error_fixed), a pass flip whatever the score did (pass_to_fail, fail_to_pass), then a score move larger than tolerance. Totals cover every item whatever the filter and page, and outputs are cut to a 4000 character preview. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#comparing-runs)

Request body (application/json, schema CompareEvalRuns):

FieldTypeRequiredDescription
armsarray of CompareArmYesTwo to four run and model pairs, the first is the baseline
tolerancenumberNoHow far a score may move before it counts as a change
filterenum: "all", "regressed", "improved", "changed", "unchanged", "incomparable"NoWhich items to list, the totals always cover every item
sortenum: "dataset", "score_delta"NoList items in dataset order or by score change
pageintegerNoThe page of items, from 1
page_sizeintegerNoItems per page, at most 50

Example request:

curl -X POST "http://localhost:4000/eval/compare" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"arms": [
{
"run_id": "run-a",
"model": "gpt-5.5"
},
{
"run_id": "run-b",
"model": "gpt-5.5"
}
],
"filter": "regressed",
"tolerance": 0.05
}'

Responses:

StatusDescriptionBody
200The arms side by side with per-arm totalsapplication/json EvalComparison
400The arms cover different datasets, models or modes, or hold too many results togetherapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
429A ci key already has as many runs in progress as EVAL_CI_MAX_ACTIVE_RUNS allowsapplication/json ErrorDetail
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe dataset every arm ran on
armsarray of ComparisonArmYesEach arm's run settings and summary, the baseline first
totalsarray of ArmTotalsYesHow each arm differs from the baseline over every item
warningsarray of ScorersDiffer or ArmsDatasetDiffer or DatasetChanged or RunIncomplete or OrphanItemsYesReasons the comparison may mislead
itemsarray of ComparedItemYesThis page of items with each arm's result
total_itemsintegerYesItems in the dataset
filtered_itemsintegerYesItems the filter keeps
pageintegerYesThe page returned
page_sizeintegerYesItems per page

POST /eval/playground​

Try a prompt on a few dataset items

Try a system prompt and an {{input}} user template, or a managed prompt, on a few dataset items before starting a full run. Only proxy admins may call it. At most 20 items and 3 models (30 pairs) run while the request waits. Nothing is stored, but every completion is routed, billed to the caller and labelled spanway_eval playground in its spend log metadata. Pairs still running after 45 seconds come back as timed out errors, and a proxy instance runs at most 4 playground requests at once, answering 429 beyond that. A random sample returns its seed so sending it again draws the same items. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#playground)

Request body (application/json, schema RunEvalPlayground):

FieldTypeRequiredDescription
dataset_idstringYesThe dataset to draw items from
sampleListedItems or FirstItems or RandomItemsYesWhich items to try: listed ids, the first few or a random few
modelsarray of stringYesOne to three models to try
templatePromptTemplate or nullNoA system prompt and a user template
prompt_idstring or nullNoA managed prompt to use instead
prompt_versioninteger or nullNoThe managed prompt version, latest if unset
paramsInferenceParams or nullNoSampling settings such as temperature
scorerobject or nullNoA scorer to grade the outputs with
concurrencyintegerNoHow many pairs run at once, at most 8

Example request:

curl -X POST "http://localhost:4000/eval/playground" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"dataset_id": "6c1f0d2e-8a4b-4c3d-9e7f-1a2b3c4d5e6f",
"sample": {
"mode": "random",
"size": 5
},
"models": [
"gpt-5.5",
"claude-sonnet-5-5"
],
"template": {
"system": "Answer in one word.",
"user_template": "Question: {{input}}"
},
"params": {
"temperature": 0
},
"scorer": {
"type": "contains",
"substrings": [
"Paris"
]
}
}'

Responses:

StatusDescriptionBody
200The outputs, scores and the first rendered promptapplication/json EvalPlaygroundResponse
400The sample, models, template or scorer do not fit the playgroundapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
429Four playground requests are running on this instance alreadyapplication/json ErrorDetail
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
seedinteger or nullYesThe random sample's seed, send it again to draw the same items
item_idsarray of stringYesThe items that were tried
rendered_exampleRenderedExampleYesThe first item's messages as the first model got them
resultsarray of PlaygroundResultYesOne result per item and model pair
summaryEvalSummary or nullYesPer-model scores, when a scorer was sent
timed_outbooleanYesWhether some pairs ran past 45 seconds

GET /eval/runs/{run_id}/verdict​

Get the pass or fail verdict of an eval run

Tells you whether an eval run passed its quality gate, for example before a CI job lets a prompt or model change merge. Each threshold of the run's gate is checked per model and compared with a baseline run: the baseline_run_id you pass, else the one the gate names, else the newest trusted completed run with the same baseline_key on the gate's branch (refs/heads/main by default) that finished before this run started. For a run a CI key started, the automatic baseline comes from the same key or its team, so every reader sees the verdict the CI job saw.

While the run is still going the conclusion is pending and no results are read. The answer carries a ready to post markdown report; report_detail=summary leaves item ids and the run link out of it, for public repositories. Reading changes nothing and reads only scores, never model outputs.

Any key that may read evals can call it, and a CI key may only name runs it can see. Needs an Enterprise license with evals.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes
baseline_run_idquerystring or nullNo
report_detailqueryenum: "full", "summary"No

Example request:

curl -X GET "http://localhost:4000/eval/runs/run_id-123/verdict" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The run's verdict against its gate and baselineapplication/json EvalVerdict
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe eval run the verdict is for.
statusenum: "pending", "running", "completed", "failed", "cancelled"YesWhere the run is: pending, running, completed, failed or cancelled.
conclusionenum: "pending", "passed", "failed", "neutral", "error"Yespending, passed, failed, neutral or error, as described above.
reasonstring or nullNoWhy the conclusion is error or neutral.
baseline_run_idstring or nullNoThe run this one was compared with, empty when there is no baseline.
baseline_reasonstring or nullNoHow the baseline was chosen or why there is none.
checksarray of GateCheckNoEvery threshold of the gate, checked per model.
modelsarray of ModelComparisonNoPer model figures beside the baseline run's.
regressed_itemsarray of RegressedItemNoThe first items that got worse than in the baseline, at most 50.
regressed_item_countintegerNoHow many items got worse in all.
markdownstringNoThe report as markdown, ready to post on a pull request.
run_urlstring or nullNoAn https link to the run in the Admin UI.

GET /eval/redteam/catalogue​

List the vulnerabilities and attacks a red team run can use

Every vulnerability with its types and every attack technique the proxy can run, so a form or a script can build a valid run request. available is false when the evals extra is not installed on the proxy.

Example request:

curl -X GET "http://localhost:4000/eval/redteam/catalogue" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json RedTeamCatalogue
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No object with that id is visible to the callerapplication/json ErrorDetail
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
availablebooleanYesAvailable
vulnerabilitiesarray of VulnerabilityDescriptionYesVulnerabilities
attacksarray of AttackDescriptionYesAttacks
frameworksarray of FrameworkPresetNoThe risk framework presets a run can start from

GET /eval/redteam/runs​

List red team runs

The caller's runs, newest first, optionally narrowed to one status. A team sees its own runs, an organization its own and its teams', and the operator every run.

Parameters:

NameInTypeRequiredDescription
statusqueryenum: "pending", "running", "completed", "failed", "cancelled" or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/redteam/runs" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json RedTeamRunListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
runsarray of Spanway_RedTeamRunTableYesThe runs on this page, newest first
totalintegerYesHow many rows match in all
pageintegerYesThe page number, counting from 1
page_sizeintegerYesHow many rows a page holds

POST /eval/redteam/runs​

Start a red team run against a model

Starts the assessment in the background and returns the run pending. The target, simulator and evaluator must all be served by the proxy, and the vulnerabilities and attacks must come from the catalogue. Instead of vulnerabilities and attacks, framework names a preset of the catalogue: a category framework such as mitre_atlas or eu_ai_act probes what its categories list, and a dataset framework such as aegis or beavertails sends the prompts you supply, up to 200. Once the run completes, its summary carries the pass rates, the framework categories and the CVSS score with its severity.

Request body (application/json, schema NewRedTeamRun):

FieldTypeRequiredDescription
target_modelstringYesThe model or alias to attack, as named on the gateway
frameworkenum: "owasp_top_10_llm", "owasp_top_10_agentic", "nist_ai_rmf", "mitre_atlas", "eu_ai_act" or enum: "aegis", "beavertails" or nullNoStart from a framework preset of the catalogue instead of naming vulnerabilities
vulnerabilitiesarray of RedTeamVulnerabilityNoThe vulnerabilities to test, see the red team catalogue, empty with a framework
attacksarray of stringNoThe attack methods to use, the catalogue default when empty
promptsarray of DatasetPromptNoThe dataset prompts a dataset framework such as aegis sends, up to 200, empty otherwise
simulator_modelstringYesThe model that writes the attacks
evaluation_modelstringYesThe model that judges whether each attack succeeded
attacks_per_vulnerabilityintegerNoHow many attacks to write per vulnerability type, from 1 to 20
target_purposestring or nullNoWhat the target is for, which helps write realistic attacks
namestring or nullNoA label for the run
max_concurrentintegerNoHow many attacks run at once, from 1 to 32

Example request:

curl -X POST "http://localhost:4000/eval/redteam/runs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "support bot, weekly",
"target_model": "support-bot",
"simulator_model": "claude-sonnet-latest",
"evaluation_model": "claude-opus-latest",
"vulnerabilities": [
{
"name": "PIILeakage",
"types": [
"direct_disclosure"
]
},
{
"name": "Bias",
"types": []
}
],
"attacks": [
"PromptInjection",
"LinearJailbreaking"
],
"attacks_per_vulnerability": 2,
"target_purpose": "A customer support assistant for an online bank",
"max_concurrent": 4
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_RedTeamRunTable
400The request names something the proxy lacksapplication/json RedTeamErrorResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No object with that id is visible to the callerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the red team run
namestring or nullNoA label for the run
target_modelstringYesThe model being attacked
simulator_modelstringYesThe model that writes the attacks
evaluation_modelstringYesThe model that judges whether each attack succeeded
vulnerabilitiesarray of RedTeamVulnerabilityYesThe vulnerabilities tested
attacksarray of stringYesThe attack methods used
attacks_per_vulnerabilityintegerYesHow many attacks are written for each vulnerability type
target_purposestring or nullNoWhat the target is for, which helps write realistic attacks
frameworkstring or nullNoThe risk framework preset the run started from, such as mitre_atlas or aegis
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryRedTeamSummary or nullNoThe results, once the run completed
errorstring or nullNoWhy the run failed
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the run started
completed_atstring or nullNoWhen the run finished

GET /eval/redteam/runs/{run_id}​

Read a red team run and its summary

The run with its summary once it completed: the overall pass rate, the pass rate by vulnerability type, by attack and by framework category, and the mean CVSS score of the evaluated attacks with its severity.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/redteam/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_RedTeamRunTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No run with this id is visible to the callerapplication/json RedTeamErrorResponse
422Validation Errorapplication/json HTTPValidationError
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the red team run
namestring or nullNoA label for the run
target_modelstringYesThe model being attacked
simulator_modelstringYesThe model that writes the attacks
evaluation_modelstringYesThe model that judges whether each attack succeeded
vulnerabilitiesarray of RedTeamVulnerabilityYesThe vulnerabilities tested
attacksarray of stringYesThe attack methods used
attacks_per_vulnerabilityintegerYesHow many attacks are written for each vulnerability type
target_purposestring or nullNoWhat the target is for, which helps write realistic attacks
frameworkstring or nullNoThe risk framework preset the run started from, such as mitre_atlas or aegis
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryRedTeamSummary or nullNoThe results, once the run completed
errorstring or nullNoWhy the run failed
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the run started
completed_atstring or nullNoWhen the run finished

DELETE /eval/redteam/runs/{run_id}​

Delete a finished red team run

Deletes a finished run with its results. A run still going must be cancelled first.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/redteam/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_RedTeamRunTable
400The run is still pending or running, cancel it firstapplication/json RedTeamErrorResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No run with this id is visible to the callerapplication/json RedTeamErrorResponse
422Validation Errorapplication/json HTTPValidationError
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the red team run
namestring or nullNoA label for the run
target_modelstringYesThe model being attacked
simulator_modelstringYesThe model that writes the attacks
evaluation_modelstringYesThe model that judges whether each attack succeeded
vulnerabilitiesarray of RedTeamVulnerabilityYesThe vulnerabilities tested
attacksarray of stringYesThe attack methods used
attacks_per_vulnerabilityintegerYesHow many attacks are written for each vulnerability type
target_purposestring or nullNoWhat the target is for, which helps write realistic attacks
frameworkstring or nullNoThe risk framework preset the run started from, such as mitre_atlas or aegis
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryRedTeamSummary or nullNoThe results, once the run completed
errorstring or nullNoWhy the run failed
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the run started
completed_atstring or nullNoWhen the run finished

GET /eval/redteam/runs/{run_id}/results​

List the attacks of a red team run with their outcomes

One row per attack: the prompt, the target's reply, the judge's score and reason, whether the target withstood it, and the CVSS score with its severity. Filters narrow by vulnerability, attack and outcome.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes
vulnerabilityquerystring or nullNo
attackquerystring or nullNo
passedqueryboolean or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/redteam/runs/run_id-123/results" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json RedTeamResultListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No run with this id is visible to the callerapplication/json RedTeamErrorResponse
422Validation Errorapplication/json HTTPValidationError
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
resultsarray of Spanway_RedTeamResultTableYesThe attack results on this page
totalintegerYesHow many rows match in all
pageintegerYesThe page number, counting from 1
page_sizeintegerYesHow many rows a page holds

POST /eval/redteam/runs/{run_id}/cancel​

Cancel a red team run

Stops a pending run before it starts, or keeps a running one from completing. The assessment runs as a single call, so a running one finishes its work but the run stays cancelled.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Request body (application/json, schema CancelEvalRun):

FieldTypeRequiredDescription
reasonstring or nullNoWhy the run is stopped, kept in the audit log

Example request:

curl -X POST "http://localhost:4000/eval/redteam/runs/run_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "Started against the wrong model alias"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_RedTeamRunTable
400The run is not in a state that allows this, only a pending or running run can be cancelledapplication/json RedTeamErrorResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks evals or the caller's role is refusedapplication/json RedTeamErrorResponse
404No run with this id is visible to the callerapplication/json RedTeamErrorResponse
422Validation Errorapplication/json HTTPValidationError
500The database is not connected, or the proxy has no models configuredapplication/json RedTeamErrorResponse

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the red team run
namestring or nullNoA label for the run
target_modelstringYesThe model being attacked
simulator_modelstringYesThe model that writes the attacks
evaluation_modelstringYesThe model that judges whether each attack succeeded
vulnerabilitiesarray of RedTeamVulnerabilityYesThe vulnerabilities tested
attacksarray of stringYesThe attack methods used
attacks_per_vulnerabilityintegerYesHow many attacks are written for each vulnerability type
target_purposestring or nullNoWhat the target is for, which helps write realistic attacks
frameworkstring or nullNoThe risk framework preset the run started from, such as mitre_atlas or aegis
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryRedTeamSummary or nullNoThe results, once the run completed
errorstring or nullNoWhy the run failed
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the run started
completed_atstring or nullNoWhen the run finished

POST /eval/datasets/synthesize​

Generate an eval dataset from your own documents

Builds a starter test set when you have documents but no example questions yet. For each passage in synthesis.contexts the model you name writes questions a user could ask, refines them, and, when include_expected_output is true, answers them from the passage. The result is saved as a new eval dataset in the caller's scope, recorded in the audit log without its items, and returned.

Proxy admins, or a custom role that grants eval writes, may call it. Every generation call runs through the gateway as the caller, so its budget, rate limits, guardrails and data policies apply. Only the text sent here is used, never logged traffic, and the request stops at a fixed number of model calls. An unknown model answers 400, a dataset name already in use answers 409, a gateway without the evals extra answers 501, and a generation the model could not finish answers 502.

Request body (application/json, schema NewSyntheticDataset):

FieldTypeRequiredDescription
namestringYesName
descriptionstring or nullNoDescription
synthesisSynthesisRequestYes

Example request:

curl -X POST "http://localhost:4000/eval/datasets/synthesize" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "refund-policy-starter",
"synthesis": {
"model": "my-model",
"contexts": [
[
"Refunds are issued within 14 days of a returned item reaching the warehouse."
]
],
"goldens_per_context": 2,
"scenario": "customers asking a support chatbot",
"task": "answer refund questions"
}
}'

Responses:

StatusDescriptionBody
200The new dataset with its generated itemsapplication/json Spanway_EvalDatasetTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail
501The evals extra is not installed on this gatewayapplication/json ErrorDetail
502The generation model failed or produced nothing usableapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe id of the dataset
namestringYesThe dataset name, unique within its team or organization
descriptionstring or nullNoWhat the dataset tests
itemsarray of EvalItemYesThe questions in the current version
item_countintegerYesHow many items the current version holds
owner_team_idstring or nullNoThe team that owns the dataset
owner_org_idstring or nullNoThe organization that owns the dataset
current_versionintegerNoThe version number of the current items
created_bystring or nullNoWho created the dataset
created_atstring or nullNoWhen the dataset was created
updated_atstring or nullNoWhen the dataset was last changed

GET /eval/schedules​

List eval schedules

Lists the eval schedules, newest first, a page at a time. Set enabled to see only enabled or only paused schedules. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only what its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scheduled-runs-and-regression-alerts)

Parameters:

NameInTypeRequiredDescription
enabledqueryboolean or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/schedules" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of schedules, newest firstapplication/json EvalScheduleListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
schedulesarray of Spanway_EvalScheduleTableYesSchedules
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size

POST /eval/schedules​

Create an eval schedule

Creates a schedule that runs an eval on a cron, so a quality drop shows up the morning after a provider ships a new model snapshot or someone edits a prompt. Each fire runs the models over a fixed dataset (dataset_id) or over a fresh sample of request logs (from_logs), exactly one of the two. Each completed run is compared with the previous one, and an eval_regression alert is raised when the pass rate drops by more than alert.regression_threshold or under alert.min_pass_rate. cron has five fields read in timezone. Before every fire the gateway checks that the creator is still a proxy admin and that the key it was created with is not deleted, blocked or expired, and skips the fire otherwise. The new schedule is written to the audit log. Only proxy admins may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scheduled-runs-and-regression-alerts)

Request body (application/json, schema NewEvalSchedule):

FieldTypeRequiredDescription
namestringYesName
dataset_idstring or nullNoDataset Id
from_logsFromLogsSpec or nullNo
modelsarray of stringYesModels
scorerobjectYesScorer
prompt_idstring or nullNoPrompt Id
prompt_versioninteger or nullNoPrompt Version
cronstringYesCron
timezonestringNoTimezone
enabledbooleanNoEnabled
alertEvalAlertNoWhen a scheduled run raises an eval_regression alert: pass rate under min_pass_rate, or down by more

Example request:

curl -X POST "http://localhost:4000/eval/schedules" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "nightly support regression",
"dataset_id": "ds_6c1f0b3a",
"models": [
"gpt-5.5",
"claude-sonnet-5-5"
],
"scorer": {
"type": "contains",
"substrings": [
"14 days"
]
},
"cron": "0 3 * * *",
"timezone": "Europe/Berlin",
"alert": {
"min_pass_rate": 0.85,
"regression_threshold": 0.05
}
}'

Responses:

StatusDescriptionBody
200The new schedule with its first run timeapplication/json Spanway_EvalScheduleTable
400Both or neither of dataset_id and from_logs were sent, or the cron or scorer is not validapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller is not a proxy admin, or the license lacks the evals featureapplication/json ErrorDetail
404The dataset does not existapplication/json ErrorDetail
409The owner already has a schedule with this nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
schedule_idstringYesSchedule Id
namestringYesName
dataset_idstring or nullNoDataset Id
from_logsFromLogsSpec or nullNo
modelsarray of stringYesModels
scorerobjectYesScorer
prompt_idstring or nullNoPrompt Id
prompt_versioninteger or nullNoPrompt Version
cronstringYesCron
timezonestringYesTimezone
enabledbooleanYesEnabled
last_run_idstring or nullNoLast Run Id
last_run_atstring or nullNoLast Run At
next_run_atstringYesNext Run At
alertEvalAlertYesWhen a scheduled run raises an eval_regression alert: pass rate under min_pass_rate, or down by more
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_bystring or nullNoCreated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

GET /eval/schedules/{schedule_id}​

Get an eval schedule

Shows one eval schedule with its cron, models, scorer, alert thresholds and when it ran last and runs next. It answers 404 when the id is unknown or outside the caller's scope. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only what its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scheduled-runs-and-regression-alerts)

Parameters:

NameInTypeRequiredDescription
schedule_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/schedules/schedule_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The scheduleapplication/json Spanway_EvalScheduleTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No schedule has this id within the caller's scopeapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
schedule_idstringYesSchedule Id
namestringYesName
dataset_idstring or nullNoDataset Id
from_logsFromLogsSpec or nullNo
modelsarray of stringYesModels
scorerobjectYesScorer
prompt_idstring or nullNoPrompt Id
prompt_versioninteger or nullNoPrompt Version
cronstringYesCron
timezonestringYesTimezone
enabledbooleanYesEnabled
last_run_idstring or nullNoLast Run Id
last_run_atstring or nullNoLast Run At
next_run_atstringYesNext Run At
alertEvalAlertYesWhen a scheduled run raises an eval_regression alert: pass rate under min_pass_rate, or down by more
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_bystring or nullNoCreated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

PATCH /eval/schedules/{schedule_id}​

Change an eval schedule

Changes only the fields you send. Sending dataset_id clears from_logs and the other way round. Sending prompt_id without prompt_version follows the prompt's latest version. A new cron, timezone or turning the schedule back on recomputes next_run_at from now. The change is written to the audit log with the values before and after. Only proxy admins may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scheduled-runs-and-regression-alerts)

Parameters:

NameInTypeRequiredDescription
schedule_idpathstringYes

Request body (application/json, schema UpdateEvalSchedule):

FieldTypeRequiredDescription
namestring or nullNoName
dataset_idstring or nullNoDataset Id
from_logsFromLogsSpec or nullNo
modelsarray of string or nullNoModels
scorerobject or nullNoScorer
prompt_idstring or nullNoPrompt Id
prompt_versioninteger or nullNoPrompt Version
cronstring or nullNoCron
timezonestring or nullNoTimezone
enabledboolean or nullNoEnabled
alertEvalAlert or nullNo

Example request:

curl -X PATCH "http://localhost:4000/eval/schedules/schedule_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cron": "0 4 * * 1-5",
"alert": {
"min_pass_rate": 0.9
}
}'

Responses:

StatusDescriptionBody
200The schedule as changedapplication/json Spanway_EvalScheduleTable
400Nothing was sent, or a field that cannot be null was nullapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller is not a proxy admin, or the license lacks the evals featureapplication/json ErrorDetail
404No schedule has this id within the caller's scopeapplication/json ErrorDetail
409The owner already has a schedule with this nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
schedule_idstringYesSchedule Id
namestringYesName
dataset_idstring or nullNoDataset Id
from_logsFromLogsSpec or nullNo
modelsarray of stringYesModels
scorerobjectYesScorer
prompt_idstring or nullNoPrompt Id
prompt_versioninteger or nullNoPrompt Version
cronstringYesCron
timezonestringYesTimezone
enabledbooleanYesEnabled
last_run_idstring or nullNoLast Run Id
last_run_atstring or nullNoLast Run At
next_run_atstringYesNext Run At
alertEvalAlertYesWhen a scheduled run raises an eval_regression alert: pass rate under min_pass_rate, or down by more
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_bystring or nullNoCreated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

DELETE /eval/schedules/{schedule_id}​

Delete an eval schedule

Deletes the schedule so it never fires again. The runs it already started are kept and still listed under its schedule_id. The deletion is written to the audit log. Only proxy admins may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scheduled-runs-and-regression-alerts)

Parameters:

NameInTypeRequiredDescription
schedule_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/schedules/schedule_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The deleted scheduleapplication/json Spanway_EvalScheduleTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller is not a proxy admin, or the license lacks the evals featureapplication/json ErrorDetail
404No schedule has this id within the caller's scopeapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
schedule_idstringYesSchedule Id
namestringYesName
dataset_idstring or nullNoDataset Id
from_logsFromLogsSpec or nullNo
modelsarray of stringYesModels
scorerobjectYesScorer
prompt_idstring or nullNoPrompt Id
prompt_versioninteger or nullNoPrompt Version
cronstringYesCron
timezonestringYesTimezone
enabledbooleanYesEnabled
last_run_idstring or nullNoLast Run Id
last_run_atstring or nullNoLast Run At
next_run_atstringYesNext Run At
alertEvalAlertYesWhen a scheduled run raises an eval_regression alert: pass rate under min_pass_rate, or down by more
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_bystring or nullNoCreated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

POST /eval/schedules/{schedule_id}/run_now​

Run an eval schedule now

Starts the schedule's run right away, exactly as the cron would, without moving next_run_at, for example to check a prompt change before the nightly run. When the run finishes it is compared with the previous completed run of the schedule. The run is written to the audit log. The run calls the models, so it costs money. Only proxy admins may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scheduled-runs-and-regression-alerts)

Parameters:

NameInTypeRequiredDescription
schedule_idpathstringYes

Request body (application/json, schema RunEvalScheduleNow):

FieldTypeRequiredDescription
namestring or nullNoName

Example request:

curl -X POST "http://localhost:4000/eval/schedules/schedule_id-123/run_now" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "manual check before release"
}'

Responses:

StatusDescriptionBody
200The run that startedapplication/json Spanway_EvalRunTable
400The run could not start, for example its dataset was deletedapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller is not a proxy admin, or the license lacks the evals featureapplication/json ErrorDetail
404No schedule has this id within the caller's scopeapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the eval run
dataset_idstringYesThe dataset the run tests
dataset_versioninteger or nullNoThe dataset version the run is pinned to
namestring or nullNoA label for the run
modelsarray of stringYesThe models the run sends every item to
scorerobjectYesHow answers are graded, with the scorer type and its settings
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryEvalSummary or nullNoThe per model totals, once the run completed
errorstring or nullNoWhy the run failed
schedule_idstring or nullNoThe schedule that started the run
prompt_idstring or nullNoThe managed prompt the run rendered
prompt_versioninteger or nullNoThe version of the managed prompt the run used
prompt_environmentstring or nullNoThe prompt environment the version was taken from
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
outputs_sourceenum: "dataset", "submitted"Nodataset when the gateway calls models, submitted when outputs are sent in
max_stepsinteger or nullNoThe most agent steps per item in agent mode
templateStoredPromptTemplate or nullNoThe prompt template applied to every item
paramsStoredInferenceParams or nullNoThe sampling settings sent with every call
items_digeststring or nullNoThe fingerprint of the items the run tested
baseline_keystring or nullNoThe key CI compares runs under
git_refstring or nullNoThe git branch or tag CI reported
git_shastring or nullNoThe git commit CI reported
ciCiContext or nullNoDetails CI sent about the pipeline that started the run
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
trusted_baselinebooleanNoWhether later CI runs may be compared with this one
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the first item was sent
completed_atstring or nullNoWhen the run finished

GET /eval/remote_scorers​

List remote scorers

List the registered remote scorers, newest first, optionally only enabled or disabled ones. Proxy admins and admin viewers may call it. Secrets are never shown and each url is cut to its scheme and host. Nothing changes. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#custom-scorers)

Parameters:

NameInTypeRequiredDescription
enabledqueryboolean or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/remote_scorers" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of scorersapplication/json RemoteScorerListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scorersarray of RemoteScorerViewYesScorers
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size

POST /eval/remote_scorers​

Register a remote scorer

Register a scorer that runs on your own service, so eval runs can call it to grade outputs. Only proxy admins may call it, and the registration is written to the audit log. The answer carries the signing secret the gateway signs each request with, shown this once. The url must be https and public unless its host is in user_url_allowed_hosts, and must be one of eval_remote_scorer_hosts when that is set. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#registering-a-scorer)

Request body (application/json, schema NewRemoteScorer):

FieldTypeRequiredDescription
namestringYesName
descriptionstring or nullNoDescription
urlstringYesUrl
timeout_msintegerNoTimeout Ms
max_retriesintegerNoMax Retries
max_concurrencyintegerNoMax Concurrency
requiresarray of enum: "expected", "context", "retrieval_context", "tools", "expected_tool_calls", "expected_outcome", "audio"NoRequires
self_hostedbooleanNoSelf Hosted

Example request:

curl -X POST "http://localhost:4000/eval/remote_scorers" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "support-grader",
"url": "https://scorer.internal.example.com/score",
"requires": [
"expected"
]
}'

Responses:

StatusDescriptionBody
200The scorer and its signing secret, shown this onceapplication/json RemoteScorerCreated
400The url breaks the network rules for scorersapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409A remote scorer has that name alreadyapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scorerRemoteScorerViewYesA remote scorer without its secrets. endpoint is the scheme and host only, since webhook paths often
signing_secretstringYesSigning Secret

GET /eval/remote_scorers/{scorer_id}​

Read one remote scorer

Read one remote scorer. Proxy admins and admin viewers may call it. Secrets are never shown and the url is cut to its scheme and host. Nothing changes. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#custom-scorers)

Parameters:

NameInTypeRequiredDescription
scorer_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/remote_scorers/scorer_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The scorer without its secretsapplication/json RemoteScorerView
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No remote scorer has that idapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scorer_idstringYesScorer Id
namestringYesName
descriptionstring or nullYesDescription
endpointstringYesEndpoint
timeout_msintegerYesTimeout Ms
max_retriesintegerYesMax Retries
max_concurrencyintegerYesMax Concurrency
requiresarray of enum: "expected", "context", "retrieval_context", "tools", "expected_tool_calls", "expected_outcome", "audio"YesRequires
secret_hintstringYesSecret Hint
rotatingbooleanYesRotating
previous_secret_expires_atstring or nullYesPrevious Secret Expires At
revisionintegerYesRevision
enabledbooleanYesEnabled
self_hostedbooleanNoSelf Hosted
created_bystring or nullYesCreated By
created_atstring or nullYesCreated At
updated_atstring or nullYesUpdated At

PATCH /eval/remote_scorers/{scorer_id}​

Change a remote scorer

Change a remote scorer, for example to raise its timeout or switch it off. Only proxy admins may call it, and the before and after are written to the audit log. Only the fields sent change. A new url is checked again, and a change to url, timeout_ms, max_retries, max_concurrency or requires starts a new revision: runs already started finish on the revision they resolved, new runs and schedule fires take the new one. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#custom-scorers)

Parameters:

NameInTypeRequiredDescription
scorer_idpathstringYes

Request body (application/json, schema UpdateRemoteScorer):

FieldTypeRequiredDescription
descriptionstring or nullNoDescription
urlstring or nullNoUrl
timeout_msinteger or nullNoTimeout Ms
max_retriesinteger or nullNoMax Retries
max_concurrencyinteger or nullNoMax Concurrency
requiresarray of enum: "expected", "context", "retrieval_context", "tools", "expected_tool_calls", "expected_outcome", "audio" or nullNoRequires
enabledboolean or nullNoEnabled
self_hostedboolean or nullNoSelf Hosted

Example request:

curl -X PATCH "http://localhost:4000/eval/remote_scorers/scorer_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeout_ms": 20000,
"enabled": true
}'

Responses:

StatusDescriptionBody
200The scorer after the changeapplication/json RemoteScorerView
400Nothing was sent, a field was set to null, or the new url breaks the network rulesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No remote scorer has that idapplication/json ErrorDetail
409An enabled online scoring rule uses the scorerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scorer_idstringYesScorer Id
namestringYesName
descriptionstring or nullYesDescription
endpointstringYesEndpoint
timeout_msintegerYesTimeout Ms
max_retriesintegerYesMax Retries
max_concurrencyintegerYesMax Concurrency
requiresarray of enum: "expected", "context", "retrieval_context", "tools", "expected_tool_calls", "expected_outcome", "audio"YesRequires
secret_hintstringYesSecret Hint
rotatingbooleanYesRotating
previous_secret_expires_atstring or nullYesPrevious Secret Expires At
revisionintegerYesRevision
enabledbooleanYesEnabled
self_hostedbooleanNoSelf Hosted
created_bystring or nullYesCreated By
created_atstring or nullYesCreated At
updated_atstring or nullYesUpdated At

DELETE /eval/remote_scorers/{scorer_id}​

Delete a remote scorer

Delete a remote scorer. Only proxy admins may call it, and the deletion is written to the audit log. It is refused while a pending or running run, an enabled schedule or an enabled online rule uses the scorer. Finished runs keep the scorer they stored, and running one of them again is refused. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#custom-scorers)

Parameters:

NameInTypeRequiredDescription
scorer_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/remote_scorers/scorer_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The scorer as it was before deletionapplication/json RemoteScorerView
400A pending or running run or an enabled schedule uses the scorerapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No remote scorer has that idapplication/json ErrorDetail
409An enabled online scoring rule uses the scorerapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scorer_idstringYesScorer Id
namestringYesName
descriptionstring or nullYesDescription
endpointstringYesEndpoint
timeout_msintegerYesTimeout Ms
max_retriesintegerYesMax Retries
max_concurrencyintegerYesMax Concurrency
requiresarray of enum: "expected", "context", "retrieval_context", "tools", "expected_tool_calls", "expected_outcome", "audio"YesRequires
secret_hintstringYesSecret Hint
rotatingbooleanYesRotating
previous_secret_expires_atstring or nullYesPrevious Secret Expires At
revisionintegerYesRevision
enabledbooleanYesEnabled
self_hostedbooleanNoSelf Hosted
created_bystring or nullYesCreated By
created_atstring or nullYesCreated At
updated_atstring or nullYesUpdated At

POST /eval/remote_scorers/{scorer_id}/rotate_secret​

Rotate a remote scorer's signing secret

Issue a new signing secret for a remote scorer, for example after the old one leaked. Only proxy admins may call it, and the rotation is written to the audit log. The new secret is shown this once. During the grace window every request carries a signature with each secret, so the receiver can switch over without dropping requests, and 0 drops the old secret at once. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#verifying-the-signature)

Parameters:

NameInTypeRequiredDescription
scorer_idpathstringYes

Request body (application/json, schema RotateRemoteScorerSecret):

FieldTypeRequiredDescription
grace_secondsintegerNoGrace Seconds

Example request:

curl -X POST "http://localhost:4000/eval/remote_scorers/scorer_id-123/rotate_secret" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"grace_seconds": 86400
}'

Responses:

StatusDescriptionBody
200The new signing secret, shown this onceapplication/json RemoteScorerCreated
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No remote scorer has that idapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scorerRemoteScorerViewYesA remote scorer without its secrets. endpoint is the scheme and host only, since webhook paths often
signing_secretstringYesSigning Secret

POST /eval/scorers/test​

Try a scorer on one output

Score one output with any scorer exactly as a run would, to check a scorer before using it in a run. Only proxy admins may call it, and nothing is stored. A judge model must be served by the proxy and a remote scorer must be registered and enabled. A scorer error comes back as a result, not a failure. Docs (https://docs.spanway.ai/docs/proxy/enterprise/evals#scorers)

Request body (application/json, schema DryRunScorer):

FieldTypeRequiredDescription
scorerobjectYesScorer
itemNewEvalItemYesAn item as the API or a file supplies it: the id is optional and minted when missing. The source data policy
modelstringYesModel
outputstringYesOutput

Example request:

curl -X POST "http://localhost:4000/eval/scorers/test" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scorer": {
"type": "exact_match"
},
"item": {
"input": "What is the capital of France?",
"expected": "Paris"
},
"model": "gpt-5.5",
"output": "Paris"
}'

Responses:

StatusDescriptionBody
200The score, or the scorer's error as a resultapplication/json ScorerTestScored or ScorerTestError
400The item or the scorer settings are not validapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

GET /eval/online/rules​

List the online scoring rules

Every rule, newest first, with today's funnel (UTC): how many matched requests were scored, skipped by sampling, shed under load, over budget or unscorable, and the judge spend, which lag the spend flush by a few seconds. Only a proxy admin or an admin viewer may call it, since rules cover every team. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
enabledqueryboolean or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/online/rules" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineEvalRuleListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rulesarray of OnlineEvalRuleViewYesRules
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size

POST /eval/online/rules​

Create an online scoring rule

A rule that scores sample_percentage percent of the live requests its match selects, after the response went back to the caller. Scorers must need only the request and its reply. A judged scorer bills its judge calls to you as online eval spend, up to daily_judge_budget a day. A remote scorer is pinned to its registered revision, must read nothing but the request and its reply, and gets each request only while its data policies and region allow it to leave the gateway or the scorer is self-hosted. Only a proxy admin may create a rule. The rule is written to the audit log and every gateway pod starts using it within 30 seconds.

Request body (application/json, schema NewOnlineEvalRule):

FieldTypeRequiredDescription
namestringYesName
descriptionstring or nullNoDescription
enabledbooleanNoEnabled
matchOnlineRuleMatchNoWhich requests a rule sees. Values within one field are alternatives, the fields must all match, and an
sample_percentagenumberYesSample Percentage
scorersarray of objectYesScorers
daily_judge_budgetnumber or nullNoDaily Judge Budget
daily_remote_call_capinteger or nullNoDaily Remote Call Cap
alertOnlineEvalAlertNoWhen a rule raises an eval_regression alert: a (model group, scorer) pass rate under min_pass_rate,

Example request:

curl -X POST "http://localhost:4000/eval/online/rules" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "support refunds",
"match": {
"tags": [
"support"
]
},
"sample_percentage": 5,
"scorers": [
{
"type": "contains",
"substrings": [
"refund"
]
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_OnlineEvalRuleTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesRule Id
namestringYesName
descriptionstring or nullNoDescription
enabledbooleanYesEnabled
model_groupsarray of stringNoModel Groups
team_idsarray of stringNoTeam Ids
keysarray of stringNoKeys
tagsarray of stringNoTags
sample_percentagenumberYesSample Percentage
scorersarray of objectYesScorers
daily_judge_budgetnumber or nullNoDaily Judge Budget
daily_remote_call_capinteger or nullNoDaily Remote Call Cap
alertOnlineEvalAlertNoWhen a rule raises an eval_regression alert: a (model group, scorer) pass rate under min_pass_rate,
last_alerted_atstring or nullNoLast Alerted At
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At
versionintegerNoVersion

GET /eval/online/rules/{rule_id}​

Read one online scoring rule

Return one online eval rule together with today's sampling counts. Only a proxy admin or an admin viewer may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/online/rules/rule_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineEvalRuleView
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
ruleSpanway_OnlineEvalRuleTableYes
todayOnlineFunnelYesWhat happened to the requests a rule matched on one UTC day. Counters lag one spend flush.

PATCH /eval/online/rules/{rule_id}​

Change an online scoring rule

Changes only the fields sent. scorers may only grow: send every existing scorer in its position with the same type (its config may change), then any new ones. Every change saves a new version of the rule, which can be restored later. Other pods pick the change up within 30 seconds. Only a proxy admin may call it. The before and after values are written to the audit log.

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes

Request body (application/json, schema UpdateOnlineEvalRule):

FieldTypeRequiredDescription
namestring or nullNoName
descriptionstring or nullNoDescription
enabledboolean or nullNoEnabled
matchOnlineRuleMatch or nullNo
sample_percentagenumber or nullNoSample Percentage
scorersarray of object or nullNoScorers
daily_judge_budgetnumber or nullNoDaily Judge Budget
daily_remote_call_capinteger or nullNoDaily Remote Call Cap
alertOnlineEvalAlert or nullNo

Example request:

curl -X PATCH "http://localhost:4000/eval/online/rules/rule_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": false,
"sample_percentage": 2
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_OnlineEvalRuleTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesRule Id
namestringYesName
descriptionstring or nullNoDescription
enabledbooleanYesEnabled
model_groupsarray of stringNoModel Groups
team_idsarray of stringNoTeam Ids
keysarray of stringNoKeys
tagsarray of stringNoTags
sample_percentagenumberYesSample Percentage
scorersarray of objectYesScorers
daily_judge_budgetnumber or nullNoDaily Judge Budget
daily_remote_call_capinteger or nullNoDaily Remote Call Cap
alertOnlineEvalAlertNoWhen a rule raises an eval_regression alert: a (model group, scorer) pass rate under min_pass_rate,
last_alerted_atstring or nullNoLast Alerted At
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At
versionintegerNoVersion

DELETE /eval/online/rules/{rule_id}​

Delete an online scoring rule

Deletes the rule and its funnel and answers with the rule as it was. Its scores stop being listed and are removed by score retention. Only a proxy admin may call it. The deletion is written to the audit log.

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/online/rules/rule_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_OnlineEvalRuleTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesRule Id
namestringYesName
descriptionstring or nullNoDescription
enabledbooleanYesEnabled
model_groupsarray of stringNoModel Groups
team_idsarray of stringNoTeam Ids
keysarray of stringNoKeys
tagsarray of stringNoTags
sample_percentagenumberYesSample Percentage
scorersarray of objectYesScorers
daily_judge_budgetnumber or nullNoDaily Judge Budget
daily_remote_call_capinteger or nullNoDaily Remote Call Cap
alertOnlineEvalAlertNoWhen a rule raises an eval_regression alert: a (model group, scorer) pass rate under min_pass_rate,
last_alerted_atstring or nullNoLast Alerted At
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At
versionintegerNoVersion

GET /eval/online/scores​

List the scores online rules gave to requests

Score rows newest first, for one request (the log drawer) or filtered. Rows of deleted rules are left out. A proxy admin or an admin viewer sees every score. Anyone else needs a role with evals.read and sees only the scores of their key's team, and an organization admin is refused. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
request_idquerystring or nullNo
rule_idquerystring or nullNo
model_groupquerystring or nullNo
scorer_indexqueryinteger or nullNo
passedqueryboolean or nullNo
startquerystring or nullNo
endquerystring or nullNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/online/scores" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineEvalScoreListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
scoresarray of Spanway_OnlineEvalScoreTableYesScores

GET /eval/online/summary​

Summarize online scores per hour or day

Mean score, pass rate, error count and judge cost per hour or day for every (rule, model group, scorer). The span is capped at 31 days, and at 7 days for hour buckets. Only a proxy admin or an admin viewer may call it. Nothing is changed.

Parameters:

NameInTypeRequiredDescription
startquerystringYes
endquerystringYes
bucketqueryenum: "hour", "day"No
rule_idquerystring or nullNo
model_groupquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/eval/online/summary?start=string&end=string" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineScoreSummary
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
startstringYesStart
endstringYesEnd
bucketenum: "hour", "day"YesBucket
seriesarray of OnlineScoreSeriesYesSeries

POST /eval/online/rules/test​

Try an online scoring rule before saving it

Runs every scorer of a rule on up to 10 samples exactly as live scoring would, and stores nothing, so you can see the scores, the judge's reasons and the judge cost before the rule goes live. Samples are logged requests (their stored prompt and answer), Lens traces, or questions and answers you type. For logged requests the answer also says whether the rule's match selects each one and, with rule_id, whether live sampling picks it. Judge calls are billed to your key and stop once the test spent max_judge_cost. Only proxy admins may call it, and each test is written to the audit log.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#test-a-rule-before-you-save-it)

Request body (application/json, schema OnlineRuleTest):

FieldTypeRequiredDescription
rule_idstring or nullNoA saved rule, to report its sampling decisions
matchOnlineRuleMatchNoWhich requests the rule would see
sample_percentagenumberNoThe share of matching requests scored
scorersarray of objectYesThe scorers to try, 1 to 5
samplesLoggedRequestSamples or LensTraceSamples or TypedSamplesYesWhat to score: logged requests, Lens traces or typed items
max_judge_costnumberNoStop judge calls once the test spent this much, in US dollars

Example request:

curl -X POST "http://localhost:4000/eval/online/rules/test" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"scorers": [
{
"type": "contains",
"substrings": [
"refund"
]
}
],
"samples": {
"type": "items",
"items": [
{
"input": "Can I get my money back?",
"output": "Yes, a refund is due."
}
]
}
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineRuleTestResult
400A scorer, the match or the samples cannot be usedapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule with that idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
samplesarray of OnlineTestSampleYesThe scored samples
skippedarray of OnlineTestSkippedYesSamples that could not be scored
judge_costnumberYesWhat the test's judge calls cost in all, in US dollars
judge_cost_per_requestnumber or nullYesMean judge cost per scored sample

POST /eval/online/rules/cost_preview​

Preview what an online scoring rule will cost

Estimates how many requests a rule would score each day and what its judge calls would cost, from the matching traffic of the last lookback_days days, so you can pick a sampling percentage and a daily budget before turning the rule on. The judge cost per request is the one you measured with a test when you send judge_cost_per_request, otherwise an estimate from the judge model's price and the traffic's mean token counts. Nothing is stored and no model is called. Only proxy admins may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#preview-the-cost)

Request body (application/json, schema OnlineCostPreviewRequest):

FieldTypeRequiredDescription
matchOnlineRuleMatchNoWhich requests the rule would see
sample_percentagenumberYesThe share of matching requests scored
scorersarray of objectYesThe scorers, 1 to 5
daily_judge_budgetnumber or nullNoThe daily judge spend cap
lookback_daysintegerNoDays of traffic to read
judge_cost_per_requestnumber or nullNoA measured judge cost per request, from a test

Example request:

curl -X POST "http://localhost:4000/eval/online/rules/cost_preview" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"match": {
"tags": [
"support"
]
},
"sample_percentage": 5,
"scorers": [
{
"type": "toxicity",
"judge_model": "gpt-5.5-mini"
}
],
"daily_judge_budget": 2,
"lookback_days": 7
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineCostPreview
400A scorer or the match cannot be usedapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
lookback_daysintegerYesDays of traffic read
matched_requestsintegerYesRequests the rule's match selected in that window
matched_per_daynumberYesMatching requests per day
sampled_per_daynumberYesExpected requests scored per day before the budget
avg_prompt_tokensnumberYesMean prompt tokens of the matching requests
avg_completion_tokensnumberYesMean answer tokens of the matching requests
scorersarray of OnlineScorerCostYesThe estimate per scorer
basisenum: "measured", "token_estimate", "unpriced", "no_judge"YesWhere the judge cost per request comes from
judge_cost_per_requestnumber or nullYesJudge cost per scored request
judge_cost_per_daynumber or nullYesExpected judge spend per day before the budget
daily_judge_budgetnumber or nullYesThe daily cap sent
budget_bindingbooleanYesWhether the budget would stop scoring before the day ends
scored_per_day_within_budgetnumber or nullYesRequests a day the budget pays for

GET /eval/online/rules/{rule_id}/sampling​

Explain whether a rule samples a request

Says whether a rule picks one request and why. Sampling hashes the rule id with the request id, so a request always gets the same answer on every gateway pod and on every retry, and a backfill with sampling on picks the same requests. Proxy admins and admin viewers may call it. Nothing is changed.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#check-why-a-request-was-or-was-not-scored)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes
request_idquerystringYes

Example request:

curl -X GET "http://localhost:4000/eval/online/rules/rule_id-123/sampling?request_id=request_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineSamplingCheck
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule with that idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesThe rule
request_idstringYesThe request
sample_percentagenumberYesThe rule's sampling percentage
positionnumberYesWhere the request falls from 0 to 100, sampled when below the percentage
sampledbooleanYesWhether sampling picks the request
foundbooleanYesWhether the request is in the spend logs
matchedboolean or nullYesWhether the rule's match selects it, empty when not found
scoredbooleanYesWhether the rule stored a score for it
explanationstringYesThe answer in plain words

GET /eval/online/rules/{rule_id}/versions​

List the saved versions of an online scoring rule

Every saved version of a rule, newest first. A version is saved each time the rule is created, changed or restored, with the judge model, criteria, thresholds, match, sampling and budgets it had. Proxy admins and admin viewers may call it. Nothing is changed.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#versions-and-restore)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/online/rules/rule_id-123/versions" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineRuleVersionList
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule with that idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesThe rule
current_versionintegerYesThe version the rule runs now
versionsarray of Spanway_OnlineEvalRuleVersionTableYesSaved versions, newest first

POST /eval/online/rules/{rule_id}/versions/{version}/restore​

Restore a saved version of an online scoring rule

Puts a saved version's settings back on the rule and saves that as a new version, so the restore itself can be undone. Scores are kept by scorer position, so scorers added after that version stay on the rule, and the rule stays on or off as it is now. The saved settings are checked again first: a judge model that is no longer served or a remote scorer that was removed refuses the restore. Only proxy admins may call it. The before and after values are written to the audit log, and every gateway pod uses the restored rule within 30 seconds.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#versions-and-restore)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes
versionpathintegerYes

Request body (application/json, OnlineChangeReason or null):

Example request:

curl -X POST "http://localhost:4000/eval/online/rules/rule_id-123/versions/version-123/restore" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "version 3'\''s judge model fails too many polite answers"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_OnlineEvalRuleTable
400The saved version cannot run any moreapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule or no saved version with that numberapplication/json ErrorDetail
409Another rule took the saved version's name sinceapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesRule Id
namestringYesName
descriptionstring or nullNoDescription
enabledbooleanYesEnabled
model_groupsarray of stringNoModel Groups
team_idsarray of stringNoTeam Ids
keysarray of stringNoKeys
tagsarray of stringNoTags
sample_percentagenumberYesSample Percentage
scorersarray of objectYesScorers
daily_judge_budgetnumber or nullNoDaily Judge Budget
daily_remote_call_capinteger or nullNoDaily Remote Call Cap
alertOnlineEvalAlertNoWhen a rule raises an eval_regression alert: a (model group, scorer) pass rate under min_pass_rate,
last_alerted_atstring or nullNoLast Alerted At
created_bystring or nullNoCreated By
updated_bystring or nullNoUpdated By
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At
versionintegerNoVersion

GET /eval/online/rules/{rule_id}/agreement​

Compare an online scoring rule with human reviewers

Shows how often the rule's stored verdicts agree with human reviewers on the same requests, so you know whether its judge can be trusted and where to set its threshold. Reviewers label production requests in a review queue, and every request the rule also scored is compared: agreement, Cohen's kappa, the confusion counts, the mean score error and a suggested threshold, for each scorer and rule version on its own. With version only that version's verdicts count. Fewer than 30 compared items is flagged as low_sample. Proxy admins and admin viewers may call it. Nothing is changed.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#judge-versus-human-agreement)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes
queue_idquerystringYes
versionqueryinteger or nullNo

Example request:

curl -X GET "http://localhost:4000/eval/online/rules/rule_id-123/agreement?queue_id=queue_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineRuleAgreement
400No request in the queue was scored by the ruleapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule or no review queue with that idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
rule_idstringYesThe rule
queue_idstringYesThe review queue the human labels come from
compared_requestsintegerYesRequests both the rule and the reviewers judged
calibrationCalibrationReportYesAgreement, kappa and a suggested threshold per series

GET /eval/online/rules/{rule_id}/backfills​

List the backfills of an online scoring rule

The rule's 50 newest backfills with their progress: requests read, picked, scored, skipped because they were already scored or had no stored prompt and answer, skipped over budget, errors and judge spend. A backfill that still says running but has been silent for 10 minutes is flagged as interrupted. Proxy admins and admin viewers may call it. Nothing is changed.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#backfill-past-traffic)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/online/rules/rule_id-123/backfills" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineBackfillList
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule with that idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
backfillsarray of OnlineBackfillViewYesThe rule's backfills, newest first

POST /eval/online/rules/{rule_id}/backfills​

Score past traffic with an online scoring rule

Scores past traffic with a saved rule in the background, so a new or changed rule has history to chart and compare from day one. The source is logged requests in a time window of at most 31 days that the rule's match selects (newest first, up to 20,000 read), or up to 200 Lens traces you pick. With apply_sampling only the requests live sampling would have picked are scored. Requests the rule already scored are skipped, so running it again is safe. Judge calls are billed like live scoring and stop once the backfill spent judge_budget. Scores land with the original request time and the rule version. One backfill per rule runs at a time. Only proxy admins may call it, and the start is written to the audit log.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#backfill-past-traffic)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes

Request body (application/json, schema NewOnlineBackfill):

FieldTypeRequiredDescription
sourceSpendLogBackfillSource or LensBackfillSourceYesLogged requests in a time window, or Lens traces
max_requestsintegerNoThe most requests to score, at most 500
apply_samplingbooleanNoScore only the requests live sampling would pick
judge_budgetnumber or nullNoThe most this backfill may spend on judges

Example request:

curl -X POST "http://localhost:4000/eval/online/rules/rule_id-123/backfills" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": {
"type": "spend_logs",
"start": "2026-11-14T00:00:00Z",
"end": "2026-11-21T00:00:00Z"
},
"max_requests": 100,
"apply_sampling": true
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_OnlineEvalBackfillTable
400The rule or the source cannot be backfilledapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule with that idapplication/json ErrorDetail
409A backfill of the rule is already runningapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
backfill_idstringYesThe id of the backfill
rule_idstringYesThe rule that scores
rule_versionintegerYesThe rule version used
sourceSpendLogBackfillSource or LensBackfillSourceYesWhat was scored
apply_samplingbooleanYesWhether only requests live sampling picks were scored
max_requestsintegerYesThe most requests to score
judge_budgetnumber or nullNoThe judge spend cap
statusenum: "running", "completed", "failed", "cancelled"Yesrunning, completed, failed or cancelled
scannedintegerNoRequests or traces read
selectedintegerNoOf those, the ones picked for scoring
scoredintegerNoRequests scored
already_scoredintegerNoRequests skipped because the rule already scored them
unreadableintegerNoRequests skipped because no prompt and answer were kept
over_budgetintegerNoRequests skipped once the judge budget ran out
errorsintegerNoScorer results that are errors
judge_spendnumberNoWhat the judge calls cost, in US dollars
errorstring or nullNoWhy the backfill failed
created_bystring or nullNoWho started it
created_atstring or nullNoWhen it started
updated_atstring or nullNoWhen its counters last moved
finished_atstring or nullNoWhen it ended

GET /eval/online/rules/{rule_id}/backfills/{backfill_id}​

Read one backfill of an online scoring rule

One backfill with its progress. Proxy admins and admin viewers may call it. Nothing is changed.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#backfill-past-traffic)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes
backfill_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/online/rules/rule_id-123/backfills/backfill_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json OnlineBackfillView
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule or no backfill of it with that idapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
backfillSpanway_OnlineEvalBackfillTableYesThe backfill
interruptedbooleanYesRunning but silent for 10 minutes, so its gateway pod likely stopped

POST /eval/online/rules/{rule_id}/backfills/{backfill_id}/cancel​

Cancel a running backfill

Stops a running backfill after the request it is scoring now. Scores already written stay. Only proxy admins may call it, and the cancel is written to the audit log.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/evaluator_operations#backfill-past-traffic)

Parameters:

NameInTypeRequiredDescription
rule_idpathstringYes
backfill_idpathstringYes

Request body (application/json, OnlineChangeReason or null):

Example request:

curl -X POST "http://localhost:4000/eval/online/rules/rule_id-123/backfills/backfill_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "wrong time window"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Spanway_OnlineEvalBackfillTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No rule or no backfill of it with that idapplication/json ErrorDetail
409The backfill already endedapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
backfill_idstringYesThe id of the backfill
rule_idstringYesThe rule that scores
rule_versionintegerYesThe rule version used
sourceSpendLogBackfillSource or LensBackfillSourceYesWhat was scored
apply_samplingbooleanYesWhether only requests live sampling picks were scored
max_requestsintegerYesThe most requests to score
judge_budgetnumber or nullNoThe judge spend cap
statusenum: "running", "completed", "failed", "cancelled"Yesrunning, completed, failed or cancelled
scannedintegerNoRequests or traces read
selectedintegerNoOf those, the ones picked for scoring
scoredintegerNoRequests scored
already_scoredintegerNoRequests skipped because the rule already scored them
unreadableintegerNoRequests skipped because no prompt and answer were kept
over_budgetintegerNoRequests skipped once the judge budget ran out
errorsintegerNoScorer results that are errors
judge_spendnumberNoWhat the judge calls cost, in US dollars
errorstring or nullNoWhy the backfill failed
created_bystring or nullNoWho started it
created_atstring or nullNoWhen it started
updated_atstring or nullNoWhen its counters last moved
finished_atstring or nullNoWhen it ended

GET /eval/review/queues​

List review queues

Lists the human review queues, a page at a time, each with how many items are pending, labelled and in total. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#queues)

Parameters:

NameInTypeRequiredDescription
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/review/queues" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of queues with their countsapplication/json ReviewQueueListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queuesarray of ReviewQueueViewYesQueues
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size

POST /eval/review/queues​

Create a review queue

Creates a human review queue, a list of model answers that the people you name label as pass or fail, so you can check what automated scorers miss and calibrate them. Reviewers must be internal users or proxy admins. labels_per_item sets how many reviewers label each item before it counts as decided. The new queue is written to the audit log. Proxy admins and custom roles with evals.write may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#queues)

Request body (application/json, schema NewReviewQueue):

FieldTypeRequiredDescription
namestringYesQueue name, unique per owner
descriptionstring or nullNoWhat the queue is for
instructionsstring or nullNoWhat reviewers should check, shown on every item
reviewersarray of stringNoUser ids of the internal users or proxy admins who label the items
labels_per_itemintegerNoHow many reviewers must label an item before it counts as decided
score_enabledbooleanNoLet reviewers give a score from 0 to 1 besides pass or fail
blindbooleanNoHide the expected answer and give each reviewer the items in their own order

Example request:

curl -X POST "http://localhost:4000/eval/review/queues" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "support answers",
"description": "Weekly check of refund answers",
"instructions": "Pass when the answer states the 14 day refund window and nothing false.",
"reviewers": [
"reviewer-1@example.com",
"reviewer-2@example.com"
],
"labels_per_item": 2,
"score_enabled": true
}'

Responses:

StatusDescriptionBody
200The new queueapplication/json Spanway_EvalReviewQueueTable
400A reviewer does not exist or may not reviewapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
409The owner already has a queue with this nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queue_idstringYesQueue Id
namestringYesName
descriptionstring or nullNoDescription
instructionsstring or nullNoInstructions
reviewersarray of stringNoReviewers
labels_per_itemintegerNoLabels Per Item
score_enabledbooleanNoScore Enabled
blindbooleanNoBlind
created_bystring or nullNoCreated By
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

GET /eval/review/queues/{queue_id}​

Get a review queue

Shows one human review queue with its reviewers, instructions and item counts. It answers 404 when the id is unknown or outside the caller's scope. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#queues)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/review/queues/queue_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The queue with its countsapplication/json ReviewQueueView
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queueSpanway_EvalReviewQueueTableYesThe queue
pendingintegerYesItems that still need labels
labelledintegerYesItems with all the labels they need
totalintegerYesAll items in the queue

PATCH /eval/review/queues/{queue_id}​

Change a review queue

Changes only the fields you send. Removing a reviewer takes away their access at once. Lowering labels_per_item marks items that already have enough labels as decided. The change is written to the audit log with the values before and after. Proxy admins and custom roles with evals.write may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#queues)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema UpdateReviewQueue):

FieldTypeRequiredDescription
namestring or nullNoNew queue name
descriptionstring or nullNoWhat the queue is for
instructionsstring or nullNoWhat reviewers should check, shown on every item
reviewersarray of string or nullNoThe full new reviewer list, removed reviewers lose access at once
labels_per_iteminteger or nullNoHow many reviewers must label an item before it counts as decided
score_enabledboolean or nullNoLet reviewers give a score from 0 to 1 besides pass or fail
blindboolean or nullNoHide the expected answer and give each reviewer the items in their own order

Example request:

curl -X PATCH "http://localhost:4000/eval/review/queues/queue_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels_per_item": 1,
"reviewers": [
"reviewer-1@example.com"
]
}'

Responses:

StatusDescriptionBody
200The queue as changedapplication/json Spanway_EvalReviewQueueTable
400Nothing was sent, or a reviewer may not reviewapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
409The owner already has a queue with this nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queue_idstringYesQueue Id
namestringYesName
descriptionstring or nullNoDescription
instructionsstring or nullNoInstructions
reviewersarray of stringNoReviewers
labels_per_itemintegerNoLabels Per Item
score_enabledbooleanNoScore Enabled
blindbooleanNoBlind
created_bystring or nullNoCreated By
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

DELETE /eval/review/queues/{queue_id}​

Delete a review queue

Deletes the queue with every item and label in it, for good. Datasets already exported from it keep their items. The deletion is written to the audit log. Proxy admins and custom roles with evals.write may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#queues)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/review/queues/queue_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The deleted queueapplication/json Spanway_EvalReviewQueueTable
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queue_idstringYesQueue Id
namestringYesName
descriptionstring or nullNoDescription
instructionsstring or nullNoInstructions
reviewersarray of stringNoReviewers
labels_per_itemintegerNoLabels Per Item
score_enabledbooleanNoScore Enabled
blindbooleanNoBlind
created_bystring or nullNoCreated By
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

POST /eval/review/queues/{queue_id}/from_run​

Add eval run results to a review queue

Adds results of a completed eval run to the queue, by default the failed ones, keeping the scorer's verdict so the calibration report can compare it with the human labels. Errored and unscored results are skipped, and a result already in the queue is added once. Each fill is written to the audit log with its counts. Proxy admins and custom roles with evals.write may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#filling-a-queue)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema EnqueueFromRun):

FieldTypeRequiredDescription
run_idstringYesThe completed eval run to take results from
filterenum: "all", "passed", "failed"NoWhich results to take: failed (default), passed or all
modelstring or nullNoTake only the results of this model
sampleLogSampleNoHow many results to take and how to pick them

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/from_run" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"run_id": "run_9d02e5f7",
"filter": "failed",
"sample": {
"size": 25,
"strategy": "random"
}
}'

Responses:

StatusDescriptionBody
200How many items were added and why others were left outapplication/json EnqueueResult
400The run is not completed, or the queue would hold too many itemsapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404The queue or the run does not existapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
addedintegerYesItems added to the queue
duplicatesintegerYesItems left out because the queue already holds them
skipped_no_contentintegerNoSources left out because they have no stored response
skipped_redactedintegerNoSources left out because their content was redacted
skipped_missing_itemintegerNoResults left out because their dataset item no longer exists
skipped_data_policyintegerNoRequests left out because their key, team or org requires zero retention

POST /eval/review/queues/{queue_id}/from_logs​

Add sampled production responses to a review queue

Adds a sample of real production answers from the request logs to the queue, so people can judge live traffic. It needs general_settings.store_prompts_in_spend_logs. Requests whose key, team or organization requires zero data retention, and redacted requests, are left out. Each fill is written to the audit log with its counts. Only proxy admins may call it, because it copies request bodies of every team.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#filling-a-queue)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema EnqueueFromLogs):

FieldTypeRequiredDescription
filtersLogFiltersYesWhich logged requests to sample from, start and end are required
sampleLogSampleNoHow many requests to take and how to pick them

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/from_logs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filters": {
"start": "2026-11-14T00:00:00Z",
"end": "2026-11-21T00:00:00Z",
"models": [
"claude-sonnet-5-5"
],
"teams": [
"team-support"
]
},
"sample": {
"size": 50,
"strategy": "random"
}
}'

Responses:

StatusDescriptionBody
200How many items were added and why others were left outapplication/json EnqueueResult
400Nothing matched, or the queue would hold too many itemsapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller is not a proxy adminapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
addedintegerYesItems added to the queue
duplicatesintegerYesItems left out because the queue already holds them
skipped_no_contentintegerNoSources left out because they have no stored response
skipped_redactedintegerNoSources left out because their content was redacted
skipped_missing_itemintegerNoResults left out because their dataset item no longer exists
skipped_data_policyintegerNoRequests left out because their key, team or org requires zero retention

POST /eval/review/queues/{queue_id}/from_shadow​

Add shadowed requests to a review queue

Adds the real answers of shadowed requests to the queue, one item per request, so people can judge whether the model in production answered acceptably while a candidate model ran in the shadow. The judge's preference is kept in the item metadata for admins and never shown to reviewers. Each fill is written to the audit log with its counts. Only proxy admins may call it, because it copies request bodies of every team.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#filling-a-queue)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema EnqueueFromShadow):

FieldTypeRequiredDescription
job_idstring or nullNoTake only the attempts of this shadow job
modelstring or nullNoTake only the attempts of this shadow model
startstring or nullNoEarliest attempt time
endstring or nullNoLatest attempt time
outcomeenum: "real", "shadow", "tie" or nullNoTake only attempts where the judge preferred real, shadow, or saw a tie
sampleLogSampleNoHow many attempts to take and how to pick them

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/from_shadow" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"job_id": "shadow_2c71",
"start": "2026-11-14T00:00:00Z",
"end": "2026-11-21T00:00:00Z",
"outcome": "shadow",
"sample": {
"size": 50
}
}'

Responses:

StatusDescriptionBody
200How many items were added and why others were left outapplication/json EnqueueResult
400Nothing matched, or the queue would hold too many itemsapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller is not a proxy adminapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
addedintegerYesItems added to the queue
duplicatesintegerYesItems left out because the queue already holds them
skipped_no_contentintegerNoSources left out because they have no stored response
skipped_redactedintegerNoSources left out because their content was redacted
skipped_missing_itemintegerNoResults left out because their dataset item no longer exists
skipped_data_policyintegerNoRequests left out because their key, team or org requires zero retention

GET /eval/review/queues/{queue_id}/items​

List the items of a review queue

Lists the items of a queue, newest first, with every label, the consensus and the automated verdicts. Filter with pending, source and reviewer. A caller let in only by a custom role sees the input and answer of production and shadow items redacted. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#who-can-do-what)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes
pendingqueryboolean or nullNo
sourcequeryenum: "eval_result", "production", "shadow" or nullNo
reviewerquerystring or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/review/queues/queue_id-123/items" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of items with their labels and verdictsapplication/json ReviewItemListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
itemsarray of ReviewItemAdminViewYesItems
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size

GET /eval/review/queues/{queue_id}/items/{review_item_id}​

Get a review item with its labels

Shows one item of a queue with every label, the consensus and the automated verdicts, and the request id to open in the run ledger. A caller let in only by a custom role sees the input and answer of production and shadow items redacted. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#who-can-do-what)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes
review_item_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/review/queues/queue_id-123/items/review_item_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The item with every label and verdictapplication/json ReviewItemAdminView
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
404No item has this id in the queue, or the caller does not hold itapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
itemSpanway_EvalReviewItemTableYesThe item with its content and automated verdicts
labelsarray of Spanway_EvalReviewLabelTableYesEvery reviewer's label
consensusReviewConsensusYesThe majority label and the mean score
pendingbooleanYesWhether the item still needs labels
ledger_idstring or nullYesThe request id to open in the run ledger, when the item came from a request

DELETE /eval/review/queues/{queue_id}/items/{review_item_id}​

Remove an item from a review queue

Removes one item and its labels from a queue, for example an item that should never have been added, and returns what was removed. The removal is written to the audit log without the item content. Proxy admins and custom roles with evals.write may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#queues)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes
review_item_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/review/queues/queue_id-123/items/review_item_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The removed itemapplication/json ReviewItemAdminView
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404No item has this id in the queue, or the caller does not hold itapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
itemSpanway_EvalReviewItemTableYesThe item with its content and automated verdicts
labelsarray of Spanway_EvalReviewLabelTableYesEvery reviewer's label
consensusReviewConsensusYesThe majority label and the mean score
pendingbooleanYesWhether the item still needs labels
ledger_idstring or nullYesThe request id to open in the run ledger, when the item came from a request

GET /eval/review/queues/{queue_id}/calibration​

Compare human labels with automated scorers

Shows how well each automated scorer agrees with the human reviewers, so you can tell whether a judge can be trusted and where to set its threshold: agreement, Cohen's kappa, the confusion counts, the mean score error and a suggested threshold for every scorer and model pair. Only items whose labels are all in and do not tie count. Without run_id the verdicts stored when each item was added are compared. With run_id that run's results for items exported from this queue are compared. Fewer than 30 items is flagged as low_sample. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#calibration)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes
run_idquerystring or nullNo
modelquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/eval/review/queues/queue_id-123/calibration" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200How well each scorer and model pair agrees with the reviewersapplication/json CalibrationReport
400The run has no result for any decided item of the queueapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queue_idstringYesThe queue the labels come from
run_idstring or nullYesThe run whose verdicts were compared, empty for the verdicts stored at enqueue
labelled_itemsintegerYesItems with all the labels they need
consensus_itemsintegerYesOf those, items whose labels do not tie
excluded_tiesintegerYesItems left out because reviewers tied
inter_rater_agreementnumber or nullYesHow often reviewers agree with each other, from 0 to 1
metricsarray of MetricCalibrationYesAgreement between humans and each scorer and model pair

POST /eval/review/queues/{queue_id}/to_dataset​

Export decided review items as a golden dataset

Exports the decided items of a queue as a golden dataset for future eval runs, either a new dataset (name) or appended to an existing one (dataset_id). With output_as_expected an item humans passed gets its answer as the expected answer. Each item keeps its source request and subject ids in metadata, so a data subject erasure also removes it from the dataset. Appending skips items the dataset already holds and is refused while the dataset has runs in progress or enabled schedules. The export is written to the audit log. Proxy admins and custom roles with evals.write may call it, and it needs the evals license feature.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#golden-datasets)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema ReviewToDataset):

FieldTypeRequiredDescription
dataset_idstring or nullNoAppend to this existing dataset, or send name instead
namestring or nullNoCreate a new dataset with this name, or send dataset_id instead
descriptionstring or nullNoDescription of the new dataset
includeenum: "passed", "failed", "all"NoWhich decided items to export: passed (default), failed or all
output_as_expectedbooleanNoUse the response of an item humans passed as its expected answer

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/to_dataset" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "refund golden",
"include": "passed",
"output_as_expected": true
}'

Responses:

StatusDescriptionBody
200The dataset the items went toapplication/json ReviewExportResult
400No decided item matches include, or the dataset is busy or too largeapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
409A dataset with this name existsapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
dataset_idstringYesThe dataset the items went to
addedintegerYesItems added
duplicatesintegerYesItems left out because the dataset already holds them
item_countintegerYesItems in the dataset now

GET /eval/review/assigned​

List the review queues assigned to you

Lists the review queues the caller is a reviewer of, with how many items are left for them, for the reviewer page of the Admin UI. Any signed-in internal user or proxy admin may call it, and a caller who reviews nothing gets an empty list. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#labelling)

Example request:

curl -X GET "http://localhost:4000/eval/review/assigned" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The queues the caller reviewsapplication/json AssignedQueueListResponse
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queuesarray of AssignedQueueYesQueues

POST /eval/review/queues/{queue_id}/next​

Claim the next item to review

Claims the next item of the queue for the caller for 30 minutes, or returns the one they already hold, so reloading the page resumes it. Two reviewers never get the same item at once. Items an admin assigned to the caller come first, and items assigned to another reviewer are left for them. The item is empty when nothing is left for the caller. What a reviewer sees is blind: no automated verdict, other labels, model or source. A blind queue also hides the expected answer and gives each reviewer the items in their own order. Only the internal users and proxy admins the queue names as reviewers may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#labelling)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/next" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200The claimed item, or an empty item when nothing is leftapplication/json ReviewNext
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller is not a reviewer of this queueapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
itemReviewItemReviewerView or nullYesThe claimed item, empty when nothing is left for the caller

GET /eval/review/items/{review_item_id}​

Get an item you are reviewing

Shows an item the caller holds or has already labelled, as reviewers see it, with their own label. It answers 404 for any other item. It changes nothing. Only the internal users and proxy admins the queue names as reviewers may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#labelling)

Parameters:

NameInTypeRequiredDescription
review_item_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/review/items/review_item_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The item as reviewers see itapplication/json ReviewItemReviewerView
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller is not a reviewer of this queueapplication/json ErrorDetail
404No item has this id in the queue, or the caller does not hold itapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
review_item_idstringYesId of the item
queue_idstringYesId of the queue it belongs to
instructionsstring or nullYesWhat to check
inputstring or array of SystemMessage or UserMessage or AssistantMessage or ToolMessageYesThe prompt or conversation that was answered
outputstring or nullYesThe response to judge
expectedstring or nullYesThe expected answer, when the item has one and the queue is not blind
contextarray of string or nullYesDocuments the answer should be based on, when the item has them
score_enabledbooleanYesWhether a score from 0 to 1 can be given besides pass or fail
blindbooleanYesWhether the queue hides the expected answer and shuffles the items
own_labelOwnLabel or nullYesThe caller's earlier label, when there is one
lease_expires_atstring or nullYesWhen the caller's claim on the item runs out

POST /eval/review/items/{review_item_id}/label​

Label a review item

Labels an item the caller holds as pass or fail, with an optional score and comment, or changes the caller's earlier label, which still counts once. Labelling releases the claim. A first label without an unexpired claim answers 409. Labels are kept with the reviewer and the time, not in the audit log. Only the internal users and proxy admins the queue names as reviewers may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#labelling)

Parameters:

NameInTypeRequiredDescription
review_item_idpathstringYes

Request body (application/json, schema NewReviewLabel):

FieldTypeRequiredDescription
passedbooleanYesWhether the response is acceptable
scorenumber or nullNoA score from 0 to 1, only when the queue collects scores
commentstring or nullNoWhy, in a few words

Example request:

curl -X POST "http://localhost:4000/eval/review/items/review_item_id-123/label" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"passed": true,
"score": 0.9,
"comment": "Correct window, clear wording"
}'

Responses:

StatusDescriptionBody
200The caller's label as storedapplication/json OwnLabel
400A score was sent to a queue that collects pass or fail onlyapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller is not a reviewer of this queueapplication/json ErrorDetail
404No item has this id in the queue, or the caller does not hold itapplication/json ErrorDetail
409The caller does not hold the item, so it cannot be labelled for the first timeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
passedbooleanYesWhether the reviewer passed the response
scorenumber or nullYesThe reviewer's score from 0 to 1, when the queue collects scores
commentstring or nullYesThe reviewer's comment

POST /eval/review/items/{review_item_id}/skip​

Skip a review item

Hides an item from the caller for good, for an item they cannot judge, and releases their claim on it. Other reviewers still get it. Only the internal users and proxy admins the queue names as reviewers may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_queues#labelling)

Parameters:

NameInTypeRequiredDescription
review_item_idpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/eval/review/items/review_item_id-123/skip" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200The item the caller will no longer seeapplication/json ReviewSkipped
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller is not a reviewer of this queueapplication/json ErrorDetail
404No item has this id in the queue, or the caller does not hold itapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
review_item_idstringYesId of the item the caller will no longer see

GET /eval/review/queues/{queue_id}/board​

Show who is working on a review queue

Shows the assignment board of a queue: how many items are pending and how many nobody is assigned to, and for every reviewer how many items an admin assigned to them, how many they have open right now, how many they could still take, how many they labelled and skipped, and when they last labelled. Use it to spot a reviewer who is behind or away. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_board#assignment-board)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/review/queues/queue_id-123/board" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Pending and unassigned counts with one row per reviewerapplication/json ReviewBoard
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queue_idstringYesThe queue
pendingintegerYesItems that still need labels
unassignedintegerYesPending items not assigned to any reviewer, open to every reviewer
reviewersarray of ReviewerWorkloadYesOne row per reviewer named on the queue

POST /eval/review/queues/{queue_id}/assign​

Assign review items to reviewers

Shares pending items out to reviewers of the queue, each item to the named reviewer who holds the fewest, so the work is split evenly. Without review_item_ids it takes the oldest items nobody is assigned to or has open, up to 1,000 per call. With them it assigns those items, moving them from another reviewer if needed. An item a reviewer has open under a live 30 minute claim stays with them: it goes to them when they are named and counts as not assignable otherwise. An assigned item is offered only to its reviewer until they label or skip it or leave the queue. Decided items and items every named reviewer already labelled or skipped stay as they were. The change is written to the audit log with the assignments before and after. Proxy admins and custom roles with evals.write may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_board#assigning-items)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema AssignReviewItems):

FieldTypeRequiredDescription
reviewersarray of stringYesReviewers of the queue to share the items between, the least loaded first
review_item_idsarray of string or nullNoThe items to assign, or leave out to take the oldest unassigned pending items

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/assign" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reviewers": [
"reviewer-1@example.com",
"reviewer-2@example.com"
]
}'

Responses:

StatusDescriptionBody
200How many items each reviewer was givenapplication/json AssignResult
400A named user is not a reviewer of the queueapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404The queue does not exist in the caller's scope, or an item id is not in itapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
assignedintegerYesItems assigned
not_assignableintegerYesItems left as they were, already decided or labelled or skipped by every reviewer named
by_reviewerobjectYesHow many items each reviewer was given

POST /eval/review/queues/{queue_id}/unassign​

Take review items back from reviewers

Takes pending items back so any reviewer of the queue can pick them up, for example from a reviewer who is away. It removes the admin assignment and any open claim on each item, so a reviewer who was still working on one gets a 409 when they label it and claims the next item instead. Send reviewer to take back what one reviewer holds, review_item_ids for chosen items, or both. Labels already given stay. The change is written to the audit log with who held each item. Proxy admins and custom roles with evals.write may call it.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_board#taking-items-back)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Request body (application/json, schema UnassignReviewItems):

FieldTypeRequiredDescription
review_item_idsarray of string or nullNoThe items to take back, or leave out to take back every item of the reviewer
reviewerstring or nullNoTake back only what this reviewer holds

Example request:

curl -X POST "http://localhost:4000/eval/review/queues/queue_id-123/unassign" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reviewer": "reviewer-1@example.com"
}'

Responses:

StatusDescriptionBody
200How many items were taken backapplication/json UnassignResult
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller may not change review queuesapplication/json ErrorDetail
404The queue does not exist in the caller's scope, or an item id is not in itapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
releasedintegerYesItems whose assignment and open claim were removed

GET /eval/review/queues/{queue_id}/agreement​

Show how far reviewers agree with each other

Shows how consistently the reviewers of a queue judge the same items, so you can tell whether the instructions are clear and whose labels drift: percent agreement and Krippendorff's alpha over items two or more reviewers labelled, each reviewer's pass rate and agreement with the others, Cohen's kappa for every pair, and the ids of up to 50 disputed items to settle. Fewer than 30 shared items is flagged as low_sample. Proxy admins, admin viewers and custom roles with evals.read may call it, each seeing only the queues its team or organization owns. It changes nothing.

Docs (https://docs.spanway.ai/docs/proxy/enterprise/review_board#reviewer-agreement)

Parameters:

NameInTypeRequiredDescription
queue_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/review/queues/queue_id-123/agreement" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Overall, per reviewer and per pair agreementapplication/json ReviewerAgreementReport
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The license lacks the evals feature, or the caller's role may not read review queuesapplication/json ErrorDetail
404No queue has this id within the caller's scopeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
queue_idstringYesThe queue the labels come from
overlapping_itemsintegerYesItems labelled by two or more reviewers
disputed_itemsintegerYesOf those, items where reviewers did not all give the same answer
percent_agreementnumber or nullYesMean pairwise agreement over overlapping items, 0 to 1
krippendorff_alphanumber or nullYesAgreement corrected for chance, 1 is perfect and 0 is chance
reviewersarray of ReviewerAgreementYesOne row per reviewer who labelled anything
pairsarray of ReviewerPairAgreementYesOne row per pair of reviewers who share items
disputedarray of stringYesReview item ids of up to 50 disputed items, most recently labelled first

GET /eval/feedback​

List end-user ratings

Lists the ratings end users gave to gateway requests, newest first, so you can review what people liked and disliked. Proxy admins and admin viewers see every rating, and a custom role that grants eval reads sees the ratings of its key's team (or its organization, for an organization admin). Narrow the list to one request with request_id or one conversation with session_id, and page through it with page and page_size (at most 200). Nothing is changed.

Parameters:

NameInTypeRequiredDescription
request_idquerystring or nullNo
session_idquerystring or nullNo
pagequeryintegerNo
page_sizequeryintegerNo

Example request:

curl -X GET "http://localhost:4000/eval/feedback" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200One page of ratings, newest firstapplication/json EvalFeedbackListResponse
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
feedbackarray of Spanway_EvalFeedbackYesFeedback
totalintegerYesTotal
pageintegerYesPage
page_sizeintegerYesPage Size

POST /eval/feedback​

Rate a gateway request on behalf of an end user

Records how good an answer was, so you can track quality from your own users' point of view. Your app calls this with the same virtual key that sent the request, or any key of the same team, and sends a score from 0 to 1, a label, or both, plus an optional comment.

Rating the same request again for the same end user replaces the earlier rating. A request id that this key or team did not send answers 404, whether it exists or not, and so does a request whose log row is not written yet (the gateway writes logs in batches a few seconds after the response). When the key, team or organization requires zero data retention, the comment is dropped and only the score, label and ids are kept. A request accepts ratings from at most 20 different end users, the next one answers 409.

Request body (application/json, schema FeedbackSubmission):

FieldTypeRequiredDescription
request_idstringYesRequest Id
scorenumber or nullNoScore
labelstring or nullNoLabel
commentstring or nullNoComment
end_userstring or nullNoEnd User

Example request:

curl -X POST "http://localhost:4000/eval/feedback" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_id": "chatcmpl-9f2b7c1d-0000-4a1e-8d3e-123456789abc",
"score": 0.8,
"label": "helpful",
"comment": "Answered the refund question in one go",
"end_user": "customer-1001"
}'

Responses:

StatusDescriptionBody
200The rating as storedapplication/json Spanway_EvalFeedback
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
feedback_idstringYesFeedback Id
request_idstringYesRequest Id
session_idstring or nullNoSession Id
scorenumber or nullNoScore
labelstring or nullNoLabel
commentstring or nullNoComment
end_userstringNoEnd User
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

DELETE /eval/feedback/{feedback_id}​

Delete one end-user rating

Removes one rating for good, for example when an end user asks for their feedback to be erased. Proxy admins, or a custom role that grants eval writes within the rating's scope, may call it. The deleted rating is returned and an audit log entry is written without the comment. An unknown id, or one outside the caller's scope, answers 404.

Parameters:

NameInTypeRequiredDescription
feedback_idpathstringYes

Example request:

curl -X DELETE "http://localhost:4000/eval/feedback/feedback_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The rating that was deletedapplication/json Spanway_EvalFeedback
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
feedback_idstringYesFeedback Id
request_idstringYesRequest Id
session_idstring or nullNoSession Id
scorenumber or nullNoScore
labelstring or nullNoLabel
commentstring or nullNoComment
end_userstringNoEnd User
owner_team_idstring or nullNoOwner Team Id
owner_org_idstring or nullNoOwner Org Id
created_atstring or nullNoCreated At
updated_atstring or nullNoUpdated At

GET /eval/runs/{run_id}/items​

Read the items a submitted eval run needs answered

Returns the questions of a submitted eval run, at the dataset version the run pinned, so a CI job or a local harness can run its own system on them and post the answers back. Admins and eval readers can call it. A ci key needs read_items in its eval_ci settings, reads only the runs it started, and gets the items without their expected answers, so it cannot grade itself. Nothing changes.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Example request:

curl -X GET "http://localhost:4000/eval/runs/run_id-123/items" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The run's items at the dataset version it pinnedapplication/json EvalRunItems
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The object already exists or is in a state that does not allow this changeapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesRun Id
dataset_idstringYesDataset Id
dataset_versioninteger or nullYesDataset Version
itemsarray of EvalItemYesItems

POST /eval/runs/{run_id}/outputs​

Submit answers to a submitted eval run

Scores up to 100 answers that a system outside the gateway produced for a running submitted run, each for an item of the run's dataset version and a model label, and stores them as the run's results. Admins and eval runners, including ci keys, can call it. An item id the dataset does not have, or an item already submitted for the same model, refuses the whole batch. An item a concurrent batch stored first keeps that result and is counted as already submitted. A batch that ends after the run finished is a 409 and stores nothing. Each batch writes an audit row with its counts, never the answers. A ci key posts only to the runs it started.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Request body (application/json, schema SubmitOutputs):

FieldTypeRequiredDescription
outputsarray of SubmittedOutputYesOutputs

Example request:

curl -X POST "http://localhost:4000/eval/runs/run_id-123/outputs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"outputs": [
{
"item_id": "refund-window",
"model": "support-bot-v2",
"output": "You have 14 days to return it."
},
{
"item_id": "shipping-time",
"model": "support-bot-v2",
"transcript": [
{
"role": "user",
"content": "When will my order arrive?"
},
{
"role": "assistant",
"content": "Orders arrive within 3 to 5 business days."
}
]
}
]
}'

Responses:

StatusDescriptionBody
200How many outputs were scored, failed to score or were already storedapplication/json SubmittedOutputsResult
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The run already finished, failed or was cancelled, so it takes no more outputsapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesRun Id
scoredintegerYesScored
errorsintegerYesErrors
already_submittedintegerNoAlready Submitted

POST /eval/runs/{run_id}/finish​

Finish a submitted eval run

Completes a submitted eval run once every batch of answers is in. Every item without an answer for a model that submitted anything becomes an error row, and the run gets its summary and verdict, so it reads like any other run in the Admin UI and in CI gates. Admins and eval runners can call it, and a ci key only for the runs it started. After this the run takes no more answers. The run before and after is written to the audit log.

Parameters:

NameInTypeRequiredDescription
run_idpathstringYes

Request body (application/json, object):

Example request:

curl -X POST "http://localhost:4000/eval/runs/run_id-123/finish" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200The finished run with its summaryapplication/json Spanway_EvalRunTable
400The request breaks a rule the detail namesapplication/json ErrorDetail
401No valid key or Admin UI session was presentedapplication/json ProxyError
403The caller's role may not do this, or the license lacks the evals featureapplication/json ErrorDetail
404No object with that id is visible to the callerapplication/json ErrorDetail
409The run already finished, failed or was cancelled, so it takes no more outputsapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
500The database is not connectedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
run_idstringYesThe id of the eval run
dataset_idstringYesThe dataset the run tests
dataset_versioninteger or nullNoThe dataset version the run is pinned to
namestring or nullNoA label for the run
modelsarray of stringYesThe models the run sends every item to
scorerobjectYesHow answers are graded, with the scorer type and its settings
statusenum: "pending", "running", "completed", "failed", "cancelled"Yespending, running, completed, failed or cancelled
summaryEvalSummary or nullNoThe per model totals, once the run completed
errorstring or nullNoWhy the run failed
schedule_idstring or nullNoThe schedule that started the run
prompt_idstring or nullNoThe managed prompt the run rendered
prompt_versioninteger or nullNoThe version of the managed prompt the run used
prompt_environmentstring or nullNoThe prompt environment the version was taken from
modeenum: "single", "replay", "agent", "logged"Nosingle, replay, agent or logged, which decides how items are sent
outputs_sourceenum: "dataset", "submitted"Nodataset when the gateway calls models, submitted when outputs are sent in
max_stepsinteger or nullNoThe most agent steps per item in agent mode
templateStoredPromptTemplate or nullNoThe prompt template applied to every item
paramsStoredInferenceParams or nullNoThe sampling settings sent with every call
items_digeststring or nullNoThe fingerprint of the items the run tested
baseline_keystring or nullNoThe key CI compares runs under
git_refstring or nullNoThe git branch or tag CI reported
git_shastring or nullNoThe git commit CI reported
ciCiContext or nullNoDetails CI sent about the pipeline that started the run
gateEvalGate or nullNoThe pass rate thresholds CI checks the run against
trusted_baselinebooleanNoWhether later CI runs may be compared with this one
owner_team_idstring or nullNoThe team that owns the run
owner_org_idstring or nullNoThe organization that owns the run
created_bystring or nullNoWho started the run
created_atstring or nullNoWhen the run was created
started_atstring or nullNoWhen the first item was sent
completed_atstring or nullNoWhen the run finished

GET /v1/evals​

List the evaluations at the model provider

List the evaluations stored at the model provider, newest first by default, a page at a time with limit, after and before. Nothing is changed.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
limitqueryinteger or nullNo
afterquerystring or nullNo
beforequerystring or nullNo
orderquerystring or nullNo
order_byquerystring or nullNo
custom_llm_providerquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/v1/evals" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json ListEvalsResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of EvalYesData
first_idstring or nullNoFirst Id
has_morebooleanNoHas More
last_idstring or nullNoLast Id
objectstringNoObject

POST /v1/evals​

Create an evaluation at the model provider

Create an evaluation at the model provider: the shape of the rows you will grade (data_source_config) and the graders that score each row (testing_criteria). Nothing is graded yet, start a run to do that. The provider stores the evaluation and answers with its id.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
custom_llm_providerquerystring or nullNo

Request body (application/json, object):

FieldTypeRequiredDescription
data_source_configobjectYesThe shape of the rows to grade, with a type such as custom or logs
metadataobject or nullNoUp to 16 labels of your own
modelstring or nullNoThe gateway model name whose provider account runs the call, used only for routing
namestring or nullNoA name to recognise the evaluation by
testing_criteriaarray of objectYesThe graders, each with a type such as string_check or score_model

Example request:

curl -X POST "http://localhost:4000/v1/evals" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data_source_config": {
"include_sample_schema": true,
"item_schema": {
"properties": {
"expected_label": {
"type": "string"
},
"ticket": {
"type": "string"
}
},
"required": [
"ticket",
"expected_label"
],
"type": "object"
},
"type": "custom"
},
"metadata": {
"team": "support"
},
"name": "Support ticket labels",
"testing_criteria": [
{
"input": "{{ sample.output_text }}",
"name": "label matches",
"operation": "eq",
"reference": "{{ item.expected_label }}",
"type": "string_check"
}
]
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Eval
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
created_atintegerYesCreated At
data_source_configobjectYesData Source Config
idstringYesId
metadataobject or nullNoMetadata
namestring or nullNoName
objectstringNoObject
testing_criteriaarray of objectYesTesting Criteria
updated_atinteger or nullNoUpdated At

GET /v1/evals/{eval_id}​

Read one evaluation

Read one evaluation by id, with its data source shape and graders. Nothing is changed.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
custom_llm_providerquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/v1/evals/eval_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Eval
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
created_atintegerYesCreated At
data_source_configobjectYesData Source Config
idstringYesId
metadataobject or nullNoMetadata
namestring or nullNoName
objectstringNoObject
testing_criteriaarray of objectYesTesting Criteria
updated_atinteger or nullNoUpdated At

POST /v1/evals/{eval_id}​

Rename an evaluation or change its labels

Change the name or the labels of an evaluation. Its graders and data source cannot change, create a new evaluation for that.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
custom_llm_providerquerystring or nullNo

Request body (application/json, object):

FieldTypeRequiredDescription
metadataobject or nullNoThe new labels, replacing the old ones
modelstring or nullNoThe gateway model name whose provider account runs the call, used only for routing
namestring or nullNoThe new name

Example request:

curl -X POST "http://localhost:4000/v1/evals/eval_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"team": "support"
},
"name": "Support ticket labels v2"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Eval
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
created_atintegerYesCreated At
data_source_configobjectYesData Source Config
idstringYesId
metadataobject or nullNoMetadata
namestring or nullNoName
objectstringNoObject
testing_criteriaarray of objectYesTesting Criteria
updated_atinteger or nullNoUpdated At

DELETE /v1/evals/{eval_id}​

Delete an evaluation

Delete an evaluation at the model provider. This cannot be undone.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
custom_llm_providerquerystring or nullNo

Example request:

curl -X DELETE "http://localhost:4000/v1/evals/eval_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json DeleteEvalResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
deletedbooleanYesDeleted
eval_idstringYesEval Id
objectstringNoObject

POST /v1/evals/{eval_id}/cancel​

Cancel an evaluation

Stop an evaluation whose runs are still in progress. Results already graded are kept.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
custom_llm_providerquerystring or nullNo

Request body (application/json, object):

FieldTypeRequiredDescription
modelstringNo

Example request:

curl -X POST "http://localhost:4000/v1/evals/eval_id-123/cancel" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json CancelEvalResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
objectstringNoObject
status"cancelled"YesStatus

GET /v1/evals/{eval_id}/runs​

List the runs of an evaluation

List the runs of one evaluation with their status and pass and fail counts, a page at a time. Nothing is changed.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
limitqueryinteger or nullNo
afterquerystring or nullNo
beforequerystring or nullNo
orderquerystring or nullNo
custom_llm_providerquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/v1/evals/eval_id-123/runs" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json ListRunsResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
dataarray of RunYesData
first_idstring or nullNoFirst Id
has_morebooleanNoHas More
last_idstring or nullNoLast Id
objectstringNoObject

POST /v1/evals/{eval_id}/runs​

Start a run of an evaluation

Start grading: run an evaluation over a data source, either a file of rows that already hold the answers or a model and the prompts to send it. The run starts queued, so read it again to follow its progress and results. The provider bills the model calls a run makes.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
custom_llm_providerquerystring or nullNo

Request body (application/json, object):

FieldTypeRequiredDescription
data_sourceobjectYesWhat to grade: a file of rows, or a model and the prompts to send it
metadataobject or nullNoUp to 16 labels of your own
modelstring or nullNoThe gateway model name whose provider account runs the call, used only for routing
namestring or nullNoA name to recognise the run by

Example request:

curl -X POST "http://localhost:4000/v1/evals/eval_id-123/runs" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data_source": {
"input_messages": {
"template": [
{
"content": "Label this ticket: {{ item.ticket }}",
"role": "user"
}
],
"type": "template"
},
"model": "gpt-5-mini",
"source": {
"id": "file-4b5a4c6d9e7f0a1b",
"type": "file_id"
},
"type": "completions"
},
"name": "gpt-5-mini baseline"
}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Run
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
completed_atinteger or nullNoCompleted At
created_atintegerYesCreated At
data_sourceobjectYesData Source
errorobject or nullNoError
eval_idstringYesEval Id
idstringYesId
metadataobject or nullNoMetadata
modelstring or nullNoModel
namestring or nullNoName
objectstringNoObject
per_model_usageany or nullNoPer Model Usage
per_testing_criteria_resultsarray of PerTestingCriteriaResult or nullNoPer Testing Criteria Results
report_urlstring or nullNoReport Url
result_countsobject or nullNoResult Counts
shared_with_openaiboolean or nullNoShared With Openai
started_atinteger or nullNoStarted At
statusenum: "queued", "running", "completed", "failed", "cancelled"YesStatus

GET /v1/evals/{eval_id}/runs/{run_id}​

Read one run and its results

Read one run: its status, how many rows passed, failed or errored for each grader, and the provider's report link. Nothing is changed.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
run_idpathstringYes
custom_llm_providerquerystring or nullNo

Example request:

curl -X GET "http://localhost:4000/v1/evals/eval_id-123/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json Run
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
completed_atinteger or nullNoCompleted At
created_atintegerYesCreated At
data_sourceobjectYesData Source
errorobject or nullNoError
eval_idstringYesEval Id
idstringYesId
metadataobject or nullNoMetadata
modelstring or nullNoModel
namestring or nullNoName
objectstringNoObject
per_model_usageany or nullNoPer Model Usage
per_testing_criteria_resultsarray of PerTestingCriteriaResult or nullNoPer Testing Criteria Results
report_urlstring or nullNoReport Url
result_countsobject or nullNoResult Counts
shared_with_openaiboolean or nullNoShared With Openai
started_atinteger or nullNoStarted At
statusenum: "queued", "running", "completed", "failed", "cancelled"YesStatus

POST /v1/evals/{eval_id}/runs/{run_id}​

Cancel a run

Stop a queued or running run. Rows already graded keep their results.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
run_idpathstringYes
custom_llm_providerquerystring or nullNo

Request body (application/json, object):

FieldTypeRequiredDescription
modelstringNo

Example request:

curl -X POST "http://localhost:4000/v1/evals/eval_id-123/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Responses:

StatusDescriptionBody
200Successful Responseapplication/json CancelRunResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
idstringYesId
objectstringNoObject
status"cancelled"YesStatus

DELETE /v1/evals/{eval_id}/runs/{run_id}​

Delete a run

Delete one run and its results at the model provider. The evaluation itself is kept. This cannot be undone.

Only a proxy admin key may call it, or a key whose allowed_routes lists this route. The gateway passes the call to the model provider, OpenAI unless custom_llm_provider names another, and the account it uses can be picked with a gateway model name in the x-spanway-model header, the model query parameter or the model body field.

Parameters:

NameInTypeRequiredDescription
eval_idpathstringYes
run_idpathstringYes
custom_llm_providerquerystring or nullNo

Example request:

curl -X DELETE "http://localhost:4000/v1/evals/eval_id-123/runs/run_id-123" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200Successful Responseapplication/json RunDeleteResponse
400The request is invalid, for example a missing or unsupported parameter, a prompt longer than the model's context window, content a guardrail or the provider refused, or no deployment that satisfies the data policy of the key, team or organization (No deployment of model 'gpt-5.5' satisfies the data policy: ...). error.message says which.application/json ProxyError
401No valid key was sent, or the key has expired or is blocked.application/json ProxyError
403The key is valid but may not use this model, route or feature. A guardrail block is a 400, not a 403.application/json ProxyError
404The route or resource does not exist, or this key cannot see it. An unknown model name is a 400 (Invalid model name passed in model=...).application/json ProxyError
408The provider did not answer before the request timed out.application/json ProxyError
413The request body is larger than max_request_size_mb (100 MB by default), or an upload is larger than its own limit. The gateway refused it before reading the key. Docsapplication/json object
422The request body does not have the expected shape, or a budget (key, user, team, organization or end user) is used up: error.type is budget_exceeded. The budget status is spanway_settings.budget_exceeded_status_code, 422 by default. With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError or HTTPValidationError
429Too many requests. A provider limit or a gateway limit (requests or tokens per minute, or parallel requests) refused the call, and error.type says which. A gateway limit also sends the RateLimit headers and x-spanway-rate-limited-by. Docs With access requests licensed, a key or team limit refusal also carries error.request_increase, which names the access request to file for a higher limit. Ask from an errorapplication/json ProxyError
500The gateway or the provider failed unexpectedly, or the gateway could not reach the provider. Retry, and quote the request id if it keeps failing.application/json ProxyError
502The provider, or a proxy in front of it, answered with something that is not a valid response.application/json ProxyError
503The provider is overloaded or unavailable. With Redis rate limiting, a 503 also means the gateway could not check the rate limit counters and refused the request, because fail_closed_rate_limit_enforcement is on. Docsapplication/json ProxyError

Response fields (200):

FieldTypeRequiredDescription
deletedboolean or nullNoDeleted
objectstring or nullNoObject
run_idstringYesRun Id