Account
Account answers: is my key working, what has it used, and is the API up?
| Endpoint | Returns |
|---|---|
GET /v2/key-status | Your key's status, limits, usage, scopes and billing mode |
GET /v2/ping | A health check. Needs no API key |
Neither has an x402 twin.
Key Status
GET /v2/key-status: the current status and usage of your API key. No parameters.
{
"success": true,
"data": {
"id": 1,
"key": "string",
"name": "string",
"status": "active",
"dailyRequestLimit": 1,
"monthlyRequestLimit": 1,
"expiresAt": "string",
"createdAt": "string",
"updatedAt": "string",
"requestsPerMinute": 1,
"email": "string",
"project": "string",
"allowOverage": true,
"maxOverage": 1,
"spendCapCredits": 1,
"bonusCredits": 1,
"bonusCreditsExpiresAt": "string",
"userId": 1,
"emailNotificationsEnabled": true,
"lastEmailSentAt": "string",
"lastUsagePercentNotified": 1,
"spendAlertThreshold": "string",
"spendAlertMaxFrequencyHours": 1,
"totalSpendAlerted": "string",
"athenaEnabled": true,
"scopes": ["string"],
"tier": "string",
"depositCredits": 1,
"billingMode": "deposit",
"usage": { "monthly": 1, "daily": 1 },
"limits": { "monthly": 1, "daily": 1 },
"isExpired": true,
"remainingRequests": { "monthly": 1, "daily": 1 }
}
}
curl -H "x-elfa-api-key: $ELFA_API_KEY" \
"https://api.elfa.ai/v2/key-status"
The spec's example uses placeholder values.
| Field | Type | Meaning |
|---|---|---|
id | number | Key ID |
key | string | Masked key: prefix plus the last 4 characters, such as elfak_...245c. The full secret is never returned. Use it only to tell two keys apart |
name | string | Key name |
status | string | active, revoked, expired or payment_required. See Enums |
tier | string | The key's plan tier |
billingMode | string | deposit or arrears |
scopes | string[] | Effective scopes, including any enterprise overlay |
dailyRequestLimit, monthlyRequestLimit | number | Request limits |
requestsPerMinute | number or null | Per-minute limit |
usage.daily, usage.monthly | number | Used so far |
limits.daily, limits.monthly | number | Limits for each period |
remainingRequests.daily, remainingRequests.monthly | number | Left in each period |
depositCredits | number | Deposit credit balance |
bonusCredits, bonusCreditsExpiresAt | number, string or null | Bonus credits and when they expire |
allowOverage, maxOverage, spendCapCredits | boolean or null, number or null | Overage settings and spend cap |
spendAlertThreshold | string, number or null | Spend alert settings |
totalSpendAlerted | string or number | Spend alert settings |
spendAlertMaxFrequencyHours | number | Spend alert settings |
emailNotificationsEnabled | boolean | Usage email settings |
lastEmailSentAt | string (date-time) or null | Usage email settings |
lastUsagePercentNotified | number | Usage email settings |
athenaEnabled | boolean | Whether the key is provisioned for Auto |
expiresAt, isExpired | string, boolean | Expiry |
createdAt, updatedAt | string | Timestamps |
email, project | string or null | Owner email and project |
userId | number or null | Account bookkeeping. Kept for backwards compatibility, not part of the supported surface |
| Parameter | Required | Type | Meaning |
|---|---|---|---|
| None | This endpoint takes no parameters |
Scopes Are Not a Full Access Map
Scopes gate the /v2 data and chat endpoints only. /v2/auto/* is not scope-gated, so you cannot tell from scopes whether a key reaches Auto.
The Authoritative Balance
Most /v2/* responses report their own cost in the x-elfa-credits header, so you do not need to read key status before and after each call. Streaming responses and charges that finalize after the response is flushed carry only a subtotal in the header. For those, key status is the authoritative balance. See Pricing.
Also via x402: not available.
Ping
GET /v2/ping: a health check to verify the API is available. Needs no API key and takes no parameters.
{
"success": true,
"data": {
"message": "string"
}
}
curl "https://api.elfa.ai/v2/ping"
The spec's example uses placeholder values.
| Field | Type | Meaning |
|---|---|---|
success | boolean | Always true |
data.message | string | A status message |
| Parameter | Required | Type | Meaning |
|---|---|---|---|
| None | This endpoint takes no parameters |
Also via x402: not available.
Errors
Key status answers 401 when the key is missing, invalid or expired. Ping needs no key. For the rest, see Enums and Errors.
Related
- Reference: key-status, ping
- Authentication and Rate Limits
- v3 equivalent:
/v3/key-status