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 "cancel_at_period_end": false16 },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 },24 "api_key": {25 "name": "Production Key",26 "created_at": "2025-06-15T10:30:00Z",27 "last_used_at": "2026-01-05T00:25:00Z",28 "total_requests": 84729329 }30 }31}
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) |
| cancel_at_period_end | boolean | Whether subscription will cancel at period end |
usage
| 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) |
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 if you have enough credits:
1# Check available credits before batch2CREDITS=$(curl -s "https://api.sudomock.com/api/v1/me" \3 -H "x-api-key: $SUDOMOCK_API_KEY" | jq '.data.usage.credits_remaining')45BATCH_SIZE=10067if [ "$CREDITS" -ge "$BATCH_SIZE" ]; then8 echo "Sufficient credits ($CREDITS). Starting batch..."9 # Run batch renders10else11 echo "Not enough credits. Have $CREDITS, need $BATCH_SIZE"12 exit 113fi
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 print(f"Plan: {sub['plan']} (tier: {sub['tier']})")13 print(f"Credits: {data['usage']['credits_remaining']:,} remaining")14 print(f"API Key: {data['api_key']['name']}")15 print(f"Total Operations: {data['api_key']['total_requests']:,}")1617if __name__ == "__main__":18 get_account_status()