Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation

Assistants

Build Assistants that can call models and use tools.

Create assistant
Deprecated
beta.assistants.create(AssistantCreateParams**kwargs) -> Assistant
POST/assistants
Delete assistant
Deprecated
beta.assistants.delete(strassistant_id) -> AssistantDeleted
DELETE/assistants/{assistant_id}
List assistants
Deprecated
beta.assistants.list(AssistantListParams**kwargs) -> SyncCursorPage[Assistant]
GET/assistants
Retrieve assistant
Deprecated
beta.assistants.retrieve(strassistant_id) -> Assistant
GET/assistants/{assistant_id}
Modify assistant
Deprecated
beta.assistants.update(strassistant_id, AssistantUpdateParams**kwargs) -> Assistant
POST/assistants/{assistant_id}
ModelsExpand Collapse
class Assistant:

Represents an assistant that can call the model and use tools.

class AssistantDeleted:

Represents an event emitted when streaming a Run.

Each event in a server-sent events stream has an event and data property:

event: thread.created
data: {"id": "thread_123", "object": "thread", ...}

We emit events whenever a new object is created, transitions to a new state, or is being streamed in parts (deltas). For example, we emit thread.run.created when a new run is created, thread.run.completed when a run completes, and so on. When an Assistant chooses to create a message during a run, we emit a thread.message.created event, a thread.message.in_progress event, many thread.message.delta events, and finally a thread.message.completed event.

We may add additional events over time, so we recommend handling unknown events gracefully in your code. See the Assistants API quickstart to learn how to integrate the Assistants API with streaming.

class CodeInterpreterTool:
class FileSearchTool:
class FunctionTool:

Occurs when a new run is created.

class ThreadStreamEvent:

Occurs when a new thread is created.