Skip to main content

Reserve an Agent credit

Atomically reserves one credit per messageId. Repeating the same UUID returns the same reservation without consuming again.
1 min read
post/profiles/{studioId}/agent-credits/reservations
Request example
Response
post/profiles/{studioId}/agent-credits/reservations

Authorization

Authorizationstringheaderrequired#
Better Auth session token. Go resolves the token in the session table and maps it to users.id via auth_user_id. The profile is taken from the path param :studioId when applicable.

Path parameters

studioIdstringrequired#

Body

application/json
messageIdstringrequired#
chatIdstringrequired#
modelIdstringrequired#

Responses

application/json
Credit reserved.
dataobjectrequired#
Show child attributes
messageIdstringrequired#
stateenum<string>required#
Options:reservedcommittedreleasedexpired
balanceobjectrequired#
Show child attributes
usedintegerrequired#
includedintegerrequired#
extraintegerrequired#
totalintegerrequired#
remainingintegerrequired#
periodStartMsintegerrequired#
periodEndMsintegerrequired#
sourceenum<string>required#
Options:metronome
syncStatusenum<string>required#
Options:pendingsynceddegradederror
entitlementVersioninteger#
billingScopeKindenum<string>#
Options:profilefree_owner
request_idstring#