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
Theme

Retrieve a ChatKit thread

client.Beta.ChatKit.Threads.Get(ctx, threadID) (*ChatKitThread, error)
GET
/chatkit/threads/{thread_id}

Retrieve a ChatKit thread by its identifier.

Retrieve a ChatKit thread

package main

import (
  "context"
  "fmt"

  "github.com/openai/openai-go"
)

func main() {
  client := openai.NewClient()
  chatkitThread, err := client.Beta.ChatKit.Threads.Get(context.TODO(), "cthr_123")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", chatkitThread.ID)
}
Response example
{
  "id": "cthr_abc123",
  "object": "chatkit.thread",
  "title": "Customer escalation",
  "created_at": 1712345600,
  "status": {
    "type": "active"
  },
  "user": "user_123"
}
Parameters
threadID string
Returns
type ChatKitThread struct{…}

Represents a ChatKit thread and its current status.

ID string

Identifier of the thread.

CreatedAt int64

Unix timestamp (in seconds) for when the thread was created.

formatunixtime
Object ChatKitThread

Type discriminator that is always chatkit.thread.

Status ChatKitThreadStatusUnion

Current status for the thread. Defaults to active for newly created threads.

Title string

Optional human-readable title for the thread. Defaults to null when no title has been generated.

User string

Free-form string that identifies your end user who owns the thread.

Returns Examples
Response example
{
  "id": "cthr_abc123",
  "object": "chatkit.thread",
  "title": "Customer escalation",
  "created_at": 1712345600,
  "status": {
    "type": "active"
  },
  "user": "user_123"
}