Ming Image — Generación de imágenes a partir de texto
curl --request POST \
--url https://api.novita.ai/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": {},
"prompt": "<string>",
"output_format": "<string>",
"response_format": "<string>",
"size": "<string>",
"watermark": true
}
'import requests
url = "https://api.novita.ai/v1/images/generations"
payload = {
"model": {},
"prompt": "<string>",
"output_format": "<string>",
"response_format": "<string>",
"size": "<string>",
"watermark": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
model: {},
prompt: '<string>',
output_format: '<string>',
response_format: '<string>',
size: '<string>',
watermark: true
})
};
fetch('https://api.novita.ai/v1/images/generations', 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.novita.ai/v1/images/generations",
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' => [
],
'prompt' => '<string>',
'output_format' => '<string>',
'response_format' => '<string>',
'size' => '<string>',
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.novita.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": {},\n \"prompt\": \"<string>\",\n \"output_format\": \"<string>\",\n \"response_format\": \"<string>\",\n \"size\": \"<string>\",\n \"watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v1/images/generations")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"model\": {},\n \"prompt\": \"<string>\",\n \"output_format\": \"<string>\",\n \"response_format\": \"<string>\",\n \"size\": \"<string>\",\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v1/images/generations")
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"] = '<authorization>'
request.body = "{\n \"model\": {},\n \"prompt\": \"<string>\",\n \"output_format\": \"<string>\",\n \"response_format\": \"<string>\",\n \"size\": \"<string>\",\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"created": 123,
"data": [
{
"b64_json": "<string>"
}
],
"output_format": "<string>",
"size": "<string>",
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
},
"output_tokens": 123,
"total_tokens": 123,
"output_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
}
},
"model": "<string>",
"id": "<string>"
}Image Generator
Ming Image — Generación de imágenes a partir de texto
POST
/
v1
/
images
/
generations
Ming Image — Generación de imágenes a partir de texto
curl --request POST \
--url https://api.novita.ai/v1/images/generations \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": {},
"prompt": "<string>",
"output_format": "<string>",
"response_format": "<string>",
"size": "<string>",
"watermark": true
}
'import requests
url = "https://api.novita.ai/v1/images/generations"
payload = {
"model": {},
"prompt": "<string>",
"output_format": "<string>",
"response_format": "<string>",
"size": "<string>",
"watermark": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
model: {},
prompt: '<string>',
output_format: '<string>',
response_format: '<string>',
size: '<string>',
watermark: true
})
};
fetch('https://api.novita.ai/v1/images/generations', 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.novita.ai/v1/images/generations",
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' => [
],
'prompt' => '<string>',
'output_format' => '<string>',
'response_format' => '<string>',
'size' => '<string>',
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.novita.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": {},\n \"prompt\": \"<string>\",\n \"output_format\": \"<string>\",\n \"response_format\": \"<string>\",\n \"size\": \"<string>\",\n \"watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
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.novita.ai/v1/images/generations")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"model\": {},\n \"prompt\": \"<string>\",\n \"output_format\": \"<string>\",\n \"response_format\": \"<string>\",\n \"size\": \"<string>\",\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.novita.ai/v1/images/generations")
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"] = '<authorization>'
request.body = "{\n \"model\": {},\n \"prompt\": \"<string>\",\n \"output_format\": \"<string>\",\n \"response_format\": \"<string>\",\n \"size\": \"<string>\",\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"created": 123,
"data": [
{
"b64_json": "<string>"
}
],
"output_format": "<string>",
"size": "<string>",
"usage": {
"input_tokens": 123,
"input_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
},
"output_tokens": 123,
"total_tokens": 123,
"output_tokens_details": {
"image_tokens": 123,
"text_tokens": 123
}
},
"model": "<string>",
"id": "<string>"
}Ming Image es una familia de modelos de generación de imágenes.
ming-image-0.1-design permite generar imágenes a partir de texto mediante el protocolo de generación de imágenes de OpenAI.
ming-image-0.1-design: Permite generar imágenes a partir de texto mediante el protocolo de generación de imágenes de OpenAI.ming-image-0.1-design-layer: Solo permite la separación en capas mediante el protocolo de edición de imágenes de OpenAI (consulta la API de separación en capas de Ming Image).
Encabezados de la solicitud
string
requerido
Admite:
application/jsonstring
requerido
Formato de autenticación Bearer, por ejemplo: Bearer {{API Key}}.
Cuerpo de la solicitud
enum
requerido
Nombre del modelo. Valores disponibles:
ming-image-0.1-designstring
requerido
Descripción textual de la imagen.
string
predeterminado:"png"
Formato de la imagen de salida. Debe ser
png o jpeg.string
predeterminado:"b64_json"
Formato en el que se devuelve la imagen; el valor predeterminado es
b64_json. Valores disponibles: url, b64_json. Nota: url tiene una validez de 24 horas.string
predeterminado:"auto"
Tamaño de la imagen de salida. El valor predeterminado
auto lo selecciona automáticamente según el modelo. Formato: "{w}x{h}", por ejemplo, "1024x1024".ming-image-0.1-design solo admite tamaños de 1k o superiores, por ejemplo, "1024x1024", "2048x2048".boolean
predeterminado:false
Controla si se añade una marca de agua a la imagen generada por IA.
true: activa la marca de agua visible y la marca de agua digital implícita en las imágenes generadas por IA, conforme a los requisitos de las políticas. false: desactiva todas las marcas de agua.Respuesta
integer
requerido
Marca de tiempo Unix (en segundos) del momento en que se creó la respuesta.
array
requerido
Array de imágenes devueltas; cada elemento contiene la información de una imagen generada.
Mostrar propiedades
Mostrar propiedades
string
Datos de la imagen generada codificados en base64.
string
requerido
Formato real de la imagen de salida, por ejemplo,
png, jpeg.string
nullobject
requerido
Estadísticas de uso de tokens.
Mostrar propiedades
Mostrar propiedades
integer
Total de tokens de entrada (0 para la generación de imágenes a partir de texto).
object
integer
Total de tokens de salida (es decir, los tokens consumidos por la imagen generada).
integer
Suma de los tokens de entrada y salida.
string
requerido
Nombre del modelo que procesó realmente la solicitud.
string
requerido
Identificador único de esta solicitud.
Ejemplo
Solicitud:
curl --location --request POST 'https://api.novita.ai/v1/images/generations' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'content-type: application/json' \
--data-raw '{
"model": "ming-image-0.1-design",
"prompt": "Generate a banana"
}'
Respuesta:
{
"created": 1789642354,
"data": [
{
"b64_json": "..."
}
],
"output_format": "png",
"size": null,
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"image_tokens": 0,
"text_tokens": 0
},
"output_tokens": 16384,
"total_tokens": 16384,
"output_tokens_details": {
"image_tokens": 16384,
"text_tokens": 0
}
},
"model": "Ming-Image-0.1-Design-StressTest",
"id": "2180534417896423312485570e8523"
}
Última modificación el 21 de septiembre de 2026