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.