Skip to content

Benchmarks API

The Benchmarks API exposes the benchmark system that validates GPU hosts: recent benchmark runs, per-market metric aggregates and thresholds, and the metric/operation definitions behind them. It also contains the routes nodes use to submit their benchmark results.

Benchmark data

ts
import { 
createNosanaClient
,
NosanaNetwork
} from '@nosana/kit';
const
client
=
createNosanaClient
(
NosanaNetwork
.
MAINNET
, {
api
: {
apiKey
:
process
.
env
.
NOSANA_API_KEY
},
}); // Recent benchmark runs across the network const
recent
= await
client
.
api
.
benchmarks
.
getRecent
();
// Per-market metric aggregates const
aggregates
= await
client
.
api
.
benchmarks
.
getMarketMetricAggregates
();
// Current benchmark version const
version
= await
client
.
api
.
benchmarks
.
getVersion
();
MethodHTTPPathDescription
benchmarks.getRecent()GET/benchmarks/recentRecent benchmarks
benchmarks.getMarketMetricAggregates(query?)GET/benchmarks/market-metric-aggregatesPer-market metric aggregates
benchmarks.getVersion()GET/benchmarks/benchmark-versionCurrent benchmark version

Thresholds & definitions

The thresholds a host must meet, and the definitions of the metrics and operations they are computed from:

MethodHTTPPathDescription
benchmarks.getThresholds(query?)GET/benchmarks/thresholdsBenchmark thresholds
benchmarks.getMarketThresholds(query?)GET/benchmarks/market-thresholdsPer-market thresholds
benchmarks.getMetrics(query?)GET/benchmarks/metricsMetric definitions
benchmarks.getOperations()GET/benchmarks/operationsOperation definitions
benchmarks.getMetricProcessors()GET/benchmarks/metric-processorsMetric processors
benchmarks.getTemplatesConfig()GET/benchmark-templates/configStored benchmark template config
benchmarks.getTemplatesRefresh()GET/benchmark-templates/refreshPreview benchmark template diff

Node-facing routes

Used by the node software during benchmarking — you normally don't call these unless you are building or operating a host:

MethodHTTPPathDescription
benchmarks.getPrediction(id, body)POST/benchmarks/{id}/predictionBenchmark prediction for a node
benchmarks.seed(id, body)POST/benchmarks/{id}/seedSeed a node benchmark
benchmarks.submitResults(id, body)POST/benchmarks/{id}/submit-resultsSubmit benchmark results

Recent benchmark runs for one specific node are available on the Hosts API as hosts.getRecentBenchmarks(id).