AceDataCloud AI 数据服务 API 完整使用指南。
入门
1. 创建账户
在 platform.acedata.cloud 注册。
2. 订阅服务
浏览可用服务,点击 Get 订阅。大多数服务包含免费配额。
3. 创建 API 凭证
进入服务的 Credentials 页面,创建 API Token。
身份验证
所有 API 使用 Bearer token 身份验证:
curl -X POST https://api.acedata.cloud/ \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
Token 类型
| 类型 | 格式 | 作用域 |
|---|
| Service Token | UUID 字符串 | 仅可访问订阅的服务 |
| Global Token | UUID 字符串 | 可访问所有订阅的服务 |
基础 URL
https://api.acedata.cloud
SDK 集成(OpenAI 兼容)
对于聊天补全服务,使用标准 OpenAI SDK:
from openai import OpenAIclient = OpenAI(
api_key="YOUR_API_TOKEN",
base_url="https://api.acedata.cloud/v1"
)
response = client.chat.completions.create(
model="claude-sonnet-4-20250514",
messages=[{"role": "user", "content": "Hello!"}]
)
import OpenAI from "openai";const client = new OpenAI({
apiKey: "YOUR_API_TOKEN",
baseURL: "https://api.acedata.cloud/v1"
});
const response = await client.chat.completions.create({
model: "gpt-4.1",
messages: [{ role: "user", content: "Hello!" }]
});
常见请求模式
同步 API
某些 API 立即返回结果(如人脸变换、搜索):
curl -X POST https://api.acedata.cloud/face/analyze \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/photo.jpg"}'
异步任务 API
大多数生成 API(图片、视频、音乐)是异步的:
步骤 1: 提交请求
POST /suno/audios
{"prompt": "a jazz song", "wait": false}
→
{"task_id": "abc123"}
步骤 2: 轮询结果
POST /suno/tasks
{"task_id": "abc123"}
→
{"state": "succeeded", "data": [...]}
快捷方式: 传入 "wait": true 阻塞直到完成(更简单但超时时间更长)。
错误处理
| HTTP 状态码 | 含义 | 操作 |
|---|
| 400 | 错误请求 | 检查请求参数 |
| 401 | 未授权 | 检查 API 令牌 |
| 403 | 禁止 | 内容被过滤或权限不足 |
| 429 | 速率限制 | 等待后重试,使用退避策略 |
| 500 | 服务器错误 | 重试或联系支持 |
错误响应格式:
{
"error": {
"code": "token_mismatched",
"message": "Invalid or expired token"
}
}
计费
- 每次 API 调用从你的 订阅余额(remaining_amount)中扣除
- 费用因服务、模型和使用量(令牌数、请求数、数据大小)而异
- 在 platform.acedata.cloud 查看余额
- 大多数服务提供免费试用配额
服务类别
| 类别 | 服务 | 基础路径 |
|---|
| AI 对话 | GPT, Claude, Gemini, DeepSeek, Grok | /v1/chat/completions |
| 图片生成 | Midjourney, Flux, Seedream, NanoBanana | /midjourney/, /flux/ 等 |
| 视频生成 | Luma, Sora, Veo, Kling, Hailuo, Seedance | /luma/, /sora/ 等 |
| 音乐生成 | Suno, Producer, Fish Audio | /suno/, /producer/, /fish/ |
| 搜索 | Google 搜索(网页/图片/新闻/地图) | /serp/ |
| 人脸 | 分析、美化、换脸、卡通、年龄 | /face/ |
| 工具 | 短链接、二维码艺术、头像照 | /short-url, /qrart/, /headshots/* |
注意事项
- 令牌默认是 服务作用域 — 如需跨服务访问请创建全局令牌
- 异步 API 返回
task_id — 你必须轮询获取结果
wait: true 虽然方便但有超时限制(通常 60-120 秒)
- 速率限制因服务等级而异 — 如达到限制请升级套餐
- 所有时间戳均为 UTC 时间
Complete guide for using AceDataCloud's AI-powered data services API.
Getting Started
1. Create an Account
Register at platform.acedata.cloud.
2. Subscribe to a Service
Browse available services and click Get to subscribe. Most services include free quota.
3. Create API Credentials
Go to your service's Credentials page and create an API Token.
Authentication
All APIs use Bearer token authentication:
curl -X POST https://api.acedata.cloud/ \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'
Token Types
| Type | Format | Scope |
|---|
| Service Token | UUID string | Access to subscribed service only |
| Global Token | UUID string | Access to all subscribed services |
Base URL
https://api.acedata.cloud
SDK Integration (OpenAI-Compatible)
For chat completion services, use the standard OpenAI SDK:
from openai import OpenAIclient = OpenAI(
api_key="YOUR_API_TOKEN",
base_url="https://api.acedata.cloud/v1"
)
response = client.chat.completions.create(
model="claude-sonnet-4-20250514",
messages=[{"role": "user", "content": "Hello!"}]
)
import OpenAI from "openai";const client = new OpenAI({
apiKey: "YOUR_API_TOKEN",
baseURL: "https://api.acedata.cloud/v1"
});
const response = await client.chat.completions.create({
model: "gpt-4.1",
messages: [{ role: "user", content: "Hello!" }]
});
Common Request Patterns
Synchronous APIs
Some APIs return results immediately (e.g., face transform, search):
curl -X POST https://api.acedata.cloud/face/analyze \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/photo.jpg"}'
Async Task APIs
Most generation APIs (images, video, music) are asynchronous:
Step 1: Submit request
POST /suno/audios
{"prompt": "a jazz song", "wait": false}
→ {"task_id": "abc123"}
Step 2: Poll for results
POST /suno/tasks
{"task_id": "abc123"}
→ {"state": "succeeded", "data": [...]}
Shortcut: Pass "wait": true to block until completion (simpler but longer timeout).
Error Handling
| HTTP Code | Meaning | Action |
|---|
| 400 | Bad request | Check request parameters |
| 401 | Unauthorized | Check API token |
| 403 | Forbidden | Content filtered or insufficient permissions |
| 429 | Rate limited | Wait and retry with backoff |
| 500 | Server error | Retry or contact support |
Error response format:
{
"error": {
"code": "token_mismatched",
"message": "Invalid or expired token"
}
}
Billing
- Each API call deducts from your subscription balance (remaining_amount)
- Cost varies by service, model, and usage (tokens, requests, data size)
- Check balance at platform.acedata.cloud
- Most services offer free trial quota
Service Categories
| Category | Services | Base Path |
|---|
| AI Chat | GPT, Claude, Gemini, DeepSeek, Grok | /v1/chat/completions |
| Image Gen | Midjourney, Flux, Seedream, NanoBanana | /midjourney/, /flux/, etc. |
| Video Gen | Luma, Sora, Veo, Kling, Hailuo, Seedance | /luma/, /sora/, etc. |
| Music Gen | Suno, Producer, Fish Audio | /suno/, /producer/, /fish/ |
| Search | Google Search (web/images/news/maps) | /serp/ |
| Face | Analyze, beautify, swap, cartoon, age | /face/ |
| Utility | Short URL, QR Art, Headshots | /short-url, /qrart/, /headshots/* |
Gotchas
- Tokens are service-scoped by default — create a global token if you need cross-service access
- Async APIs return a
task_id — you must poll to get the result
wait: true is convenient but has a timeout limit (typically 60–120s)
- Rate limits vary by service tier — upgrade your plan if hitting limits
- All timestamps are in UTC