npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@redwilly/whisk-api

v4.0.21

Published

Unofficial API for Whisk image generation.

Readme

whisk-api

Unofficial free reverse engineered API for Google's Whisk from labs.google.

Banner

Installation

npm i -g @rohitaryal/whisk-api
# or
bun i -g @rohitaryal/whisk-api

Features

  1. Text to Image using IMAGEN_3_5
  2. Image to Video (Animation) using VEO_3_1
  3. Image Refinement (Editing/Inpainting)
  4. Image to Text (Caption Generation)
  5. Project & Media Management
  6. Upload & Reference Images
  7. Command line support

Usage

whisk can be invoked through both command line and as a module.

Make sure you have:

  1. Installed whisk-api globally (How to install?)

  2. Obtained your google account cookies (How to get cookies?)

  3. Set env variable COOKIE containing your cookie

    Bash:

    export COOKIE="__YOUR__COOKIE__HERE__"

    Command Prompt:

    set "COOKIE=__YOUR__COOKIE__HERE__"

    Powershell:

    $COOKIE = "__YOUR__GOOGLE__COOKIE__HERE__"

Basic Usages

NOTE: If you are using environment variables, keep the quotes around cookie to avoid word-splitting and authentication errors.

  • Linux/macOS: "$COOKIE"
  • PowerShell: "$env:COOKIE"
  • Command Prompt: "%COOKIE%"
  • Creating a new project

    whisk project --name "My Project" --cookie "$COOKIE"
  • Generating image with prompt

    # saves generated image at ./output/ by default
    whisk generate --prompt "A bad friend" --cookie "$COOKIE"
  • Selecting a specific aspect ratio

    # Available: SQUARE, PORTRAIT, LANDSCAPE (Default: LANDSCAPE)
    whisk generate --prompt "Reptillian CEO" --aspect "PORTRAIT" --cookie "$COOKIE"
  • Animating an existing image (Image to Video)

    # Requires the Media ID of a LANDSCAPE image
    whisk animate "__MEDIA__ID__HERE__" --script "Camera pans slowly to the left" --cookie "$COOKIE"
  • Refining (Editing) an image

    whisk refine "__MEDIA__ID__HERE__" --prompt "Add a red hat to the character" --cookie "$COOKIE"
  • Generating caption from a local image file

    whisk caption --file /path/to/img.webp --count 3 --cookie "$COOKIE"
  • Fetching an existing media by ID

    whisk fetch "__MEDIA__ID__HERE__" --cookie "$COOKIE"
  • Uploading an image as reference

    whisk upload /path/to/image.jpg --category SUBJECT --project "__PROJECT__ID__" --cookie "$COOKIE"
  • Deleting media from the cloud

    whisk delete "__MEDIA__ID__HERE__" --cookie "$COOKIE"

Full CLI commands help:

whisk <cmd> [args]

Commands:
  whisk project             Generate a new project
  whisk generate            Generate new images using a temporary project
  whisk animate <mediaId>   Animate an existing landscape image into a video
  whisk refine <mediaId>    Edit/Refine an existing image
  whisk caption             Generate captions for a local image file
  whisk fetch <mediaId>     Download an existing generated media by ID
  whisk upload <file>       Upload an image to be used as reference later
  whisk delete <mediaId>    Delete a generated media from the cloud

Options:
  -c, --cookie  Google account cookie [required]
  -h, --help    Show help
      --version Show version number
whisk project

Options:
  --name        Project name [default: "Whisk-CLI project"]
  -c, --cookie  Google account cookie [required]
whisk generate

Options:
  -p, --prompt   Description of the image [required]
  -m, --model    Image generation model [default: "IMAGEN_3_5"]
  -a, --aspect   Aspect ratio (SQUARE, PORTRAIT, LANDSCAPE) [default: "LANDSCAPE"]
  -s, --seed     Seed value (0 for random) [default: 0]
  -d, --dir      Output directory [default: "./output"]
  -c, --cookie   Google account cookie [required]
whisk animate <mediaId>

Positionals:
  mediaId  The ID of the image to animate [required]

Options:
  -s, --script   Prompt/Script for the video animation [required]
  -m, --model    Video generation model [default: "VEO_3_1"]
  -d, --dir      Output directory [default: "./output"]
  -c, --cookie   Google account cookie [required]
whisk refine <mediaId>

Positionals:
  mediaId  The ID of the image to refine [required]

Options:
  -p, --prompt   Instruction for editing (e.g., 'Make it snowy') [required]
  -d, --dir      Output directory [default: "./output"]
  -c, --cookie   Google account cookie [required]
whisk caption

Options:
  -f, --file     Path to local image file [required]
  -n, --count    Number of captions [default: 1]
  -c, --cookie   Google account cookie [required]
whisk fetch <mediaId>

Positionals:
  mediaId  Unique ID of generated media [required]

Options:
  -d, --dir      Output directory [default: "./output"]
  -c, --cookie   Google account cookie [required]
whisk upload <file>

Positionals:
  file  Path to local image file [required]

Options:
  --category, -ca  Category of reference [required]
                   Choices: SUBJECT, SCENE, STYLE
  --project, -pr   Project/Workflow ID [required]
  -c, --cookie     Google account cookie [required]
whisk delete <mediaId>

Positionals:
  mediaId  Unique ID of generated media to delete [required]

Options:
  -c, --cookie   Google account cookie [required]
  • Basic image generation

    import { Whisk } from "@rohitaryal/whisk-api";
    
    const whisk = new Whisk(process.env.COOKIE);
    
    // 1. Create a project context
    const project = await whisk.newProject("My Project");
    
    // 2. Generate image
    const media = await project.generateImage("A big black cockroach");
      
    // 3. Save to disk
    const savedPath = media.save("./output");
    console.log("[+] Image saved at: " + savedPath);
  • Advanced Workflow (Gen -> Refine -> Animate)

    import { Whisk, ImageAspectRatio } from "@rohitaryal/whisk-api";
    
    const whisk = new Whisk(process.env.COOKIE);
    const project = await whisk.newProject("Video Workflow");
    
    // 1. Generate Base Image (Must be LANDSCAPE for video)
    const baseImage = await project.generateImage({
        prompt: "A cybernetic city",
        aspectRatio: "IMAGE_ASPECT_RATIO_LANDSCAPE"
    });
    
    // 2. Refine (Edit)
    const refinedImage = await baseImage.refine("Make it raining neon rain");
    
    // 3. Animate (Video)
    const video = await refinedImage.animate("Camera flies through the streets", "VEO_3_1_I2V_12STEP");
    
    video.save("./videos");

More examples are at: /examples

Help

Easy way

  1. Install Cookie Editor extension in your browser.
  2. Open labs.google, make sure you are logged in
  3. Click on Cookie Editor icon from Extensions section.
  4. Click on Export -> Header String

Manual way

  1. Open labs.google, make sure you are logged in
  2. Press CTRL + SHIFT + I to open console
  3. Click on Network tab at top of console
  4. Press CTRL + L to clear network logs
  5. Click CTRL + R to refresh page
  6. Click on image-fx which should be at top
  7. Goto Request Headers section and copy all the content of Cookie
  1. Install a free VPN (Windscribe, Proton, etc)
  2. Open labs.google and login
  3. From here follow the "How to extract cookie?" in HELP section (above).
  4. Once you have obtained this cookie, you don't need VPN anymore.

Create an issue here. Make sure the pasted logs don't contain cookie or tokens.

Contributions

Contribution are welcome but ensure to pass all test cases and follow existing coding standard.

Disclaimer

This project demonstrates usage of Google's private API but is not affiliated with Google. Use at your own risk.