👤 Get Account

    This API returns the account that owns the API key: the user’s email and name, their organization, and the spendable credit balance for each feature, including who pays and when credits expire. It is read-only.


    📋 Basic Information

    • Method: GET
    • Path: https://api.bluente.com/api/20250924/blu_translate/account
    • Authentication: Required — Authorization: Bearer $BLUENTE_API_KEY

    📝 Request Parameters

    • Query Parameters: None
    • Request Body: None

    💡 Example

    curl -X GET "https://api.bluente.com/api/20250924/blu_translate/account" \
         -H "Authorization: Bearer $BLUENTE_API_KEY" \
         -H "Accept: application/json"

    or

    fetch("https://api.bluente.com/api/20250924/blu_translate/account", {
      method: "GET",
      headers: {
        "Authorization": "Bearer $BLUENTE_API_KEY",
        "Accept": "application/json"
      }
    });

    ✅ Success Response Example

    {
      "message": "success",
      "code": 0,
      "data": {
        "user": {
          "email": "translator@example.com",
          "full_name": "Alex Chen"
        },
        "organization": {
          "name": "Example Corp",
          "role": "staff"
        },
        "credits": [
          {
            "feature": "translate",
            "paid_by": "organization",
            "balance": 1200,
            "expiries": [
              { "at": "2026-11-30T23:59:59Z", "credits": 200 },
              { "at": "2027-06-30T23:59:59Z", "credits": 1000 }
            ]
          }
        ]
      }
    }

    📊 Response Fields

    FieldTypeDescription
    messagestringResponse message, usually "success"
    codeintStatus code, 0 means success
    dataobjectMain payload
    └─ user.emailstringEmail of the user who owns the API key
    └─ user.full_namestringFull name of that user
    └─ organizationobject/nullThe user’s organization, or null if the user is not in an organization
    └─ organization.namestringOrganization name
    └─ organization.rolestringThe user’s role in the organization (e.g. owner, admin, staff)
    └─ creditsarrayOne entry per feature. translate is always present; other features (transcribe, rewrite) appear only when their balance is above 0
    └─ credits[].featurestringFeature name: translate, transcribe or rewrite
    └─ credits[].paid_bystringWallet that would be charged right now: organization or personal
    └─ credits[].balanceintSpendable credits (pages for translate) in that wallet
    └─ credits[].expiriesarraySpendable credits grouped by expiry date, soonest first (up to 5 entries)
    └─ credits[].expiries[].atstringExpiry time, ISO 8601 in UTC (e.g. 2026-11-30T23:59:59Z)
    └─ credits[].expiries[].creditsintCredits that expire at that time

    ❌ Error Response Example

    {
      "message": "Unauthorized",
      "code": 20
    }

    See Error Codes for all codes.


    📌 Notes

    • Use this API to confirm which user and organization an API key belongs to, and to check that the account can pay for a translation before you start it.
    • balance only counts credits that can be spent now. Expired credits are not included.
    • The first entry in expiries is the soonest expiry. Warn your users before that date.
    • For the transaction history of the credit record, use Get User Credits.