~/products/ai-sdk

// ai-cloud/ai-sdk

Add AI in a few lines of code.

Add AI in a few lines

The AI SDK (software development kit) is a code library for the AI Gateway. Install one package, set one key, and call any model in the catalog directly from your app — with editor autocomplete instead of raw HTTP requests.

app.ts
// app.ts
import { SetCloud } from '@setcloud/ai';

const ai = new SetCloud(); // reads SETCLOUD_API_KEY

const reply = await ai.chat({
  model: 'nova-lite',
  messages: [{ role: 'user', content: 'Hello' }],
});

// 01 — autocomplete

Typed requests and responses.

Message formats and responses have TypeScript types for editor autocomplete. Fetch the live model catalog to choose an available model ID.

  • + Typed AI requests and responses, with autocomplete
  • + List available models — including your fine-tuned ones
  • + Reads your API key from the environment automatically

// 02 — streaming

Stream replies as they generate.

Show the model's reply word by word as it arrives, the way modern chat apps do — the SDK hands you the pieces to loop over and render, with none of the low-level networking to wire up yourself.

  • + Read the streamed reply with a simple loop
  • + Same streaming behavior as the raw /v1 endpoint

// 03 — one bill

Same keys. Same meter.

The SDK calls the same gateway with the same sk-sc- keys, so usage lands on the same prepaid balance with the same per-token rates. The package itself costs nothing.

  • + Use sk-sc- keys in server-side SDK and HTTP calls; the playground uses your signed-in account
  • + Usage appears in the same dashboard, by key and model
  • + No SDK surcharge — gateway token rates only

Current pricing

USD rates from the current billing catalog. Regional references vary with attributed usage.

Loading current rates…

Add AI in one import.

Download the SDK from the quickstart. The package is free; gateway token rates apply.