💳 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
    FieldTypeRequiredDescription
    callerstringNoCaller name, "blutranslate" by default
    platformstringNoPlatform 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

    FieldTypeDescription
    messagestringResponse message, usually "success"
    codeintStatus code, 0 means success
    dataobjectMain payload
    └─ uuidstringUnique ID for the credit record
    └─ typestringCredit owner type, e.g., "organization"
    └─ pagesintRemaining translation pages available
    └─ expire_atstringExpiration timestamp of credits
    └─ transactionsarrayList of credit transactions
    └─ transactions[].pagesintNumber of pages involved in this transaction
    └─ transactions[].pageBalanceintPage balance after the transaction
    └─ transactions[].typestringTransaction type (e.g., ORG_INIT)
    └─ transactions[].completedAtstringCompletion time of the transaction
    └─ created_atstringRecord creation time
    └─ updated_atstringRecord last update time
    └─ trial_initializedintWhether 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.