Перейти до вмісту
AstroWay/api v2.254.12 · docs
усі системи в нормі

API Key Introspection

GET
/auth/keys/me
request.sh
curl -X GET https://api.astroway.info/v1/auth/keys/me \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json"

Return metadata about the calling API key: plan, remaining credits, period end, bound domain, status. Useful for any SDK consumer that wants to surface plan and balance in its own UI. A key that is not metered (internal, or a custom plan without a limit) returns credits_remaining and credits_total_this_period as null with unlimited: true; a site key returns them as null with limits.per_hour.

fields
string

Comma-separated dotted paths, relative to data, to keep in the response. A path is applied to every element of an array, so planets.name means the name of each planet. Paths that match nothing come back in _fields_unmatched; a list where nothing matches at all is a 400, because an empty object would be a confident wrong answer.

Example
planets.name,planets.longitude
precision
integer
<= 15

Round every non-integer number in the response to this many decimal places. Integers are left alone, because an id is not a measurement. Ecliptic longitudes ship with fourteen decimals by default; 2 is about a tenth of an arcminute.

Example
4

Successful calculation

Media type application/json
object
ok
boolean
data
object
key_prefix
string
nullable
plan
string
nullable
credits_remaining
number
nullable
credits_total_this_period
number
nullable
period_end
string
nullable
status
string
nullable
domain
string
nullable
domain_bound_at
string
nullable
created_at
string
nullable
referrer_source
string
nullable
Example
{
"ok": true,
"data": {
"key_prefix": "aw_live_a3f...",
"plan": "indie",
"credits_remaining": 18432,
"credits_total_this_period": 50000,
"period_end": "2026-06-01T00:00:00.000Z",
"status": "active",
"domain": "example.com",
"domain_bound_at": "2026-05-14T18:22:00.000Z",
"created_at": "2026-05-12T08:00:00.000Z",
"referrer_source": "wp_plugin"
}
}

Validation error

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_INPUT",
"message": "Validation failed: date: Date must be YYYY-MM-DD",
"details": [
{
"path": "date",
"message": "Date must be YYYY-MM-DD"
}
]
}
}

Missing or invalid API key

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
}
Корисно?