MAKEUGC PLATFORM API · DOCS V2
Imagen 4 Preview
Generate an image from text with Imagen 4 Preview.
IMAGE OUTPUTRequest
/enterprise/generate
Model ID: imagen4-preview.
Put model inputs inside params; keep model and project_id at the top level.
Request envelope
| Parameter | Description |
|---|---|
model
string
Required
|
Exact public model ID from the model catalog. |
params
object
Required
|
Model-specific input fields. See the individual model page for required fields, types, defaults and limits. |
project_id
string
Optional
|
Existing project belonging to your account. Omit to create a project automatically. |
Model parameters
| Parameter | Description |
|---|---|
prompt
string
Required
|
Describe the output you want to generate.
Allowed: |
num_images
integer
Optional
|
Number of output images; each image consumes credits.
Allowed:
Default: |
aspect_ratio
string
Optional
|
aspect ratio input.
Allowed:
Default: |
output_format
string
Optional
|
output format input.
Allowed:
Default: |
resolution
string
Optional
|
resolution input.
Allowed:
Default: |
Code examples
Set MAKEUGC_API_KEY on your server. Replace example media URLs with files you host and keep accessible during processing.
curl --fail-with-body --max-time 120 -X POST "https://app.makeugc.ai/api/platform/enterprise/generate" \
-H "X-Api-Key: $MAKEUGC_API_KEY" \
-H "Content-Type: application/json" \
--data '{
"model": "imagen4-preview",
"params": {
"prompt": "A studio photograph of a ceramic coffee cup on a warm neutral background."
}
}'
// Run on your server with Node.js 20+.
const apiKey = process.env.MAKEUGC_API_KEY;
if (!apiKey) throw new Error("Set MAKEUGC_API_KEY first");
const response = await fetch("https://app.makeugc.ai/api/platform/enterprise/generate", {
method: "POST",
headers: {
"X-Api-Key": apiKey,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "imagen4-preview",
"params": {
"prompt": "A studio photograph of a ceramic coffee cup on a warm neutral background."
}
}),
signal: AbortSignal.timeout(120000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text} (request ${response.headers.get("x-request-id")})`);
}
const result = JSON.parse(text);
console.log(result);
# Install the requests package before running.
import os
import requests
payload = {
"model": "imagen4-preview",
"params": {
"prompt": "A studio photograph of a ceramic coffee cup on a warm neutral background."
}
}
response = requests.post(
"https://app.makeugc.ai/api/platform/enterprise/generate",
headers={"X-Api-Key": os.environ["MAKEUGC_API_KEY"]},
json=payload,
timeout=120,
)
if not response.ok:
raise RuntimeError(f"HTTP {response.status_code}: {response.text} "
f"(request {response.headers.get('x-request-id')})")
print(response.json())
200 · Job accepted
{
"request_id": "request_123",
"project_id": "project_123",
"media": "image",
"model": "imagen4-preview",
"status": "queued",
"message": "Enterprise API job queued"
}
Retrieve the result
Save request_id, then poll every
5–10 seconds. A successful generation request does not mean the output is
ready.
curl --fail-with-body --max-time 120 -X GET "https://app.makeugc.ai/api/platform/enterprise/status/request_123?media=image" \
-H "X-Api-Key: $MAKEUGC_API_KEY"
// Run on your server with Node.js 20+.
const apiKey = process.env.MAKEUGC_API_KEY;
if (!apiKey) throw new Error("Set MAKEUGC_API_KEY first");
const response = await fetch("https://app.makeugc.ai/api/platform/enterprise/status/request_123?media=image", {
method: "GET",
headers: {
"X-Api-Key": apiKey,
},
signal: AbortSignal.timeout(120000),
});
const text = await response.text();
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${text} (request ${response.headers.get("x-request-id")})`);
}
const result = JSON.parse(text);
console.log(result);
# Install the requests package before running.
import os
import requests
response = requests.get(
"https://app.makeugc.ai/api/platform/enterprise/status/request_123?media=image",
headers={"X-Api-Key": os.environ["MAKEUGC_API_KEY"]},
timeout=120,
)
if not response.ok:
raise RuntimeError(f"HTTP {response.status_code}: {response.text} "
f"(request {response.headers.get('x-request-id')})")
print(response.json())
200 · Completed
{
"request_id": "request_123",
"media": "image",
"status": 1,
"mode": "imagen4-preview",
"project_id": "project_123",
"output": {
"output_link": [
"https://your-cdn.example/result.png"
]
},
"created_at": "2026-10-13T00:00:00.000Z",
"updated_at": "2026-10-13T00:00:30.000Z"
}
Read status: 0 is processing, 1 is completed and 2 is
failed. Video status can also be a string. Output is in
output.output_link[]
.
If completed has no output URL yet, continue polling within your timeout.
See jobs & webhooks.
Credits & errors
Cost: based on model settings and output count. Read returned credit fields when available. See credit units and limits.
Invalid inputs return 400; insufficient credits can return 400 or 402 depending on the generation path. Access restrictions return 403 and temporary model unavailability can return 503. See error handling. Each POST can start a billable job; do not automatically resubmit after a timeout.