Create 灵蛇AI Platform API Credentials
Create business API credentials for an Application. The creation response may contain a Token that can directly call https://api.opensnake.cloud/**; it must be treated as a secret.
¶ Preparation
- Create an Account Token.
- Obtain an
application_idthat you own from the Application list.
export PLATFORM_TOKEN='your account token'
export APPLICATION_ID='your Application ID'
¶ API Overview
| Item | Content |
|---|---|
| Method | POST |
| URL | https://opensnake.platform.acedata.cloud/api/v1/credentials/ |
| Authentication | Account Token, OAuth token requires credentials:write |
| Body | JSON |
¶ Request Body
| Field | Type | Required | Description |
|---|---|---|---|
application_id |
UUID | Yes | Target Application |
name |
string | No | Credential display name |
limited_amount |
number / null | No | Usage limit for a single credential; null means no separate limit |
expired_at |
datetime / null | No | ISO 8601 expiration time |
allowed_api_ids |
UUID[] / null | No | Only allow calls to these APIs; an empty array will be normalized as unrestricted |
host |
string | No | Credential host information |
for_user_id |
string | No | Used when the Application owner issues authorized credentials for another user |
tags / metadata |
array / object | No | Custom extension data |
curl -X POST 'https://opensnake.platform.acedata.cloud/api/v1/credentials/' \
-H "Authorization: Bearer ${PLATFORM_TOKEN}" \
-H 'Content-Type: application/json' \
-d "{\"application_id\":\"${APPLICATION_ID}\",\"name\":\"production\",\"limited_amount\":50}"
¶ Response Description
Success returns 201 and a Credential object:
- API/Agent-type services usually return
type=Tokenandtoken; id,user_id,creator_id,used_amount, and time fields are generated by the server.
The current list and detail APIs also return credential plaintext, but clients should not rely on this historical behavior. Save it immediately after creation and avoid writing the response to logs; future APIs may change to return masked values.
¶ Error Handling
400: Invalid field format, unknownallowed_api_ids, or other creation constraints.401: Invalid Account Token.403/404: No permission to access the target Application, or the Application/authorized user does not exist.