Skip to main content
POST
Wan 2.7 image models are exposed through the Chat Completions endpoint, not the OpenAI-style /v1/images/generations path. Send a standard chat request with a multimodal content array containing a text prompt, and AIsa returns generated images as {type: "image"} parts inside choices[].message.content[].
Looking for Seedream (seedream-4-5-251128)? It uses a different route — /v1/images/generations. Gemini-compatible generateContent requests use /v1beta/models/{model}:generateContent. This page only covers the Wan 2.7 family.

Supported models

Request

The request schema is the same POST /v1/chat/completions you already use for text — the only differences are which model you pass and how content is structured. Critical rule: messages[].content must be an array of typed parts. Passing a plain string returns 400 invalid_parameter_error with the message "Input should be a valid list: messages[*].content".

Request fields

Response shape

  • One choice per image. If n=4, you get 4 entries in choices.
  • Every choice.message.content is an array with a single { "type": "image", "image": "..." } part.
  • image is a short-lived URL (download it soon) or base64 data, depending on your workspace configuration.
  • usage.total_tokens reflects the small token cost of the request framing — billing is per-image at the rate in the table above, not per token.

Image-to-image

Prepend an image_url part to the content array and follow it with a text instruction:

Why the playground shows the Chat Completions path

The playground sends exactly the same POST /v1/chat/completions request the standard OpenAI Chat endpoint uses — only the model and content shape are tuned for images. Your existing OpenAI-compatible SDK code works without modification; just swap the model and content shape.

Common 4xx causes

  • 400 invalid_parameter_error — Input should be a valid list: messages[*].contentcontent was passed as a string; wrap in an array of typed parts.
  • 400 referencing messages — you sent the Gemini-style contents/parts. Use messages with OpenAI multimodal parts for Wan models.
  • 404 openai_error on /v1/images/generations — wrong endpoint. Wan models do not route through that path.
  • 500 model_not_found — your workspace isn’t provisioned for the Wan family. Contact support.
See Error Codes and Rate Limits for more.

OpenAI Chat

The same endpoint used for text models.

Gemini generateContent

Gemini-compatible generateContent endpoint.

Media Gen skill

Agent skill that wraps image + video generation.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

Image-generation model. wan2.7-image ($0.030/image) for standard quality, wan2.7-image-pro ($0.075/image) for higher fidelity.

Available options:
wan2.7-image,
wan2.7-image-pro
messages
object[]
required

Conversation messages. Image prompts go in the last user message's content array as {type: "text"} parts.

n
integer
default:4

Number of images to generate. wan2.7-image returns 4 by default; pass 1 to save cost.

Required range: 1 <= x <= 4

Response

Images generated. Returned as Chat Completion with message.content[] image parts.

id
string
Example:

"chatcmpl-fcc86dfd-9424-9523-b0bd-cdf07383bee2"

object
string
Example:

"chat.completion"

created
integer
Example:

1776495713

model
string
Example:

"wan2.7-image"

choices
object[]

One entry per generated image.

usage
object