Parameters
- input: {
context?: Record<string, unknown>;
messages: {
content?: string;
content_parts?: Record<string, unknown>[];
resume_token?: string;
role: string;
structured_output?: unknown;
tool_calls?: {
arguments: Record<string, unknown>;
id: string;
name: string;
thought_signature?: string;
}[];
tool_results?: {
content?: string;
id: string;
name: string;
resolution?: unknown;
}[];
}[];
opts: {
max_tokens?: number;
model: string;
server_tools?: Record<string, unknown>[];
structured_output?: Record<string, unknown>;
temperature?: number;
tool_choice?: string;
tools?: {
function: {
description?: string;
name: string;
parameters: Record<string, unknown>;
};
type: string;
}[];
};
session_id?: string;
}Optionalcontext?: Record<string, unknown>
messages: {
content?: string;
content_parts?: Record<string, unknown>[];
resume_token?: string;
role: string;
structured_output?: unknown;
tool_calls?: {
arguments: Record<string, unknown>;
id: string;
name: string;
thought_signature?: string;
}[];
tool_results?: {
content?: string;
id: string;
name: string;
resolution?: unknown;
}[];
}[]
opts: {
max_tokens?: number;
model: string;
server_tools?: Record<string, unknown>[];
structured_output?: Record<string, unknown>;
temperature?: number;
tool_choice?: string;
tools?: {
function: {
description?: string;
name: string;
parameters: Record<string, unknown>;
};
type: string;
}[];
}
Optionalsession_id?: string
The completed AI response, including the generated message, finish reason, and token usage.
Create a chat completion Sends a list of messages to the configured AI provider and returns a single completion. Use this endpoint when you want direct, low-level access to the underlying model without any workflow or agent orchestration. The authenticated app must have the
llm_callsentitlement enabled on its plan. Requests that exceed the plan quota are rejected with402. Token usage is recorded against the authenticated app and organization. Supplytoolsandtool_choiceto enable OpenAI-compatible function calling. Useserver_toolsto activate platform-managed tools such as search that run on the server side before the response is returned.