Skip to main content

Quickstart

Generate an API key and make your first authenticated request to the Spectral API.

Generate an API key

  1. Click the user icon, then select Organization.
  2. Open the API Key tab and click Generate API Key.
  3. Enter a name for the key and submit.
  4. Copy the key and store it somewhere safe.
warning

The full key is shown only once, at creation. If you lose it, you won't be able to retrieve it and will have to generate a new one.

Make your first request

Pass the key as a Bearer token in the Authorization header on every request. To confirm everything works, fetch your account details:

Request
curl https://spectral.principled.app/api/v1/me \
-H "Authorization: Bearer ak_****"

A successful request returns your organization, user, and plan:

Response
{
"org_id": "org_2bKp9...",
"user_id": "user_7dRm4...",
"plan": {
"tier": "FREE"
}
}

Next Steps