API Reference / Read your account's name, email, plan and credits
API Reference

Read your account's name, email, plan and credits

GET/api/v1/account

The account behind the API key (or behind an app's token, which needs the account:read scope): its name, its email address, the name of its plan and the credits left per moderation type. Not cached.

Responses#

200#

Your account.

  • name string or null required

    The account's name, or null when it has none.

  • email string required

    The account's email address.

  • plan string or null required

    The name of the account's current plan (a trial too), or null when it has none.

  • credits object required

    Credits left per moderation type.

401#

Missing, unknown, revoked or expired API key, or the account is not active.

{
  "error": "unauthorized",
  "message": "The API key is not valid."
}

403#

The key may not do this: a read key on a write endpoint, or a restricted key.

{
  "error": "forbidden",
  "message": "This API key does not have write permission"
}

429#

Too many requests in a minute. Wait Retry-After seconds. See Rate limits.

Header Retry-After: Seconds to wait.

{
  "error": "too_many_requests",
  "message": "Too many requests. Try again in a minute."
}

Request

curl -X GET https://api.detectivision.ai/api/v1/account \
  -H "Api-Key: $DETECTIVISION_API_KEY"
import os, requests

r = requests.get(
    "https://api.detectivision.ai/api/v1/account",
    headers={"Api-Key": os.environ["DETECTIVISION_API_KEY"]},
)
print(r.status_code, r.json())
const res = await fetch("https://api.detectivision.ai/api/v1/account", {
  method: "GET",
  headers: {
    "Api-Key": process.env.DETECTIVISION_API_KEY,
  },
});
console.log(res.status, await res.json());

Response 200

{
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "plan": "Pro",
  "credits": {
    "text_moderation": 12340,
    "image_moderation": 800,
    "video_moderation": 0,
    "audio_moderation": 0,
    "live_stream_moderation": 0
  }
}