curl --request POST \ --url https://api.apimart.ai/v1/images/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Idempotency-Key: <unique-operation-key>' \ --data '{ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 }'
import requestsresponse = requests.post( "https://api.apimart.ai/v1/images/generations", headers={ "Authorization": "Bearer <token>", "Accept": "application/json", "Idempotency-Key": "<unique-operation-key>" }, json={ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 })response.raise_for_status()print(response.json())
const response = await fetch("https://api.apimart.ai/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer <token>", "Content-Type": "application/json", Accept: "application/json", "Idempotency-Key": "<unique-operation-key>" }, body: JSON.stringify({ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 })});if (!response.ok) throw new Error(await response.text());console.log(await response.json());
curl --request POST \ --url https://api.apimart.ai/v1/images/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Idempotency-Key: <unique-operation-key>' \ --data '{ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 }'
import requestsresponse = requests.post( "https://api.apimart.ai/v1/images/generations", headers={ "Authorization": "Bearer <token>", "Accept": "application/json", "Idempotency-Key": "<unique-operation-key>" }, json={ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 })response.raise_for_status()print(response.json())
const response = await fetch("https://api.apimart.ai/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer <token>", "Content-Type": "application/json", Accept: "application/json", "Idempotency-Key": "<unique-operation-key>" }, body: JSON.stringify({ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 })});if (!response.ok) throw new Error(await response.text());console.log(await response.json());
この API は非同期で処理します。送信後にタスク ID を保存し、GET /v1/tasks/{task_id} で状態と結果を取得します。デフォルトの送信レスポンスでは、ID は data[0].task_id にあります。
curl --request POST \ --url https://api.apimart.ai/v1/images/generations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Idempotency-Key: <unique-operation-key>' \ --data '{ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 }'
import requestsresponse = requests.post( "https://api.apimart.ai/v1/images/generations", headers={ "Authorization": "Bearer <token>", "Accept": "application/json", "Idempotency-Key": "<unique-operation-key>" }, json={ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 })response.raise_for_status()print(response.json())
const response = await fetch("https://api.apimart.ai/v1/images/generations", { method: "POST", headers: { Authorization: "Bearer <token>", "Content-Type": "application/json", Accept: "application/json", "Idempotency-Key": "<unique-operation-key>" }, body: JSON.stringify({ "model": "muse-image-ext", "prompt": "A red ceramic cup on a white table, soft studio lighting, product photography, no text", "aspect_ratio": "1:1", "n": 1 })});if (!response.ok) throw new Error(await response.text());console.log(await response.json());
{ "model": "muse-image-ext", "prompt": "Keep the cup from the reference image and place it on a wooden cafe table in warm natural light", "image_urls": [ "https://your-cdn.example/cup.png" ], "n": 1}