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.

EndPoint

OpenAI endpoint

Operations

GetApiKey # function

Reads API from 'api_key.dat'

function : GetApiKey() ~ String

Return

TypeDescription
StringAPI key

GetBaseUrl # function

Get the base URL

function : GetBaseUrl() ~ String

Return

TypeDescription
Stringbase

GetLastError # function

Get the last error

function : GetLastError() ~ String

Return

TypeDescription
Stringlast error

SetApiKey # function

Set the API file key path

function : SetApiKey(api_key:String) ~ Nil

Parameters

NameTypeDescription
api_keyStringAPI file key path

SetBaseUrl # function

Set the base URL

function : SetBaseUrl(base_url:String) ~ Nil

Parameters

NameTypeDescription
base_urlStringbase URL