Authentication
Send a Modaic API key as a bearer token on every protected request.
export MODAIC_API_KEY="mdc_..."
curl --request GET \
--url 'https://api.modaic.dev/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.
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, alignments, and metrics. |
write:repository | Run decisions through /v1/decision or /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.
Was this page helpful?