Skip to main content

Benchmarks

Benchmarks​

@toothfairyai/sdk@latest…

Benchmark Management Module Handles benchmark CRUD operations for performance testing.

Accessed via client.benchmarks.

Methods​

MethodHTTPEndpoint
createPOSTPOST /benchmark/create
updatePOSTPOST /benchmark/update
deleteDELETEDELETE /benchmark/delete/{id}
getGETGET /benchmark/get/{id}
listGETGET /benchmark/list
runPOSTPOST /benchmark/run
getRunGETGET /benchmark/run/{id}
listRunsGETGET /benchmark/runs
cancelRunDELETEDELETE /benchmark/run/{id}
waitForRun—derived

create​

Create a new benchmark

async create(
name: string,
options: {
description?: string;
questions?: BenchmarkQuestion[];
files?: string[];
} = {}
)

Endpoint: POST /benchmark/create · API service

Request fields​

FieldTypeRequiredDescription
idstringnoUnique identifier
workspaceidstringyesUnique workspace identifier (UUID v4)
namestringyesName of the resource
descriptionstringnoDetailed description of purpose and capabilities
questionsstringnoJSON-encoded list of benchmark questions
filesstringnoList of file keys associated with the benchmark
metadatastringnoArbitrary metadata key-value pairs (JSON)
createdBystringnoID of the user who created this resource
updatedBystringnoID of the user who last updated this resource
createdAtstringnoTimestamp when this resource was created
creationTimestringnoUnix timestamp when the resource was created
updatedAtstringnoTimestamp when this resource was last updated

Response fields​

FieldTypeDescription
idstringUnique identifier for the benchmark
namestringName of the resource
descriptionstringBenchmark description
questionsarray<object>List of benchmark questions
workspaceIDstringUnique workspace identifier (UUID v4)
createdAtstringTimestamp when this resource was created
creationTimeintegerUnix timestamp when the resource was created
updatedAtstringTimestamp when this resource was last updated
metadataobjectArbitrary metadata key-value pairs (JSON)
filesarray<string>Associated file paths

Example​

const result = await client.benchmarks.create('…');

update​

Update an existing benchmark

async update(
benchmarkId: string,
options: {
name?: string;
description?: string;
questions?: BenchmarkQuestion[];
files?: string[];
} = {}
)

Endpoint: POST /benchmark/update · API service

Request fields​

FieldTypeRequiredDescription
idstringyesUnique identifier
workspaceidstringnoUnique workspace identifier (UUID v4)
namestringnoName of the resource
descriptionstringnoDetailed description of purpose and capabilities
questionsstringnoJSON-encoded list of benchmark questions
filesstringnoList of file keys associated with the benchmark
metadatastringnoArbitrary metadata key-value pairs (JSON)
createdBystringnoID of the user who created this resource
updatedBystringnoID of the user who last updated this resource
createdAtstringnoTimestamp when this resource was created
creationTimestringnoUnix timestamp when the resource was created
updatedAtstringnoTimestamp when this resource was last updated

Response​

Returns the Benchmark object — fields documented in the create section above.

Example​

const result = await client.benchmarks.update('agent-id');

delete​

Delete a benchmark

async delete(benchmarkId: string): Promise<

Endpoint: DELETE /benchmark/delete/{id} · API service

Example​

const result = await client.benchmarks.delete('agent-id');

get​

Get a benchmark by ID

async get(benchmarkId: string)

Endpoint: GET /benchmark/get/{id} · API service

Response​

Returns the Benchmark object — fields documented in the create section above.

Example​

const result = await client.benchmarks.get('agent-id');

list​

List all benchmarks in the workspace

async list(limit?: number, offset?: number)

Endpoint: GET /benchmark/list · API service

Example​

const result = await client.benchmarks.list();

run​

async run(
benchmarkId: string,
agentId: string,
options: Omit<BenchmarkRunCreateData, 'benchmark_id' | 'agent_id'> = {}
)

Endpoint: POST /benchmark/run · API service

Request fields​

FieldTypeRequiredDescription
benchmark_idstringyesID of the benchmark to run
agent_idstringyesID of the agent to test
typestringnoRun type: 'bm' (standard evaluation) or 'abm' (consistency check)

Allowed: bm, abm | | mode | string | no | ABM mode - only for type='abm': 'static' (scripted questions) or 'dynamic' (AI-generated probing)

Allowed: static, dynamic | | reviewer_agent_id | string | no | ID of the reviewer agent (default: 'sorcerer') | | weights | object | no | Category weights for scoring, e.g. {"correctness": 0.5, "reasoning": 0.3, "context_usage": 0.2} | | passing_score | number | no | Minimum score to pass (0-1). Default: 0.9 | | num_questions | integer | no | Number of questions to use. Default: all questions in the benchmark | | name | string | no | Optional name for the run | | userid | string | no | Optional user ID for the run |

Response fields​

FieldTypeDescription
idstringUnique identifier for the benchmark run
namestringName of the benchmark run
statusstringCurrent status of the run

Allowed: dispatched, inProgress, completed, inError, cancelled, cancellationRequested | | type | string | Run type: 'bm' (standard evaluation) or 'abm' (consistency check)

Allowed: bm, abm | | benchmark_id | string | ID of the benchmark that was run | | agent_id | string | ID of the agent that was tested | | reviewer_agent_id | string | ID of the reviewer agent used for scoring | | duration | number | Run duration in seconds | | score | number | Overall score (0-1 for BM: average_overall_score, 0-1 for ABM: average_consistency_score) | | batch_meta | object | Parsed batch metadata from a benchmark run | | created_at | string | ISO 8601 timestamp when the run was created | | updated_at | string | ISO 8601 timestamp when the run was last updated |

Example​

const result = await client.benchmarks.run('agent-id', 'agent-id');

getRun​

async getRun(runId: string)

Endpoint: GET /benchmark/run/{id} · API service

Response​

Returns the BenchmarkRun object — fields documented in the run section above.

Example​

const result = await client.benchmarks.getRun('agent-id');

listRuns​

async listRuns(
options: {
agent_id?: string;
benchmark_id?: string;
type?: string;
status?: string;
limit?: number;
} = {}
)

Endpoint: GET /benchmark/runs · API service

Example​

const result = await client.benchmarks.listRuns();

cancelRun​

async cancelRun(runId: string): Promise<

Endpoint: DELETE /benchmark/run/{id}

Field-level schema not available in the API spec for this endpoint.

Example​

const result = await client.benchmarks.cancelRun('agent-id');

waitForRun​

async waitForRun(
runId: string,
pollInterval: number = 10000,
timeout: number = 1800000
)

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example​

const result = await client.benchmarks.waitForRun('agent-id');