curl --request GET \
--url https://api.magichour.ai/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.magichour.ai/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.magichour.ai/v1/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.magichour.ai/v1/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: Bearer <token>"
],
]);
$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.magichour.ai/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.magichour.ai/v1/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magichour.ai/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cuid-example",
"email": "user@example.com",
"tier": "pro",
"credits": 12500,
"subscription": {
"name": "Pro",
"status": "active",
"price": {
"amount": 4900,
"currency": "usd"
},
"discount": {
"percent_off": 20,
"amount_off": null
},
"billing_interval": "month",
"current_period_end": "2026-10-01T00:00:00.000Z",
"cancel_at_period_end": false
}
}{
"code": "unauthorized",
"message": "<string>"
}{
"code": "internal_server_error",
"message": "<string>"
}Get account details
Get the current credit balance and subscription details of the account that owns the API key.
curl --request GET \
--url https://api.magichour.ai/v1/account \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.magichour.ai/v1/account"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.magichour.ai/v1/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.magichour.ai/v1/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: Bearer <token>"
],
]);
$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.magichour.ai/v1/account"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.magichour.ai/v1/account")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magichour.ai/v1/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "cuid-example",
"email": "user@example.com",
"tier": "pro",
"credits": 12500,
"subscription": {
"name": "Pro",
"status": "active",
"price": {
"amount": 4900,
"currency": "usd"
},
"discount": {
"percent_off": 20,
"amount_off": null
},
"billing_interval": "month",
"current_period_end": "2026-10-01T00:00:00.000Z",
"cancel_at_period_end": false
}
}{
"code": "unauthorized",
"message": "<string>"
}{
"code": "internal_server_error",
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".
Response
200
Unique ID of the account that owns the API key.
"cuid-example"
Email address of the account.
"user@example.com"
Subscription tier in effect for the account. free if there is no active subscription, including while a subscription is past_due.
free, creator, pro, business "pro"
Credits currently available to spend. Includes subscription credits and any purchased credit packs.
x >= 012500
Details of the account's subscription plan. null if the account has no subscription, e.g. a free account, an account that only purchased credit packs, or an account on usage-based API pricing.
Reflects the plan currently configured on the subscription. If a plan change is scheduled, tier stays on the current plan until the next payment succeeds, so tier and name can briefly disagree.
Show child attributes
Show child attributes
Was this page helpful?