Authentication

Create a key on the API Keys page; keys need an active Basic or Pro plan. The secret is shown once, so store it safely: anyone with it can use your account. Send it in the Authorization header of every call.

Authorization: Bearer cl_<prefix>_<secret>

Every path below starts with this base URL:

https://castlab.ai/api/public/v1

When a key can't be used, the call is refused:

StatusCodeMeaning
401api_key_invalidNo key, a malformed, unknown or revoked key, or a web sign-in token instead of a key.
403plan_requiredYour account has no active paid plan. Your keys work again once you subscribe.
403terms_not_acceptedAccept the Terms of Service in the app first.
400inactive_userThe account is deactivated.