Skip to content

five-on-it / apps/creator/src/openrouter / OpenRouterOptions

Interface: OpenRouterOptions ​

Defined in: apps/creator/src/openrouter.ts:29

How to reach OpenRouter, and with which models.

Properties ​

apiKey ​

apiKey: string

Defined in: apps/creator/src/openrouter.ts:31

The API key (never a creator's own: the platform's, OPENROUTER_API_KEY).


backoffMs? ​

optional backoffMs?: number

Defined in: apps/creator/src/openrouter.ts:43


fetch? ​

optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: apps/creator/src/openrouter.ts:45

The HTTP client.

Call Signature ​

(input, init?): Promise<Response>

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise<Response>

Call Signature ​

(input, init?): Promise<Response>

MDN Reference

Parameters ​
input ​

string | URL | Request

init? ​

RequestInit

Returns ​

Promise<Response>


models ​

models: readonly string[]

Defined in: apps/creator/src/openrouter.ts:33

The models in order: the first is asked, the others are its fallbacks.


price? ​

optional price?: Price

Defined in: apps/creator/src/openrouter.ts:35

What a call costs at most, the dearest of the models (fetchPrices); a conservative guess when not known.


referer? ​

optional referer?: string

Defined in: apps/creator/src/openrouter.ts:39

The platform's address and name, which OpenRouter's dashboard shows.


retries? ​

optional retries?: number

Defined in: apps/creator/src/openrouter.ts:42

How often a busy or broken provider is tried again (2 by default), and the first wait (ms).


title? ​

optional title?: string

Defined in: apps/creator/src/openrouter.ts:40


url? ​

optional url?: string

Defined in: apps/creator/src/openrouter.ts:37

The endpoint (OpenRouter's by default).