💳 Get User Credits
This API retrieves the remaining translation credits (pages) for a user or organization account, along with related transaction history.
📋 Basic Information
- Method:
GET
- Path:
https://api.bluente.com/api/20250924/blu_translate/credit
- Authentication: Required —
Authorization: Bearer $BLUENTE_API_KEY
📝 Request Parameters
- Query Parameters
Field | Type | Required | Description |
---|---|---|---|
caller | string | No | Caller name, "blutranslate" by default |
platform | string | No | Platform name, "translateapp" by default |
-
Request Body: None
-
Headers:
Authorization: Bearer $BLUENTE_API_KEY
💡 Example
curl "https://api.bluente.com/api/20250924/blu_translate/credit?caller=blutranslate&&platform=translateapp" \
-H "Authorization: Bearer $BLUENTE_API_KEY" \
-H "Accept: application/json"
or
fetch("https://api.bluente.com/api/20250924/blu_translate/credit?caller=blutranslate&&platform=translateapp", {
method: "GET",
headers: {
"Authorization": "Bearer $BLUENTE_API_KEY"
}
})
✅ Success Response Example
{
"message": "success",
"code": 0,
"data": {
"uuid": "0cbc6611-f554-0bd0-809a-388dc95a615b",
"type": "organization",
"pages": 1999999676,
"expire_at": "2024-05-19 23:59:59",
"transactions": [
{
"pages": 1999999999,
"pageBalance": 1999999999,
"type": "ORG_INIT",
"completedAt": "2024-02-07 06:41:23"
}
],
"created_at": "2024-02-07 06:41:23",
"updated_at": "2024-05-08 15:43:47",
"trial_initialized": 0
}
}
📊 Response Fields
Field | Type | Description |
---|---|---|
message | string | Response message, usually "success" |
code | int | Status code, 0 means success |
data | object | Main payload |
└─ uuid | string | Unique ID for the credit record |
└─ type | string | Credit owner type, e.g., "organization" |
└─ pages | int | Remaining translation pages available |
└─ expire_at | string | Expiration timestamp of credits |
└─ transactions | array | List of credit transactions |
└─ transactions[].pages | int | Number of pages involved in this transaction |
└─ transactions[].pageBalance | int | Page balance after the transaction |
└─ transactions[].type | string | Transaction type (e.g., ORG_INIT ) |
└─ transactions[].completedAt | string | Completion time of the transaction |
└─ created_at | string | Record creation time |
└─ updated_at | string | Record last update time |
└─ trial_initialized | int | Whether trial credits have been initialized (0 = no, 1 = yes) |
❌ Error Response Example
{
"message": "unauthorized",
"code": 401
}
📌 Notes
- This endpoint requires a valid
api_key
obtained from the settings. pages
field indicates how many translation pages remain in the account.transactions
can be used to track history of credit allocations or deductions.- Expiration is controlled by the
expire_at
field — clients should warn users before credits expire.