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": "John Doe",8 "created_at": "2024-01-15T10:30:00Z"9 },10 "subscription": {11 "plan": "pro",12 "status": "active",13 "current_period_end": "2024-02-15T10:30:00Z",14 "cancel_at_period_end": false15 },16 "usage": {17 "credits_used_this_month": 1500,18 "credits_limit": 10000,19 "credits_remaining": 8500,20 "billing_period_start": "2024-01-15T00:00:00Z",21 "billing_period_end": "2024-02-15T00:00:00Z"22 },23 "api_key": {24 "name": "Production",25 "created_at": "2024-01-10T08:00:00Z",26 "last_used_at": "2024-01-20T14:30:00Z",27 "total_requests": 245028 }29 }30}
Response Fields
account
| Field | Type | Description |
|---|---|---|
| uuid | string | Unique user identifier |
| string | Account email address | |
| name | string | null | Full name (if set in profile) |
| created_at | string | Account creation timestamp (ISO 8601) |
subscription
| Field | Type | Description |
|---|---|---|
| plan | string | Plan slug: free, starter, pro, or scale |
| status | string | Subscription status: active, canceled, past_due |
| 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 (limit - used) |
| billing_period_start | string | null | Start of billing period (ISO 8601) |
| billing_period_end | string | null | 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 number of requests made with this key |
Error Responses
| Status | Message | Cause |
|---|---|---|
| 401 | Missing API key | X-API-KEY header not provided |
| 401 | Invalid API key | Key doesn't exist or is malformed |
| 401 | API key revoked | Key has been revoked |
1{2 "success": false,3 "detail": "Invalid or missing API key"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 print(f"Plan: {data['subscription']['plan']}")12 print(f"Credits: {data['usage']['credits_remaining']:,} remaining")13 print(f"API Key: {data['api_key']['name']}")14 print(f"Total Requests: {data['api_key']['total_requests']:,}")1516if __name__ == "__main__":17 get_account_status()