Mochi 1

Mochi 1 is a cutting-edge, open-source AI model that transforms text prompts into stunning, high-fidelity videos. Create captivating videos from simple text prompts with unparalleled quality and realism. Experience high-fidelity motion, strong prompt adherence, and limitless creative possibilities

~180.11s
~$0.266
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/mochi-1"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "Create a short, looped animation of a small, fluffy creature with big, round eyes and soft fur, similar to a baby Pikachu, emulating the adorable curiosity of baby animals. The creature should be sitting in a human hand, surrounded by a soft, natural forest setting with tiny flowers and gentle lighting. Subtle, lifelike movements include slight head tilts, gentle blinking, and small, curious paw or ear twitches. Its large eyes should glimmer with curiosity and warmth, occasionally widening as it looks around its environment, embodying the innocent curiosity and playfulness of a young animal. Keep the lighting soft, creating a warm, inviting atmosphere with faint sunlight filtering through, highlighting the softness of its fur.",
12    "negative_prompt": "blurry, low quality, distorted wings",
13    "guidance_scale": 4.5,
14    "fps": 16,
15    "steps": 30,
16    "seed": 985521,
17    "frames": 52
18}
19
20response = requests.post(url, headers=headers, json=data)
21
22if response.status_code == 200:
23    result = response.json()
24    print(json.dumps(result, indent=2))
25else:
26    print(f"Error: {response.status_code}")
27    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/mochi-1

Parameters

promptrequired
string

Prompt to generate video

fpsoptional
number

Output frames per second

Default: 16Range: 7 - 30
framesoptional
number

Total frames to be generated

Default: 52Range: 1 - 160
guidance_scaleoptional
number

Classifier-free guidance scale for text prompt

Default: 4.5Range: 2 - 10
negative_promptoptional
string

Negative Prompt

seedoptional
integer

Random seed.

Default: 985521
stepsoptional
integer

Number of denoising steps

Default: 30Range: 10 - 75

Response Type

Returns: Video

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out