curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "水墨画風の山水風景",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてください",
"type": "payment_required"
}
}
Z-Image-Turbo
Z-Image-Turbo 画像生成
- 非同期処理モード、後続のクエリ用にタスクIDを返します
- 軽量高速な画像生成、中国語と英語をサポート
- 1K/2K解像度レベルをサポート、スマートプロンプト書き換えをサポート
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "水墨画風の山水風景",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてください",
"type": "payment_required"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}'
import requests
url = "https://api.apimart.ai/v1/images/generations"
payload = {
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/images/generations";
const payload = {
model: "z-image-turbo",
prompt: "水墨画風の山水風景",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01JGXYZ1234567890ABCDEF"
}
]
}
{
"error": {
"code": 400,
"message": "リクエストパラメータが無効です",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "認証に失敗しました、APIキーを確認してください",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "残高不足です、チャージしてください",
"type": "payment_required"
}
}
サポートされているモデル
| モデル名 | 説明 | 生成枚数 | 課金方式 |
|---|---|---|---|
z-image-turbo | 軽量高速な画像生成、中国語と英語をサポート | 固定1枚 | 固定価格 |
認証
string
必須
すべてのエンドポイントはBearer Token認証が必要ですAPI Keyの取得:API Key管理ページでAPI Keyを取得してくださいリクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY
Body
string
必須
モデル名
z-image-turbo- 軽量高速な画像生成、中国語と英語をサポート
boolean
デフォルト:"false"
画像タスクを送信する前にコンテンツモデレーションを実行するかどうかを指定します。
true:omni-moderation-latestでプロンプトと入力画像を審査falseまたは省略:審査リクエストを行わず、審査コストや遅延を追加しない(デフォルト)
string
必須
画像生成のテキスト説明、最大800文字
string
デフォルト:"1:1"
画像のアスペクト比サポートされているアスペクト比:
1:1- 正方形(デフォルト)4:3- 横向き 4:33:4- 縦向き 3:416:9- 横向きワイドスクリーン9:16- 縦向き3:2- 横向き 3:22:3- 縦向き 2:3
string
デフォルト:"1K"
解像度レベル
1K- 標準解像度(デフォルト)2K- 高精細解像度
boolean
デフォルト:"false"
スマートプロンプト書き換え有効にすると、AIが自動的にプロンプトを最適化し、より良い結果を生成し、費用が増加します。
false- 無効(デフォルト)true- 有効
解像度対照表
size(比率)+ resolution(解像度レベル)の組み合わせで出力サイズを制御します。
| 比率 | 1Kレベル | 2Kレベル |
|---|---|---|
1:1 | 1024×1024 | 2048×2048 |
4:3 | 1152×864 | 2048×1536 |
3:4 | 864×1152 | 1536×2048 |
16:9 | 1280×720 | 2048×1152 |
9:16 | 720×1280 | 1152×2048 |
3:2 | 1248×832 | 2048×1360 |
2:3 | 832×1248 | 1360×2048 |
使用例
基本テキストから画像(最小リクエスト){
"model": "z-image-turbo",
"prompt": "水墨画風の山水風景"
}
{
"model": "z-image-turbo",
"prompt": "ミニマリストスタイルのカフェインテリアデザイン",
"size": "16:9",
"resolution": "2K"
}
{
"model": "z-image-turbo",
"prompt": "猫",
"prompt_extend": true
}
Response
integer
レスポンスステータスコード
注意事項
- 非同期処理:送信後に
task_idが返されます、結果を取得するには/v1/tasks/{task_id}をポーリングしてください - 画像保存:生成された画像はプラットフォームCDNにミラーリングされ、長期間有効です
- 課金ルール:正常に生成された画像の枚数に応じて課金、失敗した場合は課金されません
- 固定枚数:Z-Image-Turboは1リクエストにつき固定1枚生成、
nパラメータはサポートされていません