Skip to content

Chat

List Sessions
beta.chat.list(ChatListParams**kwargs) -> SyncPaginatedCursor[ChatListResponse]
GET/api/v1/chat
Create Session
beta.chat.create(ChatCreateParams**kwargs) -> ChatCreateResponse
POST/api/v1/chat
Get Full Session
beta.chat.retrieve(strsession_id, ChatRetrieveParams**kwargs) -> ChatRetrieveResponse
GET/api/v1/chat/{session_id}
Delete Session
beta.chat.delete(strsession_id, ChatDeleteParams**kwargs)
DELETE/api/v1/chat/{session_id}
Get Session Summary
beta.chat.get_summary(strsession_id, ChatGetSummaryParams**kwargs) -> ChatGetSummaryResponse
GET/api/v1/chat/{session_id}/summary
Generate Session Title
beta.chat.set_title(strsession_id, ChatSetTitleParams**kwargs) -> ChatSetTitleResponse
POST/api/v1/chat/{session_id}/title
Stream Messages
beta.chat.stream(strsession_id, ChatStreamParams**kwargs) -> object
POST/api/v1/chat/{session_id}/messages/stream
ModelsExpand Collapse
class ChatListResponse:

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

last_updated_at: str

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

session_id: str

Unique session identifier.

generated_title: Optional[str]

Auto-generated title derived from the first user message.

index_ids: Optional[List[str]]

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

job_metadata: Optional[JobMetadata]

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

duration_ms: Optional[float]
error: Optional[str]
export_config_ids: Optional[List[str]]
is_error: Optional[bool]
total_input_tokens: Optional[int]
total_output_tokens: Optional[int]
turns: Optional[int]
class ChatCreateResponse:

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

last_updated_at: str

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

session_id: str

Unique session identifier.

generated_title: Optional[str]

Auto-generated title derived from the first user message.

index_ids: Optional[List[str]]

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

job_metadata: Optional[JobMetadata]

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

duration_ms: Optional[float]
error: Optional[str]
export_config_ids: Optional[List[str]]
is_error: Optional[bool]
total_input_tokens: Optional[int]
total_output_tokens: Optional[int]
turns: Optional[int]
class ChatRetrieveResponse:

Full chat session including its complete event history.

events: List[Event]

Ordered list of events that make up the conversation history.

One of the following:
class EventThinkingDeltaEvent:
content: str
type: Optional[Literal["thinking_delta"]]
class EventTextDeltaEvent:
content: str
type: Optional[Literal["text_delta"]]
class EventThinkingEvent:
content: str
type: Optional[Literal["thinking"]]
class EventTextEvent:
content: str
type: Optional[Literal["text"]]
class EventToolCallEvent:
arguments: Dict[str, object]
call_id: str
name: str
type: Optional[Literal["tool_call"]]
class EventToolResultEvent:
call_id: str
name: str
result: object
image_attachment: Optional[EventToolResultEventImageAttachment]

Coordinates for lazily resolving a page screenshot presigned URL.

attachment_name: str
source_id: str
type: Optional[Literal["tool_result"]]
class EventStopEvent:
error: Optional[str]
is_error: bool
usage: EventStopEventUsage
duration_ms: Optional[float]
total_input_tokens: Optional[int]
total_output_tokens: Optional[int]
turns: Optional[int]
type: Optional[Literal["stop"]]
class EventUserInputEvent:
content: str
type: Optional[Literal["user_input"]]
last_updated_at: str

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

session_id: str

Unique session identifier.

generated_title: Optional[str]

Auto-generated title derived from the first user message.

index_ids: Optional[List[str]]

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

job_metadata: Optional[JobMetadata]

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

duration_ms: Optional[float]
error: Optional[str]
export_config_ids: Optional[List[str]]
is_error: Optional[bool]
total_input_tokens: Optional[int]
total_output_tokens: Optional[int]
turns: Optional[int]
class ChatGetSummaryResponse:

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

last_updated_at: str

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

session_id: str

Unique session identifier.

generated_title: Optional[str]

Auto-generated title derived from the first user message.

index_ids: Optional[List[str]]

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

job_metadata: Optional[JobMetadata]

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

duration_ms: Optional[float]
error: Optional[str]
export_config_ids: Optional[List[str]]
is_error: Optional[bool]
total_input_tokens: Optional[int]
total_output_tokens: Optional[int]
turns: Optional[int]
class ChatSetTitleResponse:

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

last_updated_at: str

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

session_id: str

Unique session identifier.

generated_title: Optional[str]

Auto-generated title derived from the first user message.

index_ids: Optional[List[str]]

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

job_metadata: Optional[JobMetadata]

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

duration_ms: Optional[float]
error: Optional[str]
export_config_ids: Optional[List[str]]
is_error: Optional[bool]
total_input_tokens: Optional[int]
total_output_tokens: Optional[int]
turns: Optional[int]