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?
- Scene. The API requires a nonempty
promptand accepts up to 15,000 characters. The Genjutsu Studio text field accepts up to 10,000. For a first test, describe one visible action. The prompt examples include a scene you can compare with a finished MP4. - Length. Set
durationto a whole number from 4 to 30. Omitting it requests the API default of five seconds. The API bills the requested length. - Frame. Set
resolutionto1080p. The six supported shapes are 16:9, 9:16, 1:1, 4:3, 3:4 and 21:9. The default is 16:9. - Audio. The API defaults
generate_audioto true. Set it to false for a silent output, or name a sound source in the prompt when you want the model to generate audio.
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.