> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runloop.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Complete a BenchmarkRun.

> Complete a currently running BenchmarkRun.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json post /v1/benchmark_runs/{id}/complete
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/benchmark_runs/{id}/complete:
    post:
      tags:
        - Benchmark
      summary: Complete a BenchmarkRun.
      description: Complete a currently running BenchmarkRun.
      operationId: completeBenchmarkRun
      parameters:
        - name: id
          in: path
          description: The BenchmarkRun ID.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BenchmarkRunView'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Runloop from '@runloop/api-client';

            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });

            const benchmarkRunView = await client.benchmarkRuns.complete('id');

            console.log(benchmarkRunView.id);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            benchmark_run_view = client.benchmark_runs.complete(
                "id",
            )
            print(benchmark_run_view.id)
components:
  schemas:
    BenchmarkRunView:
      type: object
      description: >-
        A BenchmarkRunView represents a run of a complete set of Scenarios,
        organized under a Benchmark or created by a BenchmarkJob.
      properties:
        id:
          type: string
          description: The ID of the BenchmarkRun.
        benchmark_id:
          description: >-
            The ID of the Benchmark definition. Present if run was created from
            a benchmark definition.
          type:
            - string
            - 'null'
        name:
          description: The name of the BenchmarkRun.
          type:
            - string
            - 'null'
        start_time_ms:
          type: integer
          format: int64
          description: >-
            The time the benchmark run execution started (Unix timestamp
            milliseconds).
        duration_ms:
          format: int64
          description: The duration for the BenchmarkRun to complete.
          type:
            - integer
            - 'null'
        state:
          $ref: '#/components/schemas/BenchmarkRunState'
          description: The state of the BenchmarkRun.
        score:
          format: float
          description: >-
            The final score across the BenchmarkRun, present once completed.
            Calculated as sum of scenario scores / number of scenario runs.
          type:
            - number
            - 'null'
        metadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            User defined metadata to attach to the benchmark run for
            organization.
        purpose:
          description: Purpose of the run.
          type:
            - string
            - 'null'
        environment_variables:
          additionalProperties:
            type: string
          description: Environment variables used to run the benchmark.
          type:
            - object
            - 'null'
        secrets_provided:
          additionalProperties:
            type: string
          description: >-
            User secrets used to run the benchmark. Example: {"DB_PASS":
            "DATABASE_PASSWORD"} would set the environment variable 'DB_PASS' on
            all scenario devboxes to the value of the secret
            'DATABASE_PASSWORD'.
          type:
            - object
            - 'null'
      required:
        - id
        - start_time_ms
        - state
        - metadata
    BenchmarkRunState:
      type: string
      enum:
        - running
        - canceled
        - completed
        - failed
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````