Dokumentasi API

API pembuatan gambar

Panggil model gambar yang tersedia, kelola format output, dan pantau biaya pembuatan gambar.

Ringkasan panduan

Panggil model gambar yang tersedia, kelola format output, dan pantau biaya pembuatan gambar.

Panggil model gambar yang tersedia, kelola format output, dan pantau biaya pembuatan gambar.

Contoh kode

These examples all call the same public LingCoreX endpoint.

curl — wan2.7-image
curl https://api.lingcorex.ai/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "wan2.7-image",
    "prompt": "A quiet mountain lake at sunrise, cinematic photography, no text",
    "n": 1,
    "size": "1K"
  }'
Python — wan2.7-image-pro
import requests

response = requests.post(
    "https://api.lingcorex.ai/v1/images/generations",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "model": "wan2.7-image-pro",
        "prompt": "A premium studio photograph of a blue glass perfume bottle",
        "n": 1,
        "size": "2K",
        "watermark": False,
    },
    timeout=600,
)
response.raise_for_status()

payload = response.json()
print(payload["data"][0]["url"])
JavaScript — fetch
const response = await fetch(
  "https://api.lingcorex.ai/v1/images/generations",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "wan2.7-image",
      prompt: "An isometric illustration of a small green energy laboratory",
      n: 1,
      size: "1024x1024",
    }),
  },
)

if (!response.ok) {
  throw new Error(await response.text())
}

const result = await response.json()
console.log(result.data[0].url)

Contoh kode 2

Wan responses are normalized to the OpenAI Images API shape and include the successful image count.

Successful Wan response
{
  "created": 1784962566,
  "data": [
    {
      "url": "https://example-oss.aliyuncs.com/generated-image.png?SIGNED_QUERY"
    }
  ],
  "usage": {
    "image_count": 1
  }
}

Checklist integrasi

01

1

Buat kunci API di dasbor dan pilih grup model yang tepat.

02

2

Jalankan contoh di lingkungan uji, lalu periksa error dan catatan penggunaan.

03

3

Sebelum production, verifikasi QPM, anggaran, dan harga model efektif.

Mencari harga atau ringkasan produk?

Gunakan halaman harga untuk informasi komersial terbaru dan beranda untuk gambaran produk.