跳转到主要内容
POST
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.foxapi.cc/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "wan-2.7-image",
  "prompt": "A cinematic portrait of a traveler in neon rain",
  "num_outputs": 1,
  "image_size": "portrait_4_3"
}
'
{
  "created": 1757165031,
  "id": "task-unified-1757165031-uyujaw3d",
  "model": "<string>",
  "object": "image.generation.task",
  "progress": 0,
  "status": "pending",
  "task_info": {
    "can_cancel": true,
    "estimated_time": 45
  },
  "type": "image"
}

Documentation Index

Fetch the complete documentation index at: https://docs.foxapi.cc/llms.txt

Use this file to discover all available pages before exploring further.

授权

Authorization
string
header
必填

所有接口均需要使用Bearer Token进行认证

使用时在请求头中添加:

Authorization: Bearer YOUR_API_KEY

请求体

application/json
model
string
默认值:wan-2.7-image
必填

wan-2.7-image:标准版,支持文生图和图像编辑 wan-2.7-image-pro:Pro 版,支持文生图和图像编辑

示例:

"wan-2.7-image"

"wan-2.7-image-pro"

prompt
string
必填

图像生成或编辑提示词

说明:

  • 文生图模式:描述想要生成的图像内容
  • 图像编辑模式:描述对参考图的编辑指令
  • 支持中英文
  • 最多 2000 个字符
Maximum string length: 2000
示例:

"A cinematic portrait of a traveler in neon rain"

image_urls
string[] | null

参考图片 URL 列表

说明:

  • 传入后自动切换到图像编辑模式
  • 支持 1-4 张公开可访问的图片 URL
  • 多图编辑时,提示词中可按 image 1 / image 2 的顺序引用
示例:
["https://example.com/photo.jpg"]
num_outputs
integer
默认值:1

输出图片数量

说明:

  • 文生图模式:支持 1-5
  • 图像编辑模式:支持 1-4
必填范围: 1 <= x <= 5
示例:

1

image_size
默认值:square_hd

输出图像尺寸

可选值:

  • 预设:square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
  • 显式尺寸对象:{width, height}
可用选项:
square_hd,
square,
portrait_4_3,
portrait_16_9,
landscape_4_3,
landscape_16_9
示例:

"square_hd"

negative_prompt
string
默认值:""

负向提示词,用于描述希望避免出现的内容

Maximum string length: 500
示例:

"blurry, low quality"

seed
integer | null

随机种子,用于提升结果复现性

必填范围: 0 <= x <= 2147483647
示例:

42

enable_safety_checker
boolean | null

是否启用安全检查

说明:

  • 控制输入和输出的内容安全审核
  • 不传则使用模型默认行为

非必须不要传这个参数。

示例:

true

enable_prompt_expansion
boolean | null

是否启用提示词扩展

说明:

  • 仅图像编辑模式可用
  • 不传则使用模型默认行为

非必须不要传这个参数。

示例:

true

响应

任务创建成功

created
integer

任务创建时间戳

示例:

1757165031

id
string

任务ID

示例:

"task-unified-1757165031-uyujaw3d"

model
string

实际使用的模型名称

object
enum<string>

任务的具体类型

可用选项:
image.generation.task
progress
integer

任务进度百分比 (0-100)

必填范围: 0 <= x <= 100
示例:

0

status
enum<string>

任务状态

可用选项:
pending,
processing,
completed,
failed
示例:

"pending"

task_info
object

异步任务信息

type
enum<string>

任务的输出类型

可用选项:
image
示例:

"image"