> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.apologist.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.apologist.ai/_mcp/server.

# Create Benchmark Run

POST https://your-agent-domain.com/api/v1/benchmarks/{id}/runs
Content-Type: application/json

Executes a benchmark run and returns the aggregated result with nested evaluators, questions, and a flat evaluations array.

Reference: https://docs.apologist.ai/agent-api/api-reference/benchmark-runs/run-benchmark

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: agent-api
  version: 1.0.0
paths:
  /benchmarks/{id}/runs:
    post:
      operationId: runBenchmark
      summary: Create Benchmark Run
      description: >-
        Executes a benchmark run and returns the aggregated result with nested
        evaluators, questions, and a flat evaluations array.
      tags:
        - benchmarks
      parameters:
        - name: id
          in: path
          description: The id or key of the benchmark
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          description: API key for authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Benchmark run result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Benchmarks_runBenchmark_Response_200'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not Found - referenced completion not found
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Invalid request payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: Any type
        '503':
          description: Service Unavailable - Benchmark not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BenchmarkRunRequest'
servers:
  - url: https://your-agent-domain.com/api/v1
    description: Production server
components:
  schemas:
    BenchmarkRunRequestContent:
      oneOf:
        - type: string
        - type: array
          items:
            description: Any type
      description: Content to evaluate. Required when `source_id` is supplied.
      title: BenchmarkRunRequestContent
    BenchmarkRunRequestReasoningEffort:
      type: string
      enum:
        - low
        - medium
        - high
      title: BenchmarkRunRequestReasoningEffort
    BenchmarkRunRequestVerbosity:
      type: string
      enum:
        - minimal
        - low
        - medium
        - high
      title: BenchmarkRunRequestVerbosity
    BenchmarkRunRequest:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/BenchmarkRunRequestContent'
          description: Content to evaluate. Required when `source_id` is supplied.
        completion_id:
          type:
            - string
            - 'null'
          description: Completion UUID whose stored response should be evaluated.
        source_id:
          type:
            - integer
            - 'null'
        model:
          type:
            - string
            - 'null'
        num_responses:
          type:
            - integer
            - 'null'
        use_question_variants:
          type:
            - boolean
            - 'null'
        reasoning_effort:
          oneOf:
            - $ref: '#/components/schemas/BenchmarkRunRequestReasoningEffort'
            - type: 'null'
        verbosity:
          oneOf:
            - $ref: '#/components/schemas/BenchmarkRunRequestVerbosity'
            - type: 'null'
        score_threshold:
          type:
            - number
            - 'null'
          format: double
        value_threshold:
          type:
            - number
            - 'null'
          format: double
        temperature:
          type:
            - number
            - 'null'
          format: double
        top_p:
          type:
            - number
            - 'null'
          format: double
        frequency_penalty:
          type:
            - number
            - 'null'
          format: double
        presence_penalty:
          type:
            - number
            - 'null'
          format: double
      description: >-
        All fields are optional; an empty body runs the benchmark's configured
        questions. Supplying `completion_id` or `source_id` (with `content`)
        short-circuits the questions loop and evaluates the provided content
        once per evaluator.
      title: BenchmarkRunRequest
    Benchmarks_runBenchmark_Response_200:
      type: object
      properties: {}
      title: Benchmarks_runBenchmark_Response_200
    Error:
      type: object
      properties:
        success:
          type: boolean
        errors:
          type: array
          items:
            type: string
      required:
        - success
        - errors
      title: Error
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{}
```

**SDK Code**

```typescript
import { ApologistAgentClient } from "apologist";

async function main() {
    const client = new ApologistAgentClient({
        apiKey: "YOUR_API_KEY_HERE",
    });
    await client.benchmarks.runBenchmark("id", {});
}
main();

```

```python
from apologist import ApologistAgent

client = ApologistAgent(
    api_key="YOUR_API_KEY_HERE",
)

client.benchmarks.run_benchmark(
    id="id",
)

```

```java
package com.example.usage;

import ai.apologist.AgentClient;
import ai.apologist.resources.benchmarks.requests.BenchmarkRunRequest;

public class Example {
    public static void main(String[] args) {
        AgentClient client = AgentClient
            .builder()
            .apiKey("YOUR_API_KEY_HERE")
            .build();

        client.benchmarks().runBenchmark(
            "id",
            BenchmarkRunRequest
                .builder()
                .build()
        );
    }
}
```

```ruby
require "apologist"

client = Apologist::AgentClient.new(api_key: "YOUR_API_KEY_HERE")

client.benchmarks.run_benchmark(id: "id")

```

```csharp
using Apologist;
using System.Threading.Tasks;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new AgentClient(
            apiKey: "YOUR_API_KEY_HERE"
        );

        await client.Benchmarks.RunBenchmarkAsync(
            new BenchmarkRunRequest {
                Id = "id"
            }
        );
    }

}

```

```go
package example

import (
    context "context"

    apgsdkgo "github.com/apologist-project/apg-sdk-go"
    client "github.com/apologist-project/apg-sdk-go/client"
    option "github.com/apologist-project/apg-sdk-go/option"
)

func do() {
    client := client.NewApologistAgentClient(
        option.WithAPIKey(
            "YOUR_API_KEY_HERE",
        ),
    )
    request := &apgsdkgo.BenchmarkRunRequest{
        ID: "id",
    }
    client.Benchmarks.RunBenchmark(
        context.TODO(),
        request,
    )
}

```

```php
<?php

namespace Example;

use Apologist\AgentClient;
use Apologist\Benchmarks\Requests\BenchmarkRunRequest;

$client = new AgentClient(
    apiKey: 'YOUR_API_KEY_HERE',
);
$client->benchmarks->runBenchmark(
    'id',
    new BenchmarkRunRequest([]),
);

```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://your-agent-domain.com/api/v1/benchmarks/id/runs")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```