Credits balance and activity
const url = 'https://api.harperharbor.com/open/v1/me/wallet';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.harperharbor.com/open/v1/me/wallet \ --header 'Authorization: Bearer <token>'Returns the caller’s credits (spendable, permanent, time-limited and held by running turns), upcoming expiries, and the balance activity in this app, newest first. Top-up is not available through the Open API; send the user to the main site.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Entries per page, 1 to 50.
Opaque nextCursor from a previous page. Malformed → 400 invalid_cursor.
Responses
Section titled “Responses”Wallet.
object
Credits the caller can spend now: permanent plus time-limited, less what running turns hold.
Credits that never expire.
Time-limited credits in total.
Credits held by turns still running; released or charged when they finish.
Time-limited credits by expiry and source, soonest first, at most 10; batches with the same expiry and source are merged. The expiring total keeps its meaning.
object
Credits.
When they expire.
Where the credits came from: welcome — sign-up gift; event — campaign credits; checkin, task, newcomer or referral — rewards; other — anything else.
Balance activity in this app, newest first.
object
Entry identifier.
When the balance changed.
Why the balance changed: purchase, grant, campaign, chat, api, image, speech, video, refund, expire, adjust, redeem, rebate, referral or signup. Map it to your own copy.
Credits added (positive) or taken (negative).
Present on credits from app rewards: checkin, task, newcomer or referral.
When these reward credits expire. Absent on expire entries.
Optional original-language explanation for a platform grant. Historical grants may omit it. Internal operator notes are never returned.
object
Opaque cursor for the next page of ledger; empty when there is none.
Example
{ "expiries": [ { "kind": "welcome" } ], "ledger": [ { "rewardKind": "checkin", "rankHonor": { "zone": "clean", "window": "day", "band": 1 } } ]}unauthorized.
object
Error code (snake_case) or, for legacy handlers, a free-text/localized message.
Human-readable sentence. Present only on middleware errors and /me, /me/wallet.
Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.
Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.
The token budget of required_context_tier for the selected model, for display.
Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.
Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.
Only on insufficient_credits: the credits the wallet could set aside for it.
Examplegenerated
{ "error": "example", "message": "example", "retryable": true, "required_context_tier": 1, "required_context_tokens": 1, "constant_lore_trim_fits": true, "credits_needed": 1, "credits_available": 1}not_found — account not found.
object
Error code (snake_case) or, for legacy handlers, a free-text/localized message.
Human-readable sentence. Present only on middleware errors and /me, /me/wallet.
Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.
Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.
The token budget of required_context_tier for the selected model, for display.
Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.
Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.
Only on insufficient_credits: the credits the wallet could set aside for it.
Examplegenerated
{ "error": "example", "message": "example", "retryable": true, "required_context_tier": 1, "required_context_tokens": 1, "constant_lore_trim_fits": true, "credits_needed": 1, "credits_available": 1}