Overview
Benchmarks endpointsAvailable Operations
- getBenchmarks - List Benchmarks
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Benchmarks endpoints
import { OpenRouter } from "@openrouter/sdk";
const openRouter = new OpenRouter({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const result = await openRouter.benchmarks.getBenchmarks();
console.log(result);
}
run();
import { OpenRouterCore } from "@openrouter/sdk/core.js";
import { benchmarksGetBenchmarks } from "@openrouter/sdk/funcs/benchmarksGetBenchmarks.js";
// Use `OpenRouterCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const openRouter = new OpenRouterCore({
httpReferer: "<value>",
appTitle: "<value>",
appCategories: "<value>",
apiKey: process.env["OPENROUTER_API_KEY"] ?? "",
});
async function run() {
const res = await benchmarksGetBenchmarks(openRouter);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("benchmarksGetBenchmarks failed:", res.error);
}
}
run();
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetBenchmarksRequest | :heavy_check_mark: | The request object to use for the request. |
options | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries | RetryConfig | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.BadRequestResponseError | 400 | application/json |
| errors.UnauthorizedResponseError | 401 | application/json |
| errors.TooManyRequestsResponseError | 429 | application/json |
| errors.InternalServerResponseError | 500 | application/json |
| errors.OpenRouterDefaultError | 4XX, 5XX | */* |