GET
/
user
/
me
curl --request GET \
  --url https://api.electronhub.ai/v1/user/me \
  --header 'Authorization: Bearer <token>'
{
  "subscription": "<string>",
  "credits": 123,
  "usage": {
    "input_tokens": 123,
    "output_tokens": 123
  },
  "history": [
    {
      "date": "2023-12-25",
      "requests": 123
    }
  ],
  "endpoints": {
    "chat.completions": 123,
    "images.generations": 123,
    "images.edits": 123,
    "videos.generations": 123
  }
}

Retrieve current user usage statistics, account information, and billing details.

Response

Returns comprehensive usage information including subscription status, remaining credits, token usage, request history, and endpoint-specific usage statistics.

Example Response

{
  "subscription": "pro",
  "credits": 1250,
  "usage": {
    "input_tokens": 45230,
    "output_tokens": 12870
  },
  "history": [
    {
      "date": "2024-12-26",
      "requests": 142
    },
    {
      "date": "2024-12-25",
      "requests": 98
    }
  ],
  "endpoints": {
    "chat.completions": 95,
    "images.generations": 23,
    "images.edits": 5,
    "videos.generations": 2
  }
}

Code Examples

from httpx import Client

api_key = "ek-your-api-key"
headers = {
    "Authorization": f"Bearer {api_key}"
}

client = Client()
response = client.get("https://api.electronhub.ai/user/me", headers=headers)
print(response.json())

Response Fields

subscription

Your current subscription plan (e.g., “free”, “starter”, “pro”, “enterprise”)

credits

Number of credits remaining in your account

usage

Token usage statistics:

  • input_tokens - Total input tokens consumed
  • output_tokens - Total output tokens generated

history

Array of daily usage records showing request counts by date

endpoints

Usage breakdown by API endpoint:

  • chat.completions - Chat completion requests
  • images.generations - Image generation requests
  • images.edits - Image editing requests
  • videos.generations - Video generation requests

Use Cases

  • Monitor Usage: Track API consumption to manage costs
  • Billing Information: Check remaining credits and subscription status
  • Usage Analytics: Analyze patterns in API usage over time
  • Endpoint Analysis: Understand which endpoints are used most frequently

Rate Limits

This endpoint is subject to standard rate limits. You can check usage information up to once per minute without impacting your request quota.

Authorizations

Authorization
string
header
required

Enter your API key (starts with 'ek-')

Response

200 - application/json

Success

The response is of type object.