v2026.11.3
All Bundles
Bundle

Google Gemini API client. Supports text generation, multimodal inputs (image, audio, video), chat sessions, function calling, and caching. Set GOOGLE_API_KEY before use. Compile with -lib gemini.

EndPoint

Gemini endpoint

Operations

GetApiKey # function

Reads API from 'api_key.dat'

function : GetApiKey() ~ String

Return

TypeDescription
StringAPI key

GetLastError # function

Get the last error

function : GetLastError() ~ String

Return

TypeDescription
Stringlast error

ParseBody # function

Parses a response body, recording a failure as the last error (the error was only printed before, so GetLastError() never reported it). A body that is not JSON, or that carries an 'error' object, yields Nil.

function : ParseBody(body:String) ~ JsonElement

Parameters

NameTypeDescription
bodyStringresponse body

Return

TypeDescription
JsonElementparsed JSON, or Nil on failure

SetApiKey # function

Set the API file key path

function : SetApiKey(api_key:String) ~ Nil

Parameters

NameTypeDescription
api_keyStringAPI file key path