Authentication
Send a Modaic API key as a bearer token on every protected request.
export MODAIC_API_KEY="mdc_..."
curl --request GET \
--url 'https://modaic.dev/api/v1/models' \
--header "Authorization: Bearer $MODAIC_API_KEY"
Create and revoke keys from the Modaic dashboard. Treat a key like a password: store it in a secret manager, never commit it, and do not expose it in browser code.
Interactive CLI sessions
For interactive terminal use, the Python package includes modaic login
and modaic login --headless. Compare the terminal code and device on
the confirmation page and approve only requests you started. See the
CLI reference for storage, profiles, refresh, and logout.
Browser sessions authenticate CLI commands; applications, programmatic SDK
clients, CI, and deployed services should use API keys. An environment
MODAIC_API_KEY takes precedence over a stored CLI session.
Scopes
API keys use read and write scopes for three resource categories:
| Scope | Grants access to |
|---|---|
read:repository | List available models and read models, examples, decisions, instruction optimization jobs, and metrics. |
write:repository | Run inference through /v1/systemone, and create or update repository-scoped resources. Also grants repository read access. |
read:organization | Read organization-scoped resources. |
write:organization | Change organization-scoped resources. Also grants organization read access. |
read:user | Read resources belonging to the key owner. |
write:user | Change resources belonging to the key owner. Also grants user read access. |
Organization API keys are restricted to repository-scoped resources owned by that organization. API keys cannot create, list, or revoke other API keys; those operations require an interactive user session.
Authentication errors
401 authentication_requiredmeans the bearer header is missing or malformed.401 invalid_access_tokenmeans the key is invalid or revoked.403 insufficient_token_scopeidentifies the missing scope indetail.403 organization_token_boundarymeans an organization key was used outside its permitted resource boundary.