Branch #06 docs/api/06-image.md

08. Image Generation (GPT-Image / Gemini-Image)

Branch #06 — Sinh ảnh AI cho content ops, product studio, marketing campaigns.

Endpoints

POST
https://bizgpt.vn/wp-json/llm/router/v1/images/generations

Tạo ảnh từ prompt/reference

Auth: Bearer

GET
https://bizgpt.vn/wp-json/llm/router/v1/images/health

Health endpoint

Auth: Public

Method Path Auth Mô tả
POST https://bizgpt.vn/wp-json/llm/router/v1/images/generations Bearer Tạo ảnh từ prompt/reference
GET https://bizgpt.vn/wp-json/llm/router/v1/images/health Public Health endpoint

Query Examples

POST Tạo ảnh từ prompt/reference
curl -X POST "https://bizgpt.vn/wp-json/llm/router/v1/images/generations" -H "Authorization: Bearer biz-YOUR_KEY" -H "Content-Type: application/json" -d '{"sample":true}'
const res = await fetch('https://bizgpt.vn/wp-json/llm/router/v1/images/generations', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"sample":true}),
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/llm/router/v1/images/generations"
headers = {'Authorization': 'Bearer biz-YOUR_KEY', 'Content-Type': 'application/json'}
payload = '{"sample":true}'
res = requests.request("POST", url, headers=headers, data=payload)
print(res.json())
GET Health endpoint
curl -X GET "https://bizgpt.vn/wp-json/llm/router/v1/images/health"
const res = await fetch('https://bizgpt.vn/wp-json/llm/router/v1/images/health', {
  method: 'GET',
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/llm/router/v1/images/health"
headers = {}
res = requests.get(url, headers=headers)
print(res.json())

Use Cases

  • Tạo ảnh bài đăng social và banner chiến dịch.
  • Sinh ảnh sản phẩm theo style guide doanh nghiệp.
  • Làm input cho pipeline video hoặc landing page.

Implementation Steps

  1. Tạo prompt theo persona thương hiệu.
  2. Cố định size/aspect để đồng bộ output đa kênh.
  3. Lưu prompt và seed để tái tạo nội dung ổn định.

Quick Start cURL

bash
curl -X POST https://bizgpt.vn/wp-json/llm/router/v1/images/generations -H "Authorization: Bearer biz-YOUR_KEY" -H "Content-Type: application/json" -d "{\"prompt\":\"Premium product hero\",\"model\":\"google/gemini-3-pro-image-preview\",\"size\":\"1024x1024\"}"
Canonical Spec

docs/api/06-image.md