API
Users
User profile endpoint.
Users API
Get user profile
GET /api/users/:idReturns the authenticated user's profile. The :id must match the authenticated user -- you can only view your own profile.
If the user does not yet exist in the users table, they are created automatically (upserted with 0 credits).
Response (200):
{
"id": "user-uuid",
"credits": 50,
"stripe_customer_id": "cus_...",
"stripe_account_id": "acct_...",
"stripe_account_status": "active",
"created_at": "2025-01-01T00:00:00.000Z"
}Whoami
POST /api/whoamiReturns the current authenticated user's ID and credit balance. Used by the CLI's whoami command.
Response (200):
{
"user": {
"id": "user-uuid",
"credits": 50
}
}