ParametersT - TypeScript SDK

ParametersT method reference

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

(parameters)

Overview

Parameters endpoints

Available Operations

  • getParameters - Get a model’s supported parameters and data about which are most popular

getParameters

Get a model’s supported parameters and data about which are most popular

Example Usage

1import { OpenRouter } from "@openrouter/sdk";
2
3const openRouter = new OpenRouter();
4
5async function run() {
6 const result = await openRouter.parameters.getParameters({
7 bearer: process.env["OPENROUTER_BEARER"] ?? "",
8 }, {
9 author: "<value>",
10 slug: "<value>",
11 provider: "Google AI Studio",
12 });
13
14 console.log(result);
15}
16
17run();

Standalone function

The standalone function version of this method:

1import { OpenRouterCore } from "@openrouter/sdk/core.js";
2import { parametersGetParameters } from "@openrouter/sdk/funcs/parametersGetParameters.js";
3
4// Use `OpenRouterCore` for best tree-shaking performance.
5// You can create one instance of it to use across an application.
6const openRouter = new OpenRouterCore();
7
8async function run() {
9 const res = await parametersGetParameters(openRouter, {
10 bearer: process.env["OPENROUTER_BEARER"] ?? "",
11 }, {
12 author: "<value>",
13 slug: "<value>",
14 provider: "Google AI Studio",
15 });
16 if (res.ok) {
17 const { value: result } = res;
18 console.log(result);
19 } else {
20 console.log("parametersGetParameters failed:", res.error);
21 }
22}
23
24run();

Parameters

ParameterTypeRequiredDescription
requestoperations.GetParametersRequest✔️The request object to use for the request.
securityoperations.GetParametersSecurity✔️The security requirements to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions 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.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.GetParametersResponse>

Errors

Error TypeStatus CodeContent Type
errors.UnauthorizedResponseError401application/json
errors.NotFoundResponseError404application/json
errors.InternalServerResponseError500application/json
errors.OpenRouterDefaultError4XX, 5XX*/*