Create AceDataCloud Platform API Credential
Issue an API Credential for a specific Application — a 32-bit Token used when calling the https://api.acedata.cloud/** business interfaces (OpenAI, Midjourney, Suno, Veo, etc.).
⚠️ The complete Token in plaintext is only returned once in the response of this interface. The list/detail interfaces are desensitized. Please be sure to save it immediately to a password manager, environment variable, or secret configuration system.
ℹ️ This interface belongs to the AceDataCloud Platform Management API, with a unified prefix of
https://platform.acedata.cloud/api/v1/. For the complete interface index, see Get AceDataCloud Platform Documentation List.
¶ Interface Overview
| Item | Content |
|---|---|
| Method | POST |
| URL | https://platform.acedata.cloud/api/v1/credentials/ |
| Authentication | ✅ Requires account token |
| Content-Type | application/json |
¶ Authentication Instructions (How to Obtain Account Token)
Request Header:
Authorization: Bearer platform-v1-92eb****629c
How to obtain the account token:
- One-click creation in the console (recommended): Log in to the AceDataCloud Platform → Account Token Console → Click "Create".
- API Creation: See Manage AceDataCloud Platform Account Tokens.
¶ Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
application_id |
UUID | ✅ | — | The Application ID to which this credential belongs (first obtain it through Create Application) |
name |
string | No | — | Credential display name for easy identification (e.g., prod-server-01) |
amount |
number | No | null |
Maximum limit for a single credential. null = no limit (can use the entire balance of the Application) |
expired_at |
datetime | No | null |
Expiration time (ISO8601 string), e.g., 2026-12-31T23:59:59Z |
tags |
array | No | — | User-defined tags |
metadata |
object | No | — | User-defined metadata |
client_ip_allowlist |
array<string> | No | null |
IP whitelist allowed to call this credential, in CIDR format (e.g., ["1.2.3.4/32", "10.0.0.0/8"]) |
¶ Request Example
¶ cURL
curl -X POST 'https://platform.acedata.cloud/api/v1/credentials/' \
-H 'accept: application/json' \
-H 'authorization: Bearer platform-v1-92eb****629c' \
-H 'content-type: application/json' \
-d '{
"application_id": "82f57141-2323-4453-8730-60f7d833a2da",
"name": "production-server-01",
"amount": 50.0,
"expired_at": "2026-12-31T23:59:59Z",
"client_ip_allowlist": ["203.0.113.7/32"]
}'
¶ Python
import requests
PLATFORM_TOKEN = "platform-v1-92eb****629c"
APPLICATION_ID = "82f57141-2323-4453-8730-60f7d833a2da"
resp = requests.post(
"https://platform.acedata.cloud/api/v1/credentials/",
headers={
"accept": "application/json",
"authorization": f"Bearer {PLATFORM_TOKEN}",
"content-type": "application/json",
},
json={
"application_id": APPLICATION_ID,
"name": "production-server-01",
"amount": 50.0, # This credential can consume up to 50 Credits
},
timeout=10,
)
if resp.status_code == 201:
cred = resp.json()
print("✅ Complete Token (please save immediately):", cred["token"])
print("ID =", cred["id"])
else:
print(resp.status_code, resp.text)
¶ Node.js
const PLATFORM_TOKEN = 'platform-v1-92eb****629c'
const r = await fetch('https://platform.acedata.cloud/api/v1/credentials/', {
method: 'POST',
headers: {
authorization: `Bearer ${PLATFORM_TOKEN}`,
'content-type': 'application/json',
},
body: JSON.stringify({
application_id: '82f57141-2323-4453-8730-60f7d833a2da',
name: 'production-server-01',
amount: 50.0,
}),
})
const cred = await r.json()
console.log('Complete Token (only this once!):', cred.token)
¶ Response Example (HTTP 201)
{
"id": "df3e1b1b-9e72-4c4f-9a83-1e23f7c8b4d6",
"user_id": "89518d07-5560-4b05-92c1-667f3ddf6a4b",
"application_id": "82f57141-2323-4453-8730-60f7d833a2da",
"name": "production-server-01",
"token": "ac1234567890abcdef1234567890abcdef",
"amount": 50.0,
"used_amount": 0.0,
"remaining_amount": 50.0,
"disabled": false,
"expired_at": "2026-12-31T23:59:59Z",
"tags": null,
"metadata": null,
"client_ip_allowlist": ["203.0.113.7/32"],
"used_at": null,
"created_at": "2026-04-26T07:55:00Z",
"updated_at": "2026-04-26T07:55:00Z"
}
⚠️ This is the only place where the complete plaintext
tokenwill appear. Subsequent list/detail queries will change to a desensitized format likeac****ef.
¶ Using the Just Created Credential
Place the token in the Authorization: Bearer ... header to call the business interface:
curl 'https://api.acedata.cloud/v1/chat/completions' \
-H 'authorization: Bearer ac1234567890abcdef1234567890abcdef' \
-H 'content-type: application/json' \
-d '{"model":"gpt-4.1","messages":[{"role":"user","content":"Hello"}]}'
¶ Error Handling
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid |
application_id is missing / format error / amount is negative |
| 401 | not_authenticated |
Missing account token |
| 403 | permission_denied |
The specified application_id does not belong to you |
| 404 | not_found |
Application does not exist or has been deleted |
¶ Practical Tips
- Production environment must set
amount: Once the credential is leaked, the limit can keep the loss within a specified amount. 50 Credit is a good starting point. expired_atis for temporary credentials: Set a short expiration for demo accounts, temporary events, or collaborations with outsourcing to avoid forgetting to clean up.client_ip_allowlistis the strongest insurance: Lock the credential to the production server IP; even if leaked to GitHub, it cannot be used.namemust be meaningful: In the future, you may have dozens of credentials, and without good names, you won't be able to tell which is which.- To obtain credentials with "unlimited amount, no IP restrictions, no expiration": Simply do not pass
amount,expired_at, andclient_ip_allowlist, but strongly not recommended to do this in public projects.
¶ Related Interfaces
- Create AceDataCloud platform service application — You need an Application to create a credential first.
- Get AceDataCloud platform API credential list
- Rotate AceDataCloud platform API credential — Rotate Token without deleting the old credential.
- Delete AceDataCloud platform API credential
- Get AceDataCloud platform API call records — View the credential call history.
