Api
post /threads
post /threads/search
get /threads/{thread_id}/history
post /threads/{thread_id}/copy
get /threads/{thread_id}
delete /threads/{thread_id}
patch /threads/{thread_id}
HTTP Model
{
"thread_id": "123e4567-e89b-12d3-a456-426614174000",
"created_at": "2025-07-29T17:23:27.992Z",
"updated_at": "2025-07-29T17:23:27.992Z",
"metadata": {},
"status": "idle",
"values": {},
"messages": [
{
"role": "string",
"content": "string",
"id": "string",
"metadata": {
"propertyName*": "anything"
},
"propertyName*": "anything"
}
]
}
Model
class Thread(BaseModel):
id: str = Field(
description="Thread ID.",
examples=["edd5a53c-da04-4db4-84e0-a9f3592eef45"],
)
created_at: AwareDatetime = Field(
default_factory=lambda: datetime.now(UTC),
description="The time the thread was created.",
examples=["2023-10-01T12:00:00Z"],
)
updated_at: AwareDatetime = Field(
default_factory=lambda: datetime.now(UTC),
description="The last time the thread was updated.",
examples=["2023-10-01T12:00:00Z"],
)
metadata: dict[str, Any] = Field(
..., description="The thread metadata.", title="Metadata"
)
status: ThreadStatus | None = Field(
default=ThreadStatus.idle,
description="Thread status to filter on.",
title="Thread Status",
)
- Store to DB, handle updates, store title in metadata, ulid instead uuid
Api
HTTP Model
{ "thread_id": "123e4567-e89b-12d3-a456-426614174000", "created_at": "2025-07-29T17:23:27.992Z", "updated_at": "2025-07-29T17:23:27.992Z", "metadata": {}, "status": "idle", "values": {}, "messages": [ { "role": "string", "content": "string", "id": "string", "metadata": { "propertyName*": "anything" }, "propertyName*": "anything" } ] }Model