Back to news
ReleaseSDK4 min read

IaGenify SDK Alpha: one client, wherever your code runs.

A first look at a JavaScript client for assistant sessions, structured output, budgeted agents and typed errors — in Node.js, the browser and at the edge.

iagenifysdknode.jsagentsjavascript

The IaGenify SDK started life as a thin HTTP wrapper around our API. In its alpha it has become the way we build our own tools: one JavaScript client that runs unchanged in Node.js, the browser and Cloudflare Workers, and that hides authentication, sessions and billing guard-rails behind a small, object-oriented surface.

This is not a reference manual. It is a short tour of the ideas we are betting on, a few snippets in the syntax you will actually write, and some hints about where this SDK is heading.

One client, wherever your code runs

The client detects its runtime when it starts. It handles authentication, sessions and the platform’s billing guardrails so your application can focus on the work it is trying to do.

import { IaGenify } from "iagenify";

const api = new IaGenify({
  apiKey: process.env.IAGENIFY_API_KEY,
  appName: "release-notes-bot",
});

In Node.js the SDK keeps its session in a private file under ~/.iagenify/ with owner-only permissions; in the browser it uses localStorage; on the edge it stays in memory. Your API key is exchanged for a short-lived token that is refreshed silently, so application code never touches tokens. Node-only modules load lazily, so imports shared with front-end code do not break webpack, Vite or Gatsby builds.

Assistants are sessions, not prompts

Instead of rebuilding a prompt for every call, you create an assistant session once: a model, a role, instructions, an optional JSON Schema and a memory switch. Every generate() call then speaks in typed inputs and outputs. The same shape carries images, audio, video and document passages.

const assistant = await api.models.create({ model: "gemini-3.5-flash", settings: { role: "Senior release engineer", instructions: "Answer in three short bullet points." }, schema: { type: "object", properties: { summary: { type: "string" } } }, memory: true });
const first = await assistant.generate({ inputs: [{ type: "text", content: "Summarise the changes shipped in v2.4.0." }] });
const followUp = await assistant.generate({ inputs: [{ type: "text", content: "Which risk should we fix first?" }] });

The server publishes its own price list, and api.catalogue() reads it. An app can show what a call will cost without copying a pricing grid by hand and watching it drift.

An agent with a visible budget

Agent work should not become an open-ended cost. A run carries the budget you set, and the same trace shows the tools used, the decisions made and the result returned to your application.

You compose an agent from model sessions you already own and from built-in tools: web search, page fetching, screenshots, document conversion, and image, video, voice or music generation. maxSteps caps the loop, and budget caps credits. The budget is checked before a tool call against measured production costs, so a run stops before it overspends rather than after.

const agent = api.agents.create({ model: { main, image }, tools: { search: api.tools.search, openPage: api.tools.fetch, createImage: api.tools.image }, maxSteps: 8, budget: 100 });
const result = await agent.run({ inputs: [{ type: "text", content: "Find the latest Node.js LTS release and draw a cover image for it." }] });

Errors keep their type even when they arrive in the middle of a streamed run, so instanceof NotEnoughCredits works the same way for a simple call and for a five-minute agent run.

Structured output is the default

Applications need data they can trust, not a paragraph that must be parsed after the fact. The SDK makes structured results and typed errors part of the normal path, whether the request runs in a browser, a worker or a server process.

This is an alpha. The surface is intentionally small while we learn from real applications and make the parts that stay dependable.

The SDK is the beginning of the developer experience, not a replacement for it. Documentation and the developer site will grow around the pieces that prove useful in real work.

Hints of what comes next

An alpha is a promise of direction, not a list of dates. We are pointing toward framework-aware integrations, live feedback for everyday assistant calls, storage as the retrieval layer for agent memory, and in-house assistant models exposed through the same models.create() call.

The alpha is shared with early-access teams while the API settles, and names may still change between releases. If you want to build with it, get in touch and follow the IaGenify documentation as it grows.

Frequently asked questions

Is the IaGenify SDK available on npm?

Not publicly yet. During the alpha the package is shared with early-access teams; a public release follows once the API has stabilised.

Which runtimes does the SDK Alpha support?

Node.js, modern browsers and Cloudflare Workers. The SDK detects the runtime and stores its session in a private file, localStorage or memory accordingly.

How does an agent avoid overspending credits?

Each agent has a maxSteps limit and a credit budget checked before every tool call against measured tool costs. A shortfall raises a typed NotEnoughCredits error.

Back to news