Threads & Runs¶
Threads are conversations with an assistant. Each thread maintains a full message history so the assistant has context across multiple exchanges.
The Thread/Run Model¶
- A thread is a container for messages. It belongs to a project and is linked to one assistant.
- A run is a single invocation of the assistant. When you send a message, a run is created. That run may produce multiple response messages — for example, a tool call followed by the tool's result followed by the assistant's final answer.
This separation means you can inspect exactly what happened in each invocation, including intermediate tool calls.
Creating a Thread¶
- Go to Threads in the sidebar.
- Click New Thread.
- Select an assistant and give the thread a name (up to 200 characters).
- Click Create — you're taken to the conversation view.
Sending Messages¶
Type your message in the input box and press Enter (or click Send). The assistant processes your message and streams its response back in real-time.
Streaming Responses¶
Responses arrive as a stream of Server-Sent Events (SSE). You'll see text appear token-by-token as the model generates it. The stream includes:
- Text chunks — the assistant's response as it's generated
- Tool call events — when the assistant invokes a tool (e.g., searching your documents)
- Done signal — marks the end of the run
If the assistant uses tools, you'll see the tool invocation and its result before the final answer.
Message History¶
All messages in a thread are persisted. When you reopen a thread, the full conversation history is loaded. The assistant uses this history as context for future responses.
You can also retrieve the thread's state history to see how the conversation evolved over time (useful for debugging).
Thread Naming¶
Give threads descriptive names so you can find them later. The name is set when you create the thread and can be updated afterward.
Listing Threads¶
The Threads page shows all threads in your current project, ordered by most recently updated. Results are paginated (up to 100 per page).
Deleting Threads¶
Delete a thread to permanently remove it and all its messages. This cannot be undone.
API Reference¶
| Operation | Endpoint |
|---|---|
| List threads | GET /threads/ |
| Create thread | POST /threads/ |
| Get thread | GET /threads/{tid} |
| Delete thread | DELETE /threads/{tid} |
| Get thread state | GET /threads/{tid}/state |
| Add to thread state | POST /threads/{tid}/state |
| Get thread history | GET /threads/{tid}/history |
| Stream a run | POST /runs/stream |
See the full API documentation at /docs#Threads.