v2026.5.3
All Bundles
Bundle OpenAI API client. Supports Chat Completions (GPT-4o, o1, etc.), Embeddings, Image Generation (DALL-E), and function/tool calling. Set OPENAI_API_KEY environment variable before use. Compile with -lib openai.

Thread

Create threads that assistants can interact with

Inherits: EndPoint

Operations

Create # function

Creates a thread

function : Create(token:String) ~ API.OpenAI.Thread

Parameters

NameTypeDescription
tokenStringAPI token

Return

TypeDescription
Threadnewly created thread

Delete # function

Loads an existing thread

function : Delete(id:String, token:String) ~ Bool

Parameters

NameTypeDescription
idStringID of the model to use
tokenStringAPI token

Return

TypeDescription
Boolloaded thread

GetCreatedAt #

Unix timestamp (in seconds) of when the object instance was created

method : public : GetCreatedAt() ~ Int

Return

TypeDescription
Inttime with the object instance was created

GetId #

Get object instance API ID

method : public : GetId() ~ String

Return

TypeDescription
Stringinstance ID

GetObject #

Get the object type

method : public : GetObject() ~ String

Return

TypeDescription
Stringobject type

Load # function

Loads an existing thread

function : Load(id:String, token:String) ~ API.OpenAI.Thread

Parameters

NameTypeDescription
idStringID of the model to use
tokenStringAPI token

Return

TypeDescription
Threadloaded thread

ToString #

String representation of the object

method : public : ToString() ~ String

Return

TypeDescription
Stringstring representation