npm.io
0.4.1 • Published 14h ago

@vargai/gateway

Licence
MIT
Version
0.4.1
Deps
3
Size
606 kB
Vulns
0
Weekly
51

@vargai/gateway

vercel AI SDK provider for varg gateway — generate video, image, speech, and music through a unified API.

install

bun add @vargai/gateway vargai

usage

import { generateVideo } from "vargai/ai";
import { createVarg } from "@vargai/gateway";

const varg = createVarg({
  apiKey: process.env.VARG_API_KEY!,
  baseUrl: "https://varg-gateway.fly.dev/v1", // optional
});

const result = await generateVideo({
  model: varg.videoModel("kling-v2.6"),
  prompt: "dancing cats in a neon disco, anime style",
  aspectRatio: "16:9",
});

await Bun.write("output.mp4", result.video.uint8Array);

models

video
import { generateVideo } from "vargai/ai";

const result = await generateVideo({
  model: varg.videoModel("kling-v2.6"),
  prompt: "warrior princess on cliff",
  duration: 5,
  aspectRatio: "16:9",
});

available: kling-v2.6, kling-v2.5, kling-v2.1, kling-v2, wan-2.5, minimax, ltx-2-19b-distilled, grok-imagine

image
import { generateImage } from "vargai/ai";

const result = await generateImage({
  model: varg.imageModel("flux-schnell"),
  prompt: "cyberpunk cityscape",
  aspectRatio: "16:9",
});

available: flux-pro, flux-dev, flux-schnell, recraft-v3, soul

speech
import { generateSpeech } from "vargai/ai";

const result = await generateSpeech({
  model: varg.speechModel("eleven_turbo_v2"),
  text: "hello world",
  voice: "rachel",
});

available: eleven_turbo_v2, eleven_multilingual_v2, turbo

music
import { generateMusic } from "vargai/ai";

const result = await generateMusic({
  model: varg.musicModel("music_v1"),
  prompt: "epic orchestral theme",
  duration: 30,
});

BYOK

bring your own provider keys to skip metered billing:

const varg = createVarg({
  apiKey: process.env.VARG_API_KEY!,
  providerKeys: {
    fal: "fal_xxx",
    elevenlabs: "el_xxx",
  },
});

license

mit

Keywords