GLabs SDK

TypeScript SDK and CLI for Google Labs AI media generation APIs

GLabs SDK

TypeScript SDK and CLI for Google Labs AI media generation — Imagen 4 image generation and Veo 3.1 video generation.

Packages

PackageInstall
@getvrex/glabs-sdknpm install @getvrex/glabs-sdk
@getvrex/glabs-clinpm install -g @getvrex/glabs-cli

Quick Start

CLI

npm install -g @getvrex/glabs-cli
 
# Setup
glabs auth extract --email [email protected] --password "pass" --save
 
# Generate an image
glabs images generate -p "A sunset over mountains" -a 16:9
 
# Generate a video
glabs videos generate -p "A cinematic drone shot" -a 16:9
 
# Poll and download
glabs videos poll --operation-name "operations/xyz" -o ./videos

SDK

import { GLabsClient } from '@getvrex/glabs-sdk';
 
const client = new GLabsClient({
  bearerToken: 'your-bearer-token',
  accountTier: 'pro',
  recaptcha: { provider: 'chrome' },
});
 
// Generate an image
const image = await client.images.generate({
  prompt: 'A beautiful sunset over mountains',
  sessionId: GLabsClient.generateSessionId(),
  aspectRatio: '16:9',
});
 
// Generate a video
const operation = await client.videos.generateTextToVideo({
  prompt: 'A cinematic drone shot of a city at sunset',
  sessionId: GLabsClient.generateSessionId(),
  aspectRatio: '16:9',
});
 
// Poll until ready
const video = await client.videos.pollOperation({
  operationName: operation.operationName,
});

Features

  • Image Generation — Imagen 4 with batch generation (up to 4), 2K/4K upscaling, reference images
  • Video Generation — Veo 3.1 text-to-video, image-to-video, multi-reference, extend, camera reshoot
  • CLI — Full terminal access to all features, OpenAI-compatible server mode
  • Token Management — Auto token refresh, concurrent deduplication, 401 retry
  • reCAPTCHA — 7 providers with fallback chains
  • Type-Safe — Full TypeScript support with exported types

Next Steps

On this page