Skip to content

Seedream 5.0 Lite ​

Seedream 5.0 Lite 请求参数与示例。

POST /v1/images/generations · POST /v1/async/images/generations

POST /v1/images/edits · POST /v1/async/images/edits

发送 JSON,请求头填写 Authorization: Bearer <PIXAPI_KEY> 和 Content-Type: application/json。

请求字段 ​

通用字段放在请求体一级,下面列出的模型专用参数放进 providerOptions。

字段类型必填说明
modelstring是seedream-5-0-lite. 模型 ID,区分大小写。
promptstring是描述主体、构图、风格或需要修改的内容。Pixapi 最多保留前 2,000 字符;生成和编辑都要提供非空提示词。
ninteger否默认 1;Pixapi 支持 1–9(最多 15),大于 1 会启用组图。
sizestring否填写 宽x高 像素尺寸,例如 1024x1024。
imagestring / string[]编辑时必填公网 HTTP(S) 图片 URL 或 URL 数组;/images/edits 必填。 JPEG/PNG,每张 ≤ 10 MB、≤ 6000×6000 像素,宽高比 1:3–3:1。 Pixapi 当前最多接受 4 张参考图。
providerOptionsobject否模型专用选项,详见下表。

providerOptions ​

本表所有字段都写在 providerOptions 内,不要与 model 并列。

字段类型说明
nsfw_checkboolean是否审核提示词和图片,默认 false。
output_formatstring输出图片格式:jpeg(默认)或 png。
watermarkboolean是否添加 AI 可见水印,默认 false。
sequential_image_generationstringdisabled(默认)或 auto;n>1 自动启用 auto。
sequential_image_generation_optionsobject组图模式使用 {"max_images":N};N 与一级字段 n 保持一致。

输入规则 ​

输出尺寸请用 size 指定。

示例 ​

bash
curl https://api.pixapi.ai/v1/images/generations \
  -H "Authorization: Bearer $PIXAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "seedream-5-0-lite",
  "prompt": "A ceramic coffee cup in soft studio light",
  "n": 1,
  "size": "2048x2048",
  "providerOptions": {
    "output_format": "png",
    "watermark": false
  }
}'
py
import os
import requests

response = requests.post(
    "https://api.pixapi.ai/v1/images/generations",
    headers={"Authorization": f"Bearer {os.environ['PIXAPI_KEY']}"},
    json={
  "model": "seedream-5-0-lite",
  "prompt": "A ceramic coffee cup in soft studio light",
  "n": 1,
  "size": "2048x2048",
  "providerOptions": {
    "output_format": "png",
    "watermark": False
  }
},
)
response.raise_for_status()
print(response.json())
js
const response = await fetch('https://api.pixapi.ai/v1/images/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PIXAPI_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "model": "seedream-5-0-lite",
  "prompt": "A ceramic coffee cup in soft studio light",
  "n": 1,
  "size": "2048x2048",
  "providerOptions": {
    "output_format": "png",
    "watermark": false
  }
}),
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
go
package main

import (
  "bytes"
  "fmt"
  "io"
  "net/http"
  "os"
)

func main() {
  body := []byte(`{
  "model": "seedream-5-0-lite",
  "prompt": "A ceramic coffee cup in soft studio light",
  "n": 1,
  "size": "2048x2048",
  "providerOptions": {
    "output_format": "png",
    "watermark": false
  }
}`)
  req, err := http.NewRequest("POST", "https://api.pixapi.ai/v1/images/generations", bytes.NewBuffer(body))
  if err != nil { panic(err) }
  req.Header.Set("Authorization", "Bearer " + os.Getenv("PIXAPI_KEY"))
  req.Header.Set("Content-Type", "application/json")
  resp, err := http.DefaultClient.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()
  result, err := io.ReadAll(resp.Body)
  if err != nil { panic(err) }
  if resp.StatusCode >= 400 { panic(string(result)) }
  fmt.Println(string(result))
}

异步请求保存返回的 id,用 GET /v1/tasks/{id} 查询至 completed 或 failed。参阅查询结果和计费说明。