Home / Docs / Account Status | HTML to Image Docs

Account Status

GET /api/me returns the account behind the calling API key: the plan, whether it is active, the remaining credit balance and when it renews. Calling it never consumes a credit, and it stays reachable when your account is out of credits or off plan - which makes it the right endpoint for verifying a key and for monitoring your balance.

The endpoint

GET https://app.html2img.com/api/me

Authenticate with the same X-API-Key header as every other endpoint. See the authentication guide.

curl 'https://app.html2img.com/api/me' \
  -H 'X-API-Key: YOUR_API_KEY'

Response

{
  "email": "[email protected]",
  "plan": "1k",
  "plan_name": "1,000 Credits",
  "active": true,
  "free_plan": false,
  "credits_remaining": 850,
  "credits_reset_at": "2026-09-01T00:00:00+00:00"
}
FieldTypeDescription
emailstringThe email address of the account that owns the key.
planstring | nullThe plan identifier. null when the account has no plan assigned.
plan_namestring | nullThe display name of the plan, e.g. "1,000 Credits".
activebooleanWhether the account can currently render. When false, requests to the render endpoints will be rejected.
free_planbooleantrue when the account is on the free tier.
credits_remainingintegerCredits left on the account. This is the same figure the render endpoints return in their credits_remaining field after each request.
credits_reset_atstring | nullISO 8601 timestamp of the next credit renewal. null on the free tier, where the allowance is one-time and never renews.

The response is sent with Cache-Control: no-store, so the balance you read is always current.

Verifying a key

Because a request to /api/me is free, you can call it every time a key is saved or a connection is configured - for example as the connection test in a no-code integration, or on startup to fail fast when a deployment ships with a bad key. A 200 means the key is valid; a 401 means it is missing or wrong.

const res = await fetch('https://app.html2img.com/api/me', {
  headers: { 'X-API-Key': process.env.HTML2IMG_API_KEY },
});

if (res.status === 401) {
  throw new Error('Invalid html2img API key');
}

const account = await res.json();
console.log(`${account.credits_remaining} credits remaining`);

/api/me never returns a credits or plan error. An account that has spent its allowance still gets a 200 with its real credits_remaining, so a valid key is never reported as invalid just because the balance ran out. Check the active and credits_remaining fields if you need to know whether renders will succeed.

Monitoring your credit balance

The render endpoints already return credits_remaining on every response, so for steady traffic you can watch the balance without extra requests. /api/me is useful when you want the balance before spending anything:

  • Before a batch job. Check that credits_remaining covers the batch before starting it, rather than failing halfway through.
  • Scheduled alerts. Poll on a schedule and alert when the balance drops below a threshold, using credits_reset_at to tell “nearly out until renewal” apart from “needs an upgrade” - it is null on the free tier, where credits never renew.
  • Usage dashboards. Display the plan name and live balance in an internal admin page without spending a credit per page view.

Errors

The only errors this endpoint returns are authentication errors.

Missing key (401)

{
  "error": "API key is required",
  "code": "missing_api_key"
}

No X-API-Key header was sent.

Invalid key (401)

{
  "error": "Invalid API key",
  "code": "invalid_api_key"
}

The key does not match any account. Check for whitespace or a truncated value, and confirm the key has not been revoked in the dashboard.