Daily check-in

Come back daily for a little inspiration for your next creation.

— Image credits

Claim once a day. For image generation only.
Resets daily at midnight Beijing time.

Referral program

Share inspiration with friends
Create together, earn credits together

CREATE TOGETHER

After your friend generates 3 images successfully, rewards are added automatically. Share now to get started.

You receive—Image credits
Your friend receives—Image credits
  1. 1Share your personal invite link
  2. 2Your friend signs up and generates 3 images successfully
  3. 3Both rewards are credited automatically after review

Promotion credits are for images only, not videos. Each friend can participate once. Suspicious registrations and bulk activity are excluded.

Limited-time offer
Free image generation is live!Until 1,000 creators join· Sign up for creation credits. Explore every model.
ELUAI DEVELOPERS / API REFERENCE

开放 API 文档

从创建密钥到获取视频,开始将创作能力接入你的应用。

进入控制台 ↗
BASE URLhttps://eluai.cn/open/v1
OpenAPI JSON ↗

GET STARTED

快速开始

在控制台创建 API 密钥,并将它保存在服务端的 ELUAI_API_KEY 环境变量中。完整密钥只显示一次;不要放在网页或移动客户端代码中。

01创建密钥
02提交任务
03查询结果

POST /videos

示例使用 Seedance 2.0 Mini。提交前请确认该模型可用,或替换为适用模型并检查参数。

每个新业务任务都需要一个 8–128 位的 Idempotency-Key。先生成并持久保存唯一值,然后设置为 ELUAI_REQUEST_ID;重试同一任务时复用该值与完全相同的参数,参数变化会返回 409。例如,可在首次创建业务任务时生成:

export ELUAI_REQUEST_ID="$(python3 -c 'import uuid; print(uuid.uuid4())')"
创建视频任务 · cURL
curl 'https://eluai.cn/open/v1/videos' \
  -H "Authorization: Bearer $ELUAI_API_KEY" \
  -H "Idempotency-Key: $ELUAI_REQUEST_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "seedance-2.0-mini",
    "content": [{"type":"text","text":"海边日落,镜头缓缓向前"}],
    "duration": 4,
    "resolution": "720p",
    "ratio": "16:9"
  }'

成功返回 HTTP 202 和任务 ID。建议每隔约 10 秒查询一次;查询不会创建新任务。

GET /videos/{id}

查询任务 · cURL
curl 'https://eluai.cn/open/v1/videos/你的任务ID' \
  -H "Authorization: Bearer $ELUAI_API_KEY"
查看成功响应与 Python 示例

以下响应中的金额、用量和链接仅供示意。

{
  "id": "open_0123456789abcdef0123456789abcdef",
  "object": "video", "model": "seedance-2.0-mini", "status": "succeeded",
  "billing": {"currency":"CNY","reserved":"1.550000","charged":"1.421594",
    "rate_per_million_tokens":"16.284"},
  "usage": {"total_tokens": 87300},
  "content": {"video_url":"https://example.com/result.mp4"},
  "link_source": "eluai"
}
Python · 依赖 requests
import os, time, requests
base = "https://eluai.cn/open/v1"
headers = {"Authorization": "Bearer " + os.environ["ELUAI_API_KEY"]}
# 每个业务任务生成并持久保存唯一 ID;重试时复用 ID 和完全相同的参数。
request_id = os.environ["ELUAI_REQUEST_ID"]
payload = {"model": "seedance-2.0-mini", "content": [
    {"type": "text", "text": "海边日落,镜头缓缓向前"}
], "duration": 4, "resolution": "720p"}
r = requests.post(base + "/videos", json=payload,
    headers={**headers, "Idempotency-Key": request_id}, timeout=30)
r.raise_for_status()
task = r.json()
for _ in range(180):
    if task["status"] in ("succeeded", "failed", "submission_unknown"):
        break
    time.sleep(10)
    r = requests.get(base + "/videos/" + task["id"], headers=headers, timeout=30)
    r.raise_for_status()
    task = r.json()
print(task)  # 超时仍保留任务 ID,下次继续查询,勿重新生成。
CAPABILITIES

模型与参数

模型能力和价格以当前目录为准。请求时使用表中的模型 ID;调用 GET /models 可获取同一份目录和价格。

可用状态依据当前渠道配置及最近一次分组核验,不代表上游实时服务或模型能力;实际以调用结果为准。

正在加载模型目录…

duration 为整数,默认 4 秒;resolution 默认 720p。ratio 默认 16:9,支持 16:9、9:16、1:1、21:9、4:3、3:4;Seedance 2.5 首尾帧使用 adaptive。generate_audio 和 watermark 默认均为 true;seed 可选,范围 -1 至 4294967295。不支持的参数会返回 422。

INPUTS

参考素材

content 至少包含一条非空 text,文字合计不超过 15000 字符。素材须使用可公开访问的 HTTPS 直链:图片使用 image_url,视频使用 video_url,音频使用 audio_url,并指定对应的参考角色。

视频和音频参考需分别声明每个素材的真实 duration,每条至少 2 秒。2.0 系列视频及音频各不超过 15 秒,2.5 各不超过 30 秒;2.0 系列音频需搭配图片或视频。

参考图与视频示例
{
  "model": "seedance-2.5",
  "content": [
    {"type":"text","text":"参考视频的镜头节奏,保持图片中的主体"},
    {"type":"image_url","image_url":{"url":"https://your-cdn.example/product.jpg"},"role":"reference_image"},
    {"type":"video_url","video_url":{"url":"https://your-cdn.example/reference.mp4"},"role":"reference_video","duration":5}
  ],
  "duration": 6, "resolution": "720p"
}

首帧 first_frame 与尾帧 last_frame 各最多一张,尾帧需搭配首帧;同一 URL 可以同时作为首尾帧,但不能与普通参考素材混用。2.5 首尾帧自动采用 adaptive 比例。

首尾帧示例
{
  "model": "seedance-2.5",
  "content": [
    {"type":"text","text":"镜头从近景缓缓拉远"},
    {"type":"image_url","image_url":{"url":"https://your-cdn.example/first.jpg"},"role":"first_frame"},
    {"type":"image_url","image_url":{"url":"https://your-cdn.example/last.jpg"},"role":"last_frame"}
  ],
  "duration": 5, "resolution": "720p", "ratio": "adaptive"
}
BILLING

报价与结算

API 余额与 Studio 积分独立。使用 GET /balance 查询可用余额和冻结金额;首次开通赠额以后台当前设置为准,余额不足可联系客服。

提交前可用相同参数调用 POST /videos/quote 查询 maximum_charge。创建任务时冻结该金额;成功后按创建时的单价和实际 total_tokens 结算,扣费不超过冻结上限,剩余额度退回。含视频参考使用对应价格,并按模型允许的参考视频总时长上限预留。

明确失败会释放冻结金额;提交结果不明、用量待核对或结果转存中则暂时保留。价格调整只影响新任务,同一用户的密钥共享余额和并发限制。结果链接的有效期以实际返回和存储策略为准,请及时保存。

REFERENCE

状态与错误

正常流程为 queued → submitting → processing → delivering → succeeded。failed 表示已确认失败并退款;usage_pending 表示用量待核对;submission_unknown 表示提交结果不明,应保留任务 ID 联系客服,不要另建任务重试。

HTTP含义建议操作
401 / 403密钥无效或账号不可用检查密钥与账号状态
402可用额度不足补充额度后再提交
404任务不存在或不属于当前账号检查任务 ID
409幂等标识与参数冲突同一任务保持原参数
422参数、素材或内容检查未通过根据 detail 修正
429频率或并发超限等待任务完成后重试;每账号每分钟最多创建 30 个任务
503服务未启用或渠道未配置完成稍后重试或联系客服

业务错误格式为 {"detail":{"code":"insufficient_balance","message":"…"}};参数校验错误的 detail 为字段错误数组。创建请求网络超时后,使用相同的 Idempotency-Key 和参数重试,以取回原任务。