Create or update MiniMax API account configuration
September 25, 2024 (November 4, 2024)
Table of contents
To generate videos use hailuoai.video account.
To generate music use hailuoai.com/music account.
See Setup MiniMax for details.
For your convenience, you can specify your MiniMax configuration values under your account. If you specify multiple MiniMax accounts, the API will automatically perform load balancing by randomly selecting an account with available capacity before making calls to MiniMax.
https://api.useapi.net/v1/minimax/accounts/
account
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
API token
is required, see Setup useapi.net for details.
Request Body
{
"account": "MiniMax account",
"url": "MiniMax url",
"token": "MiniMax token",
"maxJobs": 1-10,
}
-
account
,url
andtoken
are required. Please see Setup MiniMax for details. -
account
value specified in the request body must match the account value specified in the URL path https://api.useapi.net/v1/minimax/accounts/account
. -
maxJobs
is required. Currently, it should be between 1 and 10.
For video accounts, please set this number according to your subscription plan. We recommend setting it to 2 (3 maximum) for Free, and 3 (4 maximum) for Standard and Unlimited plans. Although you can set it to higher values (3 for Free and 5 for Standard and Unlimited respectively), it won’t make any difference since only one video can be processed at a time for Free accounts, and no more than two for Standard and Unlimited accounts. It’s helpful to have a spare empty slot for cases where the MiniMax website is too busy and responds with502
or504
while still accepting jobs into the internal queue.
For music accounts please set this number to 1.
Responses
-
{ "account": "123456", "jwt": { "token": "abc…secured…xyz", "user": { "deviceID": "123456789", "id": "123456", "isAnonymous": true, "name": "<name>", "avatar": "<url>" }, "exp": 1734858598.864, "iat": 1732266598.864, "host": "hailuoai.video", "searchParams": "device_platform=web&app_id=3001&version_code=22201&uuid=b5df53d1-4c0d-4c77-8422-87e3f3b1a1d6&device_id=123456789&os_name=Windows&browser_name=chrome&device_memory=8&cpu_core_num=4&browser_language=en-US&browser_platform=Win32&screen_width=1920&screen_height=1080&unix=1732266598000", "iat_Issued": "2024-01-01T00:00:00.000Z", "exp_Expire": "2024-12-01T00:00:00.000Z" }, "maxJobs": 1, "supportMusic": false, "supportVideo": true }
-
{ "error": "<Error message>", "code": 400 }
-
{ "error": "Unauthorized", "Wrong username/password combination.", "This account has been suspended." "code": 401 }
Model
{ // TypeScript, all fields are optional
account: string
jwt: {
token: string
user: {
deviceID: string
id: string
isAnonymous: boolean
name: string
avatar: string
},
exp: number
iat: number
host: string
searchParams: string
iat_Issued: string
exp_Expire: string
}
maxJobs: number
supportMusic: boolean
supportVideo: boolean
}
Examples
-
curl -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -X POST https://api.useapi.net/v1/minimax/accounts/<account> \ -d '{"account": "…", "url": "…", "token": "…", "maxJobs": …}'
-
const account = "MiniMax account"; const url = "MiniMax url"; const token = "MiniMax token"; const apiUrl = `https://api.useapi.net/v1/minimax/accounts/${account}`; const api_token = "API token"; const maxJobs = 1; const data = { method: 'POST', headers: { 'Authorization': `Bearer ${api_token}`, 'Content-Type': 'application/json' } }; data.body = JSON.stringify({ account, url, token, maxJobs }); const response = await fetch(apiUrl, data); const result = await response.json(); console.log("response", {response, result});
-
import requests account = "MiniMax account" url = "MiniMax url" token = "MiniMax token" apiUrl = f"https://api.useapi.net/v1/minimax/accounts/{account}" api_token = "API token" maxJobs = 1 headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {api_token}" } body = { "account": f"{account}", "url": f"{url}", "token": f"{token}", "maxJobs": maxJobs } response = requests.post(apiUrl, headers=headers, json=body) print(response, response.json())