Skip to content

Chat

List Sessions
client.beta.chat.list(ChatListParams { organization_id, page_size, page_token, project_id } query?, RequestOptionsoptions?): PaginatedCursor<ChatListResponse { last_updated_at, session_id, generated_title, 2 more } >
GET/api/v1/chat
Create Session
client.beta.chat.create(ChatCreateParams { organization_id, project_id, index_ids } params?, RequestOptionsoptions?): ChatCreateResponse { last_updated_at, session_id, generated_title, 2 more }
POST/api/v1/chat
Get Full Session
client.beta.chat.retrieve(stringsessionID, ChatRetrieveParams { organization_id, project_id } query?, RequestOptionsoptions?): ChatRetrieveResponse { events, last_updated_at, session_id, 3 more }
GET/api/v1/chat/{session_id}
Delete Session
client.beta.chat.delete(stringsessionID, ChatDeleteParams { organization_id, project_id } params?, RequestOptionsoptions?): void
DELETE/api/v1/chat/{session_id}
Get Session Summary
client.beta.chat.getSummary(stringsessionID, ChatGetSummaryParams { organization_id, project_id } query?, RequestOptionsoptions?): ChatGetSummaryResponse { last_updated_at, session_id, generated_title, 2 more }
GET/api/v1/chat/{session_id}/summary
Generate Session Title
client.beta.chat.setTitle(stringsessionID, ChatSetTitleParams { first_message, organization_id, project_id } params, RequestOptionsoptions?): ChatSetTitleResponse { last_updated_at, session_id, generated_title, 2 more }
POST/api/v1/chat/{session_id}/title
Stream Messages
client.beta.chat.stream(stringsessionID, ChatStreamParams { index_ids, prompt, organization_id, project_id } params, RequestOptionsoptions?): ChatStreamResponse
POST/api/v1/chat/{session_id}/messages/stream
ModelsExpand Collapse
ChatListResponse { last_updated_at, session_id, generated_title, 2 more }

Summary of a chat session, including its title and last run metadata.

last_updated_at: string

ISO-format timestamp showing when the session was last updated.

session_id: string

Unique session identifier.

generated_title?: string | null

Auto-generated title derived from the first user message.

index_ids?: Array<string> | null

Indexes this session is bound to. Null on unbound sessions.

job_metadata?: JobMetadata | null

Token usage and status from the most recent run. Null if the session has not been run yet.

duration_ms?: number
error?: string | null
export_config_ids?: Array<string> | null
is_error?: boolean
total_input_tokens?: number | null
total_output_tokens?: number | null
turns?: number
ChatCreateResponse { last_updated_at, session_id, generated_title, 2 more }

Summary of a chat session, including its title and last run metadata.

last_updated_at: string

ISO-format timestamp showing when the session was last updated.

session_id: string

Unique session identifier.

generated_title?: string | null

Auto-generated title derived from the first user message.

index_ids?: Array<string> | null

Indexes this session is bound to. Null on unbound sessions.

job_metadata?: JobMetadata | null

Token usage and status from the most recent run. Null if the session has not been run yet.

duration_ms?: number
error?: string | null
export_config_ids?: Array<string> | null
is_error?: boolean
total_input_tokens?: number | null
total_output_tokens?: number | null
turns?: number
ChatRetrieveResponse { events, last_updated_at, session_id, 3 more }

Full chat session including its complete event history.

events: Array<ThinkingDeltaEvent { content, type } | TextDeltaEvent { content, type } | ThinkingEvent { content, type } | 5 more>

Ordered list of events that make up the conversation history.

One of the following:
ThinkingDeltaEvent { content, type }
content: string
type?: "thinking_delta"
TextDeltaEvent { content, type }
content: string
type?: "text_delta"
ThinkingEvent { content, type }
content: string
type?: "thinking"
TextEvent { content, type }
content: string
type?: "text"
ToolCallEvent { arguments, call_id, name, type }
arguments: Record<string, unknown>
call_id: string
name: string
type?: "tool_call"
ToolResultEvent { call_id, name, result, 2 more }
call_id: string
name: string
result: unknown
image_attachment?: ImageAttachment | null

Coordinates for lazily resolving a page screenshot presigned URL.

attachment_name: string
source_id: string
type?: "tool_result"
StopEvent { error, is_error, usage, type }
error: string | null
is_error: boolean
usage: Usage { duration_ms, total_input_tokens, total_output_tokens, turns }
duration_ms?: number
total_input_tokens?: number | null
total_output_tokens?: number | null
turns?: number
type?: "stop"
UserInputEvent { content, type }
content: string
type?: "user_input"
last_updated_at: string

ISO-format timestamp showing when the session was last updated.

session_id: string

Unique session identifier.

generated_title?: string | null

Auto-generated title derived from the first user message.

index_ids?: Array<string> | null

Indexes this session is bound to. Null on unbound sessions.

job_metadata?: JobMetadata | null

Token usage and status from the most recent run. Null if the session has not been run yet.

duration_ms?: number
error?: string | null
export_config_ids?: Array<string> | null
is_error?: boolean
total_input_tokens?: number | null
total_output_tokens?: number | null
turns?: number
ChatGetSummaryResponse { last_updated_at, session_id, generated_title, 2 more }

Summary of a chat session, including its title and last run metadata.

last_updated_at: string

ISO-format timestamp showing when the session was last updated.

session_id: string

Unique session identifier.

generated_title?: string | null

Auto-generated title derived from the first user message.

index_ids?: Array<string> | null

Indexes this session is bound to. Null on unbound sessions.

job_metadata?: JobMetadata | null

Token usage and status from the most recent run. Null if the session has not been run yet.

duration_ms?: number
error?: string | null
export_config_ids?: Array<string> | null
is_error?: boolean
total_input_tokens?: number | null
total_output_tokens?: number | null
turns?: number
ChatSetTitleResponse { last_updated_at, session_id, generated_title, 2 more }

Summary of a chat session, including its title and last run metadata.

last_updated_at: string

ISO-format timestamp showing when the session was last updated.

session_id: string

Unique session identifier.

generated_title?: string | null

Auto-generated title derived from the first user message.

index_ids?: Array<string> | null

Indexes this session is bound to. Null on unbound sessions.

job_metadata?: JobMetadata | null

Token usage and status from the most recent run. Null if the session has not been run yet.

duration_ms?: number
error?: string | null
export_config_ids?: Array<string> | null
is_error?: boolean
total_input_tokens?: number | null
total_output_tokens?: number | null
turns?: number
ChatStreamResponse = unknown