Overview

The Stacknet SDK (@stacknet/sdk) is the recommended way to interact with the Geoff API. It provides type-safe functions for text generation, streaming, structured output, tool calling, embeddings, image/speech/video generation, and React UI hooks.
This is the recommended way to use Geoff. The Stacknet SDK provides the richest feature set with built-in streaming, structured output, tool calling, and React integrations.

Installation

Setup

Create a provider instance pointing to the Geoff API:
The provider gives you access to different model types:

Text Generation

generateText

Generate text with a single call. Supports tools, multi-turn conversations, and structured output.

Multi-turn conversation

Parameters


streamText

Stream text generation in real-time. Returns an async iterable.

Pipe to HTTP response (Next.js / Node.js)


Structured Output

generateObject

Generate type-safe structured data using a schema.

streamObject

Stream structured output as it’s being generated.

Tool Calling

Define tools the model can invoke during generation.

Tool with approval


Embeddings


Image Generation


Speech Generation


Transcription


React Hooks

useChat

Build chat UIs with the useChat hook.

useChat return values


Provider Configuration

Full configuration options for createStackNetProvider:

Error Handling

The SDK provides typed error classes for common failure modes:

Timeout & Retry