List API keys
Returns all non-archived API keys (user keys plus agent keys) for the caller's workspace, including their permissions, spending limits, and current-month spend. Admins see all keys; non-admins see only their own.
https://api.deutschlandgpt.de/v2/apiKeysExample request
curl https://api.deutschlandgpt.de/v2/apiKeys \
-X GET \
-H "Authorization: Bearer $DGPT_API_KEY"curl https://api.deutschlandgpt.de/v2/apiKeys \
-X GET \
-H "Authorization: Bearer $DGPT_API_KEY"import os, requests
response = requests.get(
"https://api.deutschlandgpt.de/v2/apiKeys",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
)
print(response.json())import os, requests
response = requests.get(
"https://api.deutschlandgpt.de/v2/apiKeys",
headers={"Authorization": f"Bearer {os.environ['DGPT_API_KEY']}"},
)
print(response.json())const response = await fetch('https://api.deutschlandgpt.de/v2/apiKeys', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
},
});
console.log(await response.json());const response = await fetch('https://api.deutschlandgpt.de/v2/apiKeys', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.DGPT_API_KEY}`,
},
});
console.log(await response.json());Response
{
"apiKeys": [
{
"id": "string",
"name": "string",
"obscuredApiKey": "string",
"state": "active",
"createdAt": "2025-01-01T00:00:00Z",
"lastUsedAt": "2025-01-01T00:00:00Z",
"monthlySpendingLimit": 0,
"currentMonthSpend": 0,
"adminScopes": [
"admin:export_usage"
],
"modelIds": [
"00000000-0000-0000-0000-000000000000"
],
"documentFolderIds": [
"00000000-0000-0000-0000-000000000000"
],
"customGptIds": [
"00000000-0000-0000-0000-000000000000"
],
"restrictDocumentFolders": true,
"restrictCustomGpts": true
}
]
}{
"apiKeys": [
{
"id": "string",
"name": "string",
"obscuredApiKey": "string",
"state": "active",
"createdAt": "2025-01-01T00:00:00Z",
"lastUsedAt": "2025-01-01T00:00:00Z",
"monthlySpendingLimit": 0,
"currentMonthSpend": 0,
"adminScopes": [
"admin:export_usage"
],
"modelIds": [
"00000000-0000-0000-0000-000000000000"
],
"documentFolderIds": [
"00000000-0000-0000-0000-000000000000"
],
"customGptIds": [
"00000000-0000-0000-0000-000000000000"
],
"restrictDocumentFolders": true,
"restrictCustomGpts": true
}
]
}List of API keys
apiKeysobject[]requiredidstringrequired24-character key ID.
namestringrequiredDisplay name.
obscuredApiKeystringrequiredMasked key for display (e.g. sk_abc...xyz).
statestringrequiredCurrent key state.
createdAtstring<date-time>requiredISO 8601 creation timestamp.
lastUsedAtstring<date-time> | nulloptionalLast time the key was used, or null.
monthlySpendingLimitinteger | nullrequiredMonthly limit in microcents. Null = unlimited.
currentMonthSpendintegerrequiredSpend this calendar month in microcents.
adminScopesstring[]requiredAdmin scopes granted to this key.
modelIdsstring<uuid>[]requiredModel IDs the key is restricted to. Empty = all models.
documentFolderIdsstring<uuid>[]requiredDocument folder IDs the key is restricted to (applies when restrictDocumentFolders is true).
customGptIdsstring<uuid>[]requiredCustom GPT IDs the key is restricted to (applies when restrictCustomGpts is true).
restrictDocumentFoldersbooleanrequiredWhen false, the key can access all document folders; when true, access is limited to documentFolderIds.
restrictCustomGptsbooleanrequiredWhen false, the key can access all Custom GPTs; when true, access is limited to customGptIds.
Response codes
List of API keys
objectUnauthorized
Insufficient permissions