Benchmarks - Go SDK

Benchmarks method reference

The Go SDK and docs are currently in beta. Report issues on GitHub.

Overview

Benchmarks endpoints

Available Operations

GetBenchmarks

Unified benchmark endpoint that aggregates scores from multiple benchmark sources (Artificial Analysis, Design Arena). Filter by source to reproduce the exact shapes from the legacy per-source endpoints, or use task_type to find models suited for specific workloads. Authenticate with any valid OpenRouter API key. Rate-limited to 30 requests/minute per key and 500 requests/day per account.

Example Usage

1package main
2
3import(
4 "context"
5 "os"
6 openrouter "github.com/OpenRouterTeam/go-sdk"
7 "github.com/OpenRouterTeam/go-sdk/models/operations"
8 "log"
9)
10
11func main() {
12 ctx := context.Background()
13
14 s := openrouter.New(
15 openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")),
16 )
17
18 res, err := s.Benchmarks.GetBenchmarks(ctx, operations.GetBenchmarksRequest{
19 Source: operations.SourceArtificialAnalysis,
20 MaxResults: openrouter.Pointer[int64](20),
21 })
22 if err != nil {
23 log.Fatal(err)
24 }
25 if res != nil {
26 // handle response
27 }
28}

Parameters

ParameterTypeRequiredDescription
ctxcontext.Context✔️The context to use for the request.
requestoperations.GetBenchmarksRequest✔️The request object to use for the request.
opts[]operations.OptionThe options for this request.

Response

*components.UnifiedBenchmarksResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.BadRequestResponseError400application/json
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.TooManyRequestsResponseError429application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*