Authentication
All API requests require authentication via a Bearer token in theAuthorization header:
Authentication methods
OAuth 2.0
The API supports OAuth 2.0 with JWT access tokens issued by the Erna authorization server. Tokens are validated using the JWKS endpoint. The authorization server URL ishttps://auth.erna.ai.
API keys
API keys provide a simpler authentication method for server-to-server integrations. Include the key as a Bearer token.Scopes
OAuth tokens and API keys require specific scopes to access endpoints:| Scope | Required for |
|---|---|
schedules:write | POST /v1/schedules |
schedules:read | GET /v1/schedules/jobs/ |
solver:run | POST /v1/solver/solve |
Protected Resource Metadata
The API publishes an RFC 9728 Protected Resource Metadata document at:Credits
Schedule generation (POST /v1/schedules) consumes credits. Credits are reserved when the job is created and finalized when the job completes. If you have insufficient credits, the API returns a402 response with a link to the checkout page.
The direct solver endpoint (POST /v1/solver/solve) does not consume credits.