Developer SDK

The ZETRAX Node.js SDK

Integrate world-class AI prompt generation into your app in 3 lines of code. TypeScript-first, fully typed, zero dependencies.

Terminal — zetrax-app
$

Quickstart Guide

From zero to generating prompts in under 2 minutes.

1

Install the package

Install via npm, yarn, or pnpm. The SDK ships with full TypeScript types — no @types needed.

Shell
npm install @zetrax/sdk
2

Initialize the client

Import the SDK and create a client with your API key. Store your key securely in an environment variable — never hardcode it.

TypeScript
import { ZetraxClient } from '@zetrax/sdk'; const zetrax = new ZetraxClient({ apiKey: process.env.ZETRAX_API_KEY, // ← from .env });
3

Generate your first prompt

Call prompts.generate() with a subject, style, and lighting. The SDK returns a fully-typed PromptResult object.

TypeScript
const result = await zetrax.prompts.generate({ subject: 'Epic Fantasy Landscape', style: 'Cinematic Film', lighting: 'Golden Hour', quality: 'ultra', }); console.log(result.prompt.text); // → "A breathtaking cinematic fantasy landscape…" // Access usage stats console.log(result.usage.remaining); // → "unlimited"

What's in the SDK

Full TypeScript Support

Complete type definitions for every request and response. IntelliSense auto-complete across all parameters.

Automatic Retries

Configurable retry logic with exponential backoff. Never lose a request to a transient network error.

Promise & Async/Await

First-class async support. Works seamlessly with Next.js Server Actions, Express, Fastify, and more.