SudoMock

Account Info

Retrieve your account information, subscription status, usage metrics, and current API key metadata.

GET/api/v1/me

Overview

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:

Request
1curl -X GET "https://api.sudomock.com/api/v1/me" \
2 -H "X-API-KEY: sm_your_api_key_here"

Headers

HeaderRequiredDescription
X-API-KEYYesYour SudoMock API key (starts with sm_)

Response

A successful request returns your account details:

Response 200 OK
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": false
15 },
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": 2450
28 }
29 }
30}

Response Fields

account

FieldTypeDescription
uuidstringUnique user identifier
emailstringAccount email address
namestring | nullFull name (if set in profile)
created_atstringAccount creation timestamp (ISO 8601)

subscription

FieldTypeDescription
planstringPlan slug: free, starter, pro, or scale
statusstringSubscription status: active, canceled, past_due
current_period_endstring | nullEnd of current billing period (ISO 8601)
cancel_at_period_endbooleanWhether subscription will cancel at period end

usage

FieldTypeDescription
credits_used_this_monthintegerCredits used in current billing period
credits_limitintegerMonthly credit limit based on plan
credits_remainingintegerAvailable credits (limit - used)
billing_period_startstring | nullStart of billing period (ISO 8601)
billing_period_endstring | nullEnd of billing period (ISO 8601)

api_key

Information about the API key used to make this request:

FieldTypeDescription
namestringName you gave to this API key
created_atstringWhen the key was created (ISO 8601)
last_used_atstring | nullLast time this key was used (ISO 8601)
total_requestsintegerTotal number of requests made with this key

Error Responses

StatusMessageCause
401Missing API keyX-API-KEY header not provided
401Invalid API keyKey doesn't exist or is malformed
401API key revokedKey has been revoked
401 Unauthorized Response
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:

Credit Check Before Batch
1# Check available credits before batch
2CREDITS=$(curl -s "https://api.sudomock.com/api/v1/me" \
3 -H "X-API-KEY: $SUDOMOCK_API_KEY" | jq '.data.usage.credits_remaining')
4
5BATCH_SIZE=100
6
7if [ "$CREDITS" -ge "$BATCH_SIZE" ]; then
8 echo "Sufficient credits ($CREDITS). Starting batch..."
9 # Run batch renders
10else
11 echo "Not enough credits. Have $CREDITS, need $BATCH_SIZE"
12 exit 1
13fi

CLI Account Status

Build a CLI tool that shows account status:

Python CLI Example
1import requests
2import os
3
4def 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"]
10
11 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']:,}")
15
16if __name__ == "__main__":
17 get_account_status()

Ready to get started?

Generate your API key and start building.

Get API Key