title: Account Summary description: Retrieve your account summary including credits information and usage statistics
Account Summary
Retrieve your account summary including credits information and usage statistics.
Endpoint
GET /v2/account/summary
Description
Retrieve your account summary including credits information and usage statistics.
Headers
X-API-KEY string (required)
: Your API key for authentication
Example Request
curl https://api.translateplus.io/v2/account/summary \
-H "X-API-KEY: your_api_key"
import requests
url = "https://api.translateplus.io/v2/account/summary"
headers = {
"X-API-KEY": "your_api_key"
}
response = requests.get(url, headers=headers)
print(response.json())
fetch('https://api.translateplus.io/v2/account/summary', {
method: 'GET',
headers: {
'X-API-KEY': 'your_api_key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const https = require('https');
const options = {
hostname: new URL('https://api.translateplus.io').hostname,
path: '/v2/account/summary',
method: 'GET',
headers: {
'X-API-KEY': 'your_api_key'
}
};
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
console.log(JSON.parse(responseData));
});
});
req.on('error', (error) => {
console.error('Error:', error);
});
req.end();
<?php
$url = 'https://api.translateplus.io/v2/account/summary';
$apiKey = 'your_api_key';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-KEY: ' . $apiKey
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$result = json_decode($response, true);
echo 'Credits remaining: ' . $result['credits_remaining'] . "\n";
echo 'Total credits: ' . $result['total_credits'] . "\n";
} else {
echo 'Error: ' . $response;
}
Success Response (200 OK)
{
"email": "user@example.com",
"full_name": "John Doe",
"total_credits": 1000,
"credits_used": 250,
"credits_remaining": 750,
"credits_percentage": 25.0,
"summary": {
"total_requests": 1000,
"successful_requests": 950,
"failed_requests": 50,
"success_rate": 95.0
}
}
Response Fields
| Field | Type | Description |
|-------|------|-------------|
| email | string | User's email address |
| full_name | string | User's full name |
| total_credits | integer | Total credits allocated to the account |
| credits_used | integer | Number of credits used |
| credits_remaining | integer | Number of credits remaining |
| credits_percentage | float | Percentage of credits used |
| summary | object | Usage statistics |
| summary.total_requests | integer | Total number of API requests made |
| summary.successful_requests | integer | Number of successful requests |
| summary.failed_requests | integer | Number of failed requests |
| summary.success_rate | float | Success rate percentage |
Error Responses
401 Unauthorized
Invalid or missing API key:
{
"detail": "API key is required. Please provide X-API-KEY header."
}