curl --request POST \ --url https://api.minimax.cn/v1/image_generation \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: <content-type>' \ --data '{ "model": "image-01", "prompt": "A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.", "aspect_ratio": "16:9", "response_format": "url", "n": 3, "prompt_optimizer": true}'
import requests
url = "https://api.minimax.cn/v1/image_generation"
payload = {
"model": "image-01",
"prompt": "A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.",
"aspect_ratio": "16:9",
"response_format": "url",
"n": 3,
"prompt_optimizer": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
model: 'image-01',
prompt: 'A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.',
aspect_ratio: '16:9',
response_format: 'url',
n: 3,
prompt_optimizer: true
})
};
fetch('https://api.minimax.cn/v1/image_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.cn/v1/image_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'image-01',
'prompt' => 'A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.',
'aspect_ratio' => '16:9',
'response_format' => 'url',
'n' => 3,
'prompt_optimizer' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.cn/v1/image_generation"
payload := strings.NewReader("{\n \"model\": \"image-01\",\n \"prompt\": \"A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.\",\n \"aspect_ratio\": \"16:9\",\n \"response_format\": \"url\",\n \"n\": 3,\n \"prompt_optimizer\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.minimax.cn/v1/image_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"image-01\",\n \"prompt\": \"A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.\",\n \"aspect_ratio\": \"16:9\",\n \"response_format\": \"url\",\n \"n\": 3,\n \"prompt_optimizer\": true\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.minimax.cn/v1/image_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"image-01\",\n \"prompt\": \"A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.\",\n \"aspect_ratio\": \"16:9\",\n \"response_format\": \"url\",\n \"n\": 3,\n \"prompt_optimizer\": true\n}"
response = http.request(request)
puts response.read_body
curl --request POST \ --url https://api.minimax.cn/v1/image_generation \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: <content-type>' \ --data '{ "model": "image-01", "prompt": "A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.", "aspect_ratio": "16:9", "response_format": "url", "n": 3, "prompt_optimizer": true}'
import requests
url = "https://api.minimax.cn/v1/image_generation"
payload = {
"model": "image-01",
"prompt": "A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.",
"aspect_ratio": "16:9",
"response_format": "url",
"n": 3,
"prompt_optimizer": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
model: 'image-01',
prompt: 'A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.',
aspect_ratio: '16:9',
response_format: 'url',
n: 3,
prompt_optimizer: true
})
};
fetch('https://api.minimax.cn/v1/image_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimax.cn/v1/image_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'image-01',
'prompt' => 'A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.',
'aspect_ratio' => '16:9',
'response_format' => 'url',
'n' => 3,
'prompt_optimizer' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimax.cn/v1/image_generation"
payload := strings.NewReader("{\n \"model\": \"image-01\",\n \"prompt\": \"A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.\",\n \"aspect_ratio\": \"16:9\",\n \"response_format\": \"url\",\n \"n\": 3,\n \"prompt_optimizer\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
HttpResponse<String> response = Unirest.post("https://api.minimax.cn/v1/image_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"image-01\",\n \"prompt\": \"A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.\",\n \"aspect_ratio\": \"16:9\",\n \"response_format\": \"url\",\n \"n\": 3,\n \"prompt_optimizer\": true\n}")
.asString();
require 'uri'
require 'net/http'
url = URI("https://api.minimax.cn/v1/image_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"image-01\",\n \"prompt\": \"A man in a white t-shirt, full-body, standing front view, outdoors, with the Venice Beach sign in the background, Los Angeles. Fashion photography in 90s documentary style, film grain, photorealistic.\",\n \"aspect_ratio\": \"16:9\",\n \"response_format\": \"url\",\n \"n\": 3,\n \"prompt_optimizer\": true\n}"
response = http.request(request)
puts response.read_body