GENJUTSUSTUDIO

Higgsfield MAGI-2 API: Text-to-Video Guide

The Higgsfield MAGI-2 text-to-video model ID is sand/magi-2/text-to-video. A server sends a description and output settings, then waits for a queued job to return a video URL. You need a Higgsfield API account with credentials and generation access. To try the model in a browser with Studio credits, use the MAGI-2 generator.

Make one four-second request

Install @higgsfield/client with npm and set HF_CREDENTIALS in your server environment to the key ID and secret pair issued by Higgsfield. Keep the key on the server. Save the example as magi.mjs and run it with node magi.mjs when you are ready to submit a billable request.

import { config, higgsfield } from '@higgsfield/client/v2';

config({ credentials: process.env.HF_CREDENTIALS });

const job = await higgsfield.subscribe('sand/magi-2/text-to-video', {
  input: {
    prompt:
      'A locked overhead shot of tea swirling in a white cup. The spoon lifts out and the swirl slowly settles.',
    duration: 4,
    resolution: '1080p',
    aspect_ratio: '1:1',
    generate_audio: false,
  },
  withPolling: true,
});

if (job.status !== 'completed' || !job.video?.url) {
  throw new Error(`Request ${job.request_id} ended with ${job.status}`);
}

console.log(job.video.url);

This requests a silent, square clip. The Node SDK handles authentication and polling. For an HTTP integration, submit JSON with a POST to https://api.higgsfield.ai/sand/magi-2/text-to-video. Store the returned request ID with your task so you can check the same job after a disconnect.

Which settings should I send?

How do I know the video is ready?

A request ID means the job exists. During our four-second landscape test, the request went through queued and in-progress states before the MP4 was available. In the completed SDK response, read video.url and retrieve the file. The test file contained H.264 video at 1920 × 1080 and an AAC audio track with sound enabled.

Higgsfield documents one active generation per account across its three MAGI-2 modes. Other requests can wait in the queue. If a client stops waiting, check the original request ID before submitting another paid job. Four seconds of requested output describes the length of the clip; generation and queue time are separate.

What if my input is a photo or a video?

Use the image-to-video endpoint when a particular opening frame matters. It accepts a starting image and an optional ending frame. To direct a shot with several images, clips or audio references, see the reference-to-video endpoint. The request above and the Studio MAGI-2 generator both start from text.

At the published direct API rate, this four-second request calculates to $0.32. For other durations, see MAGI-2 pricing and Studio credit examples. Parameters and limits checked November 27, 2026. Higgsfield's model-specific API reference.