Account Info
Retrieve your account information, subscription status, usage metrics, and current API key metadata.
/api/v1/meOverview
The /api/v1/me endpoint returns comprehensive information about your account based on the API key used for authentication. This is useful for:
API Key Validation
Verify your API key is valid before making other requests
Credit Monitoring
Check remaining credits before batch operations
Usage Tracking
Monitor API key usage and request counts
CLI Integration
Build CLI tools that display account status
Try It
Test your API key and see your account information:
Test Your API Key
Verify your key works and check account status
Get your API key from the Dashboard
Request
Send a GET request with your API key in the header:
1curl -X GET "https://api.sudomock.com/api/v1/me" \2 -H "x-api-key: sm_your_api_key_here"
Headers
| Header | Required | Description |
|---|---|---|
| x-api-key | Yes | Your SudoMock API key (starts with sm_) |
Response
A successful request returns your account details:
1{2 "success": true,3 "data": {4 "account": {5 "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",6 "email": "[email protected]",7 "name": "Acme Corp",8 "created_at": "2025-06-15T10:30:00Z"9 },10 "subscription": {11 "plan": "pro-25k",12 "tier": "pro",13 "status": "active",14 "current_period_end": "2026-02-05T00:00:00Z",15 "billing_channel": "stripe"16 },17 "usage": {18 "credits_used_this_month": 12847,19 "credits_limit": 50000,20 "credits_remaining": 37153,21 "billing_period_start": "2026-01-01T00:00:00Z",22 "billing_period_end": "2026-02-01T00:00:00Z",23 "prepaid_balance": 4.30,24 "prepaid_balance_currency": "USD"25 },26 "api_key": {27 "name": "Production Key",28 "created_at": "2025-06-15T10:30:00Z",29 "last_used_at": "2026-01-05T00:25:00Z",30 "total_requests": 84729331 }32 }33}
Response Fields
account
| Field | Type | Description |
|---|---|---|
| uuid | string | Unique user identifier |
| string | Account email address | |
| name | string | null | Account or company name (if set) |
| created_at | string | Account creation timestamp (ISO 8601) |
subscription
| Field | Type | Description |
|---|---|---|
| plan | string | Plan slug (e.g. free, pro-25k, scale-100k) |
| tier | string | Plan tier for feature gating: free, pro, or scale |
| status | string | Subscription status: active, cancelled, past_due, expired, paused |
| current_period_end | string | null | End of current billing period (ISO 8601) |
| billing_channel | string | Where the subscription is billed: stripe, shopify, or none (no active paid subscription) |
usage
This object carries two independent numbers. The credits_* fields count a subscription's monthly allowance. prepaid_balance is the money on the account. A pay as you go account has no monthly allowance, so all threecredits_* fields are legitimately 0 while its balance is positive.
| Field | Type | Description |
|---|---|---|
| credits_used_this_month | integer | Credits used in current billing period |
| credits_limit | integer | Monthly credit limit based on plan |
| credits_remaining | integer | Available credits, server-calculated as max(0, credits_limit - credits_used_this_month) |
| billing_period_start | string | Start of billing period (ISO 8601) |
| billing_period_end | string | End of billing period (ISO 8601) |
| prepaid_balance | number | Prepaid balance remaining, in prepaid_balance_currency. Always present, never null: an account holding no balance reports 0. |
| prepaid_balance_currency | string | ISO 4217 currency of prepaid_balance. Always USD today. |
Do not alarm on credits alone
A low-balance check that reads only credits_remaining fires permanently on a pay as you go account, which reports 0 there by design. Treat the account as out of funds only when credits_remaining and prepaid_balance are both at zero.
api_key
Information about the API key used to make this request:
| Field | Type | Description |
|---|---|---|
| name | string | Name you gave to this API key |
| created_at | string | When the key was created (ISO 8601) |
| last_used_at | string | null | Last time this key was used (ISO 8601) |
| total_requests | integer | Total credit-consuming operations recorded for this key |
Error Responses
| Status | Message | Cause |
|---|---|---|
| 401 | Not authenticated | x-api-key header not provided |
| 401 | Invalid API key format | Key does not start with sm_ |
| 401 | Invalid or revoked API key | Key not found in database or has been revoked |
| 500 | Internal server error | Unexpected error while fetching account data. Contact support if persistent. |
1{2 "success": false,3 "detail": "Not authenticated"4}
1{2 "success": false,3 "detail": "Internal error while fetching account information"4}
Use Cases
Pre-Batch Credit Check
Before running a batch of renders, check that the account is funded. Read both numbers: a subscription pays the batch from credits_remaining, a pay as you go account pays it from prepaid_balance.
1# Check available funds before batch2USAGE=$(curl -s "https://api.sudomock.com/api/v1/me" \3 -H "x-api-key: $SUDOMOCK_API_KEY" | jq '.data.usage')45CREDITS=$(echo "$USAGE" | jq '.credits_remaining')6BALANCE=$(echo "$USAGE" | jq '.prepaid_balance')78BATCH_SIZE=100910if [ "$CREDITS" -ge "$BATCH_SIZE" ]; then11 echo "Sufficient credits ($CREDITS). Starting batch..."12 # Run batch renders13elif [ "$(echo "$BALANCE > 0" | bc -l)" -eq 1 ]; then14 echo "Plan credits low, but balance is \$$BALANCE. Starting batch..."15 # Run batch renders16else17 echo "Out of funds. $CREDITS credits and \$$BALANCE balance."18 exit 119fi
CLI Account Status
Build a CLI tool that shows account status:
1import requests2import os34def get_account_status():5 response = requests.get(6 "https://api.sudomock.com/api/v1/me",7 headers={"x-api-key": os.environ["SUDOMOCK_API_KEY"]}8 )9 data = response.json()["data"]1011 sub = data['subscription']12 usage = data['usage']13 print(f"Plan: {sub['plan']} (tier: {sub['tier']})")14 print(f"Credits: {usage['credits_remaining']:,} remaining")15 print(f"Balance: {usage['prepaid_balance']:.2f} {usage['prepaid_balance_currency']}")16 print(f"API Key: {data['api_key']['name']}")17 print(f"Total Operations: {data['api_key']['total_requests']:,}")1819if __name__ == "__main__":20 get_account_status()