System

Create a new API key. Requires an internal or enterprise API key. Returns the generated key string once: only its SHA-256 is stored, so it cannot be retrieved later, only rotated. The plan comes from the account and is not accepted in the body. allowed_endpoints limits the key to a subset of the API: paths under /v1, exact ("chart") or a namespace ("embed/*"); omit it and the key may call everything the plan includes. credits_cap_cycle caps what this key may spend per billing cycle (0 parks it). A publishable key (origin_restriction.type "public", prefix pk_) is for page source, so it needs allowed_origins, credits_cap_cycle and allowed_endpoints: without any of them the request is refused with 400, and a pk_ key missing a bound is refused with 403 PUBLISHABLE_KEY_UNBOUNDED wherever it is used.

post/keys

Request

  • Base URL: https://api.astroway.info/v1
  • URL: https://api.astroway.info/v1/keys
  • Auth: API key in header X-Api-Key

Query parameters

fieldsstring

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.

precisioninteger

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.

Request body

namestring required
mode'live' | 'test'
allowed_endpointsstring[]

Paths under /v1 this key may call, exact (chart) or a namespace (embed/*). Omitted means no limit; required for a publishable key.

credits_cap_cycleinteger

Credits this key may spend per billing cycle; 0 parks it. Omitted means no per-key cap; required for a publishable key.

Response

Successful calculation

okboolean

Example response

{
  "ok": true
}

Changes

    • info

      added the optional property / to the response with the status

    • breaking

      the / response's property type changed from no type to number for status

    • info

      added the new optional request property