Retrieve account details
curl --request GET \
--url https://api.example.com/v1/user/account \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/v1/user/account"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/v1/user/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/user/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/user/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/user/account")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/user/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "<string>",
"name": "<string>",
"email": "<string>",
"statusCode": 123,
"usage": {
"remainingCredits": 123
},
"requestCompletionTime": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Account
Retrieve Account Details
Retrieves the account details of the authenticated user.
GET
/
v1
/
user
/
account
Retrieve account details
curl --request GET \
--url https://api.example.com/v1/user/account \
--header 'Authorization: <api-key>'import requests
url = "https://api.example.com/v1/user/account"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.example.com/v1/user/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/user/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/user/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/user/account")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/user/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "<string>",
"name": "<string>",
"email": "<string>",
"statusCode": 123,
"usage": {
"remainingCredits": 123
},
"requestCompletionTime": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
}Note: This operation does not consume any account credits, but rate limits apply.
Retrieve Account Details
This endpoint retrieves the account details of the authenticated user, including their name, email, and the number of remaining credits.Request
- Endpoint:
GET /user/account - Authorization: Bearer token required
Response
A successful response will return the user’s account details and information about the remaining credits.Example Response
{
"status": "success",
"name": "John Doe",
"email": "john.doe@example.com",
"statusCode": 200,
"usage": {
"remainingCredits": 5
},
"requestCompletionTime": "50 ms",
"timestamp": "2024-09-12T02:44:45.213Z"
}

