Zum Inhalt springen
DeutschlandGPT

Get usage by API key

Returns usage statistics grouped by API key. Requires an admin API key.

GEThttps://api.deutschlandgpt.de/v2/admin/usage/by-api-key

Example request

curl https://api.deutschlandgpt.de/v2/admin/usage/by-api-key \
  -X GET \
  -H "Authorization: Bearer $DGPT_API_KEY"

Parameters

start_datestring<date>optional

Start date (ISO 8601). Defaults to 30 days ago.

end_datestring<date>optional

End date (ISO 8601). Defaults to today.

anonymizebooleanoptional

When true (default), PII fields are replaced with deterministic SHA-256 hashes. Set to false to return raw values.

Response

200application/json
{
  "object": "list",
  "data": [
    {
      "apiKeyId": "string",
      "apiKeyName": "string",
      "totalCost": 0,
      "requestCount": 0
    }
  ]
}

Usage by API key

objectstring
dataUsageByApiKey[]
apiKeyIdstring
apiKeyNamestring

API key name. SHA-256 hashed by default when anonymize=true.

totalCostnumber

Total cost. Value in micro-cents (divide by 100,000,000 for EUR).

requestCountinteger

Response codes

200

Usage by API key

object
401

Unauthorized

403

Requires admin API key

Was this page helpful?