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

NameTypeRequiredDescription
model
stringRequiredModel identifier.
input
arrayRequiredInitial input items or messages.
tools
arrayTool definitions available to the model.
stop
objectStop conditions for this run.
metadata
objectOpaque 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.