跳转到主要内容
POST
cURL
向 active 素材组上传一个素材源。在 Authorization 请求头中发送原始 access token,不要添加 Bearer 前缀。真人组只接受图片素材。

上传文件

本地素材使用 file 字段:

上传图片 URL

可通过公开 URL 访问的素材使用 JSON 格式:
请求必须且只能包含一个素材源:file、url 或 data。可选的 name 字段最多接受 64 个字符。保存响应中的 data.id。新素材通常返回 data.status=processing,因此使用获取形象素材 直到状态变为 active。 如果组不是 active,API 会返回 success: false 以及说明组状态的消息。即使 HTTP 响应为 200,也要检查业务错误中的 success 和 message。

授权

Authorization
string
header
必填

Raw CometAPI access token. Do not prefix it with Bearer.

请求体

Provide exactly one source: file, url, or data.

group_id
string
必填

Active CometAPI group ID.

示例:

"ag-example"

asset_type
enum<string>
必填

Asset media type.

可用选项:
image,
video,
audio
name
string

Optional asset name.

Maximum string length: 64
file
file

Local file source.

url
string<uri>

Public HTTPS source URL.

Pattern: ^https://
data
string

Base64 or data URI source.

响应

Asset accepted for processing.

success
boolean
必填

Whether the request succeeded.

message
string
必填

Status or error message.

data
object
必填
最后修改于 2026年12月1日