---
title: "Score a ScenarioRun."
method: POST
path: "/v1/scenarios/runs/{id}/score"
tags: ["Scenario"]
---

# Score a ScenarioRun.

`POST /v1/scenarios/runs/{id}/score`

Score a currently running ScenarioRun.

## Path parameters

- `id` string, required

## Response `200`

OK

- ScenarioRunView — A ScenarioRunView represents a single run of a Scenario on a Devbox. When completed, the ScenarioRun will contain the final score and output of the run.
  - `id` string, required — ID of the ScenarioRun.
  - `name` string, nullable — Optional name of ScenarioRun.
  - `scenario_id` string, required — ID of the Scenario that has been run.
  - `devbox_id` string, required — ID of the Devbox on which the Scenario is running.
  - `benchmark_run_id` string, nullable — ID of the BenchmarkRun that this Scenario is associated with, if any.
  - `scoring_contract_result` ScoringContractResultView — A ScoringContractResultView represents the result of running all scoring functions on a given input context.
    - `score` number, float, required — Total score for all scoring contracts. This will be a value between 0 and 1.
    - `scoring_function_results` ScoringFunctionResultView[], required — List of all individual scoring function results.
      - `score` number, float, required — Final score for the given scoring function.
      - `scoring_function_name` string, required — Scoring function name that ran.
      - `output` string, required — Log output of the scoring function.
      - `state` 'unknown' | 'complete' | 'error', required
  - `start_time_ms` integer — The time that the scenario started
  - `duration_ms` integer, nullable — Duration scenario took to run.
  - `state` 'running' | 'scoring' | 'scored' | 'completed' | 'canceled' | 'timeout' | 'failed', required
  - `metadata` object, required — User defined metadata to attach to the scenario run for organization.
  - `purpose` string, nullable — Purpose of the ScenarioRun.
  - `environment_variables` object, nullable — Environment variables used to run the scenario.
  - `secrets_provided` object, nullable — User secrets used to run the scenario.

---

[API](https://skmtc.dev/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.dev/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runloopai/runloop-api/revisions/e9dc776053e4/schema)
