API reference · Account

Get user info & credits

GEThttps://api.imagemcpserver.com/auth/user-data
💳 Free🛠️ MCP tool: get_user_infoimagemcp.js user:info

Returns the account record behind the API key you authenticated with — name, email, sign-in provider, plan, and the live credit balance. Agents typically call this first so they can check the balance before starting an expensive batch of image work.

Overview

Read the authenticated account's profile, plan and remaining credit balance.

This endpoint never deducts credits.

Request

Headers

FieldTypeDescription
AuthorizationrequiredstringBearer <IMAGEMCP_API_KEY>. The header x-api-key: <key> is accepted as an alternative.

This endpoint takes no parameters — only the authorization header.

Examples

The same call in five forms. The MCP tab is what an MCP client sends under the hood; the CLI tab is what an agent with the agent skill runs.

get_user_info
curl "https://api.imagemcpserver.com/auth/user-data" \
  -H "Authorization: Bearer $IMAGEMCP_API_KEY"

Response

Response fields

FieldTypeDescription
user._idstringAccount identifier.
user.namestringDisplay name on the account.
user.emailstringAccount email address.
user.creditsnumberCredits currently available to spend.
user.plan"free" | "starter" | "pro" | "business"Active subscription plan.
user.provider"google" | "github" | "local"How the account signs in.
user.planValiditystring | nullISO date the current paid plan runs until.
200 OK
{
  "user": {
    "_id": "6712c0f4a91b4c2f9d0e5a31",
    "name": "Alex Rivera",
    "email": "alex@example.com",
    "profilePicture": "https://lh3.googleusercontent.com/a/...",
    "provider": "google",
    "credits": 2500,
    "plan": "pro",
    "planValidity": "2026-09-12T00:00:00.000Z",
    "billingCycle": "monthly",
    "createdAt": "2026-01-15T08:30:00.000Z"
  }
}

When it fails

Errors return success: false with a message. See errors & troubleshooting for the status codes and whether a retry is worth it.

FAQ

Does checking my credit balance cost credits?

No. Both /auth/user-data and /playground/models are free to call and never deduct credits.

Can an agent read the balance before generating images?

Yes — that is the intended pattern. Call the get_user_info tool first, compare user.credits against the cost of the work you are about to queue, and stop early if the balance is short.