Get usage
GEThttps://api.writehuman.ai/v1/usage
Returns your plan, the words used in the current billing cycle and your top-up balance. This endpoint is not billed and does not count toward the rate limit.
GET/v1/usage
curl https://api.writehuman.ai/v1/usage \ -H "Authorization: Bearer $WRITEHUMAN_API_KEY"200Response
{ "included_words": 400000, "words_used_this_cycle": 18311, "topup_balance": 100000, "tier": "api_premium", "version": "v1.3"}This endpoint takes no parameters. The account is identified by the API key.
Response#
included_wordsintegerThe number of words the plan includes per billing cycle.
words_used_this_cycleintegerPlan words used so far in the current cycle.
topup_balanceintegerWords remaining from top-ups. Top-up words do not expire.
tierstringThe plan tier:
api_standardorapi_premium. All Premium sizes reportapi_premium.versionstringThe API version, such as
v1.3.
Calculating the remaining balance#
remaining = included_words - words_used_this_cycle + topup_balanceFor the example response, the remaining balance is 400,000 - 18,311 + 100,000 = 481,689 words.
- Plan words are consumed before top-up words.
words_used_this_cycleresets to zero when the plan renews. Top-up words carry over. - Values returned by this endpoint can lag actual usage by up to two minutes. For the exact balance immediately after a request, use
words_remainingin the humanize response. - Calling this endpoint before each request is unnecessary. A request that exceeds the balance is rejected with 402
insufficient_balance, which is not charged and includes the current balance.
Errors#
401Missing or invalid API key.Show examples
Invalid API key
{ "error": "Invalid API key", "code": "invalid_api_key"}Missing Authorization header
{ "error": "Missing or invalid Authorization header", "code": "missing_api_key"}402No active subscription.Show example
{ "error": "No active subscription", "code": "no_subscription"}403The account owner must re-verify the account by email.Show example
{ "error": "This account must be re-verified by email. The account owner should sign in at writehuman.ai to continue.", "code": "reverify_required"}429Too many failed auth attempts.Show example
{ "error": "Too many failed authentication attempts", "code": "auth_locked_out"}