Call Model API Reference
Quick reference for methods, params, and return shape.
Methods
Signatures
client.callModel(params)
client.callModel.stream(params)
client.callModel.withTrace(params)Parameter Types
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Required | Model identifier. |
input | array | Required | Initial input items or messages. |
tools | array | Tool definitions available to the model. | |
stop | object | Stop conditions for this run. | |
metadata | object | Opaque metadata echoed in traces. |
Return Fields
call-model-return.ts
type CallModelResult = {
id: string;
items: Array<unknown>;
stop_reason: string;
next_turn?: Record<string, unknown>;
};Forward compatibility
Prefer checking required fields only and keep return object parsing resilient to additive fields.