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
Assistant beta().assistants().create(AssistantCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/assistants
Delete assistant
Deprecated
AssistantDeleted beta().assistants().delete(AssistantDeleteParamsparams = AssistantDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
DELETE/assistants/{assistant_id}
List assistants
Deprecated
AssistantListPage beta().assistants().list(AssistantListParamsparams = AssistantListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/assistants
Retrieve assistant
Deprecated
Assistant beta().assistants().retrieve(AssistantRetrieveParamsparams = AssistantRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/assistants/{assistant_id}
Modify assistant
Deprecated
Assistant beta().assistants().update(AssistantUpdateParamsparams = AssistantUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
POST/assistants/{assistant_id}
ModelsExpand Collapse
class Assistant:

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

class AssistantDeleted:
class AssistantStreamEvent: A class that can be one of several variants.union

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 AssistantTool: A class that can be one of several variants.union
class CodeInterpreterTool:
class FileSearchTool:
class FunctionTool:
class MessageStreamEvent: A class that can be one of several variants.union

Occurs when a message is created.

class RunStepStreamEvent: A class that can be one of several variants.union

Occurs when a run step is created.

class RunStreamEvent: A class that can be one of several variants.union

Occurs when a new run is created.

class ThreadStreamEvent:

Occurs when a new thread is created.