What is Threads?

Threads are conversation groupings for chatlogs. You can easily track multi-turn conversations by passing in a Thread ID when logging.

You will love it when you want to:

  • Track multi-turn conversations.
  • Check the whole conversation history instead of a single log.

Quick start

In your API payload, pass thread_identifier to group the chatlogs into a thread. Every log with the same thread_identifier will be grouped into the same thread.
Python
payload = {
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Tell me a long story"}],
    "thread_identifier": "thread_id"
}
The Thread feature allows you to group related chat logs together by using a common thread_identifier. This approach is particularly useful for conversational AI applications, as it organizes chat history into a single thread.
from openai import OpenAI

client = OpenAI(
    base_url="https://api.keywordsai.co/api/",
    api_key="YOUR_KEYWORDSAI_API_KEY",
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
        {"role": "user", "content": "Tell me a long story"}
    ],
    extra_body={
        "thread_identifier": "the_first_thread"
    }
)

View threads on the platform

Go to Threads

There’s a Threads page on the platform where you can view all the threads you’ve created.

Open a Thread in Logs

To view the detailed logs within a thread:
  1. Click the Open in Logs button in the side panel to access the thread’s complete log history.
  1. Browse through all logs associated with the thread. Select any individual log entry to view its complete details.