Example Usage
import { DecisionsRequest } from "@openrouter/sdk/models";
let value: DecisionsRequest = {
model: "Fiesta",
questions: {},
state: {
"key": "Virginia",
},
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
assets | Record<string, models.DecisionsImageAsset> | ➖ | Images keyed by reference string, as in TypeSafe’s API. Write a reference wherever the image belongs in state, instructions, or criteria; every asset must be referenced at least once, or the request fails with 400 naming the unused key. TypeSafe Jev endpoints receive assets as written and read a reference as a whole string value or inside longer text. Every other provider has each whole-string reference resolved to an image_url part before the request is sent, so it is accepted only where that provider reads image_url parts (top-level state items), and a reference inside longer text fails with 400. image_url parts and assets can be mixed in one request. | |
model | string | ✔️ | N/A | |
provider | models.ProviderPreferences | ➖ | N/A | { “allow_fallbacks”: true } |
questions | Record<string, models.Questions> | ✔️ | N/A | |
sessionId | string | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 |
state | models.State | ✔️ | The content to evaluate: a plain string, or a JSON object or array of related context. | |
trace | models.TraceConfig | ➖ | Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | { “trace_id”: “trace-abc123”, “trace_name”: “my-app-trace” } |
user | string | ➖ | N/A |