Example Usage
import { ServerToolEngine } from "@openrouter/sdk/models";
let value: ServerToolEngine = {
byok: "none",
dataRegions: [
"global",
"us",
],
defaultMode: "auto",
executedBy: "openrouter",
id: "exa",
name: "Exa",
pricing: [
{
maxUnitsPerCall: 769230,
mode: "auto",
price: "0.007",
unit: "request",
},
],
pricingDocUrl: null,
pricingSource: "openrouter",
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
byok | models.BYOK | :heavy_check_mark: | Whether the engine needs the caller’s own key, saved in plugin settings: required (OpenRouter holds none), optional (OpenRouter’s key is used unless the caller saved one), or none | none |
dataRegions | models.ServerToolEngineDataRegion[] | :heavy_check_mark: | The data regions whose requests this engine serves without leaving the region. A request pinned to a region can only use engines that list it; global is always listed. | [ “global”, “us” ] |
defaultMode | string | :heavy_check_mark: | The parameters.mode a request without one runs and bills as; null for engines without modes. The pricing[] row with this mode is what an unmoded request bills | auto |
executedBy | models.ServerToolExecutedBy | :heavy_check_mark: | Who runs the tool call: the model provider during inference (provider), OpenRouter (openrouter), or the caller’s application after the call is returned (client). | openrouter |
id | string | :heavy_check_mark: | The parameters.engine value that selects this engine; null for the single engine of a tool without an engine parameter | exa |
name | string | :heavy_check_mark: | N/A | Exa |
pricing | models.ServerToolPrice[] | :heavy_check_mark: | The rows OpenRouter bills; non-empty exactly when pricing_source is openrouter | |
pricingDocUrl | string | :heavy_check_mark: | Where the rates are documented when pricing_source is provider or byok; null otherwise | null |
pricingSource | models.PricingSource | :heavy_check_mark: | Who bills the engine’s calls beyond the model’s tokens: openrouter (the pricing rows, from the caller’s credits), provider (a per-call tool fee from the model’s provider on the inference call, at its own rates), byok (the engine’s vendor, against the caller’s own key), or none (no charge) | openrouter |