给不会写代码的人
把 AI 接入,变成 选择题
选择模型,生成一份可以直接发给 AI 的接入说明。你不需要先学会 API。
觉得麻烦?在线使用
① 选择配置 → ② 复制接入包 → ③ 发给 AI
调用方式
refs,最多 14 张;可带可不带。url 是本站路径(如 /outputs/….png),前面加上 https://72agi.com 即可下载。queued → processing → succeeded / failed。配置变化会实时更新,复制后直接发给 AI。
新手提示:异步接口要轮询任务 id;成功后用 url 拼完整地址下载;失败请读 error。
查看完整 API 文档 →用它在你自己的程序里出图。一把密钥、一个接口,按张计费,额度就是你在本站的余额。
生产环境主机:https://72agi.com(下文示例已使用该地址)。
登录后打开 我的,页面上就有你的密钥,点「复制」即可。一个账号一把,随时能换。
每个请求带一个头就行:
Authorization: Bearer YOUR_KEY
只认这个请求头。浏览器登录后的 Cookie 不能调用出图 / 音乐接口(会返回 403,code 为 studio_retired)。不要把密钥放在 URL 查询参数里 —— 那会留在访问日志里。
curl https://72agi.com/api/models
返回模型、每张单价(人民币)与支持的比例。价格以下单时返回的为准。
[
{
"id": "nano-banana-pro",
"name": "Nano Banana Pro",
"prices": {"1K": 0.25, "2K": 0.25, "4K": 0.25},
"type": "image",
"sizes": ["auto", "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]
},
{
"id": "nano-banana-2",
"name": "Nano Banana 2",
"prices": {"1K": 0.25, "2K": 0.25, "4K": 0.25},
"type": "image",
"sizes": ["auto", "1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9"]
},
{
"id": "nano-banana-pro-plus",
"name": "Nano Banana Pro+",
"prices": {"1K": 0.35, "2K": 0.35, "4K": 0.35},
"type": "image",
"sizes": ["auto", "1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]
},
{
"id": "nano-banana-2-plus",
"name": "Nano Banana 2+",
"prices": {"1K": 0.35, "2K": 0.35, "4K": 0.35},
"type": "image",
"sizes": ["auto", "1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9"]
},
{
"id": "gpt-image-2",
"name": "GPT Image 2",
"prices": {"1K": 0.25, "2K": 0.25, "4K": 0.25},
"type": "image",
"sizes": ["auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5", "2:1", "1:2", "21:9", "9:21"]
},
{
"id": "gpt-image-2.5-flare",
"name": "GPT Image 2.5 Flare",
"prices": {"1K": 0.25, "2K": 0.25, "4K": 0.25},
"type": "image",
"sizes": ["auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "21:9", "3:1", "1:3"]
},
{
"id": "gpt-image-2.5-sunburst",
"name": "GPT Image 2.5 Sunburst",
"prices": {"1K": 0.25, "2K": 0.25, "4K": 0.25},
"type": "image",
"sizes": ["auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "21:9", "3:1", "1:3"]
},
{
"id": "image2.5-mid",
"name": "Image 2.5 Mid",
"blurb": "Special mid channel. Same vlk_ key. 1K only. About ¥0.1 per image.",
"prices": {"1K": 0.10},
"type": "image",
"sizes": ["auto", "1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "21:9", "3:1", "1:3"]
}
]
特殊 mid 渠道。模型名写 image2.5-mid,仍用同一把 Bearer vlk_… Key,不必换 Key。单价约 ¥0.10 / 张。调用方式与其它图片模型相同:POST /api/generate,再轮询 /api/task/{id}。
分辨率:仅 1K。本模型没有 2K / 4K 选项;请求里请固定 resolution=1K,传 2K 或 4K 会返回 400。价格与画幅比例无关,仍以 /api/models 的 prices / resolutions 为准。
curl -X POST https://72agi.com/api/generate \ -H "Authorization: Bearer YOUR_KEY" \ -F "prompt=a quiet mountain path in afternoon light" \ -F "model=image2.5-mid" \ -F "size=16:9" \ -F "resolution=1K"
每一次真正提交任务之前,客户端 / 工作流都必须先把本次参数完整展示给操作者确认,只有操作者明确点「确认」之后,才允许调用生成接口。未确认不得自动连发。
通过 API / n8n / 自建机器人接入时,请在你自己的界面或对话里实现确认步骤,不要静默连发。
两步:提交拿到任务号,然后轮询拿结果。单张实测 100 秒上下(4K 更久),所以别用同步等待,轮询更稳 —— 断网、刷新页面都不会丢任务。
提交(multipart 表单):
curl -X POST https://72agi.com/api/generate \ -H "Authorization: Bearer YOUR_KEY" \ -F "prompt=a quiet room, cream light" \ -F "model=gpt-image-2.5-sunburst" \ -F "size=16:9" \ -F "resolution=1K"
202 {"id": "02a38b1d1b66", "status": "queued"}
轮询:
curl https://72agi.com/api/task/02a38b1d1b66
{"id": "02a38b1d1b66", "status": "processing"}
{"id": "02a38b1d1b66", "status": "succeeded",
"url": "/outputs/02a38b1d1b66.png", "price": 0.25}
status 有四个值:queued / processing / succeeded / failed。建议每 3–5 秒轮一次。
成功时 url 是本站路径,不是服务链接。加上域名即可下载:
失败不扣额度,error 里是原因。生成成功才扣:提交时不动余额,出图成功那一刻才扣这一张的价钱。
同一个接口,多传 refs 字段。最多 14 张,超出部分忽略。
curl -X POST https://72agi.com/api/generate \ -H "Authorization: Bearer YOUR_KEY" \ -F "prompt=turn this into a watercolour" \ -F "model=gpt-image-2.5-sunburst" \ -F "refs=@./source.png"
提交前请再确认参考图顺序(第 1 张最优先影响构图)。顺序不对就先调整 refs 再生成。
参考图会影响结果的构图与风格,也会拖慢出图。能少传就少传。
传 size=auto 可以保持参考图的画幅:传一张 3:2 的照片,就出 3:2 的图(吸附到该模型支持的最接近比例)。也可写 adaptive 或 自适应。
curl -X POST https://72agi.com/api/generate \ -H "Authorization: Bearer YOUR_KEY" \ -F "prompt=same scene, golden hour light" \ -F "model=gpt-image-2.5-flare" \ -F "size=auto" \ -F "refs=@./photo-3x2.jpg"
curl https://72agi.com/api/credits -H "Authorization: Bearer YOUR_KEY"
{"credits": 29.75, "unlimited": false, "role": "user"}
额度单位是人民币。unlimited 为 true 时不扣费(管理员)。想看「我是谁、能做什么」用 GET /api/session。
Generate full songs (vocals or instrumental) with Suno 5.5 (suno-v5.5) or Suno 5 (suno-v5). ¥0.80 per generation (≈ $0.12), each generation returns 2 tracks (mp3 + cover). Usually done in about 45–60 s (allow a few minutes when busy). Charged only when it succeeds; a failed job costs nothing.
Same flow as images: submit, get a job id, poll. API key only — Authorization: Bearer YOUR_KEY (browser cookie sessions are rejected). Body is JSON.
curl -X POST https://72agi.com/api/music \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-v5.5",
"prompt": "calm lo-fi piano, gentle beat, late night",
"instrumental": true
}'
202 {"id": "mus_3f9c0a1b2c3d4e5f", "object": "music.job", "status": "queued",
"model": "suno-v5.5", "price": 0.8}
Poll every 5 seconds until status is succeeded or failed:
curl https://72agi.com/api/music/mus_3f9c0a1b2c3d4e5f \ -H "Authorization: Bearer YOUR_KEY"
{"id": "mus_3f9c0a1b2c3d4e5f", "object": "music.job", "status": "processing",
"model": "suno-v5.5", "price": 0.8, "created": 1791385944.0, "tracks": [], "error": ""}
{"id": "mus_3f9c0a1b2c3d4e5f", "object": "music.job", "status": "succeeded",
"model": "suno-v5.5", "price": 0.8, "created": 1791385944.0,
"tracks": [
{"index": 0, "audio_url": "/outputs/music/mus_3f9c0a1b2c3d4e5f_0.mp3",
"image_url": "/outputs/music/mus_3f9c0a1b2c3d4e5f_0.jpg",
"title": "Paper Rain", "tags": "lo-fi, piano, gentle", "duration": 157.2,
"lyrics": "[Instrumental]"},
{"index": 1, "audio_url": "/outputs/music/mus_3f9c0a1b2c3d4e5f_1.mp3", "...": "..."}
],
"error": "", "finished": 1791386000.0, "expires_at": 1791472400.0}
{"id": "mus_...", "object": "music.job", "status": "failed", "model": "suno-v5.5", "price": 0.8, "tracks": [],
"error": "音乐生成失败,未扣费,请稍后再试。 / Music generation failed (not charged). Please try again."}
audio_url / image_url are paths on this site: download from https://72agi.com + path. Files are kept for 24 hours (see expires_at) — save them on your side. After that the job returns expired: true and an empty tracks list.
Python:
import os, time, requests
BASE = "https://72agi.com"
H = {"Authorization": "Bearer " + os.environ["VELIN_API_KEY"]}
r = requests.post(BASE + "/api/music", headers=H, json={
"model": "suno-v5.5", # or "suno-v5"
"prompt": "upbeat city-pop song about a summer night bike ride",
"instrumental": False,
}, timeout=60)
r.raise_for_status() # 400 bad body, 401 bad key, 402 not enough credits, 429 rate limited
job_id = r.json()["id"]
deadline = time.time() + 15 * 60
while True:
p = requests.get(f"{BASE}/api/music/{job_id}", headers=H, timeout=30)
p.raise_for_status()
job = p.json()
if job["status"] in ("succeeded", "failed") or time.time() > deadline:
break
time.sleep(5)
if job["status"] != "succeeded":
raise SystemExit(job.get("error") or "still running, poll again later")
for t in job["tracks"]:
mp3 = requests.get(BASE + t["audio_url"], timeout=120).content
open(f"{job_id}_{t['index']}.mp3", "wb").write(mp3)
print(t["title"], t["duration"], "s")
Custom mode — you write the lyrics, style and title:
{"model": "suno-v5.5", "custom_mode": true, "instrumental": false,
"title": "Summer Ride", "style": "city pop, upbeat, female vocal, 110 bpm",
"prompt": "[Verse]\nNeon on the river...\n[Chorus]\nWe ride all night...",
"vocal_gender": "f"}
型号公开名 kling4.0。目前邀请测试中:仅白名单 Key 可在 GET /api/models 看到并调用。定价约 ¥0.16/s(¥5 / 30s),按时长线性;仅 720p;比例 16:9 / 9:16 / 1:1 / 21:9;时长 3–30 秒任意整数。
提交 POST /api/video 之前,必须先向用户确认:完整提示词、比例、时长、清晰度(720p)、参考图顺序(若有)。用户确认后才可提交。
图生视频两种模式:全局(i2v_mode=global,仅 first_image)与 首尾(i2v_mode=first_last,另需 tail_image)。工作室工具栏在「时长」后可选。可先 POST /api/video/refs 上传帧图再提交。
提交(JSON):
curl -X POST https://72agi.com/api/video \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling4.0",
"mode": "text_to_video",
"prompt": "cinematic drone shot over misty mountains at sunrise",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9"
}'
轮询:
curl https://72agi.com/api/video/JOB_ID \ -H "Authorization: Bearer YOUR_KEY"
status:queued → processing → succeeded / failed。成功时 works[0].url 是本站路径(拼 https://72agi.com 下载)。成功才扣费;失败不扣。结果约保留 24 小时,请自行转存。
充值出图额度请到 生图充值 页。
有问题、需要大批量或代理价格?直接联系我们,Telegram 回复最快。

Terms · Privacy · Refund Policy · Acceptable Use · Pricing · Contact