API Authentication
Authenticate your requests to the useGrant API.
The useGrant REST API authenticates requests with API keys sent as Bearer tokens. Start here to learn how to access the API securely, then explore the guides and the API reference.
Create an API key
- Log in to the app.
- Go to Settings → API Keys (
/u/settings/keys). - Enter a name for the key, choose an expiration and click Create.
Store the key securely, it is only shown once. Every API key starts with the uga_ prefix.
The prefix identifies it as a useGrant API key, which also makes leaked keys easy to spot with secret scanners.
Send the key
Include the key in the Authorization header of every request, prefixed with Bearer:
Authorization: Bearer uga_<key>If the key is missing, invalid or expired, the API responds with 401 Unauthorized.
Example
Create a provider with curl:
curl -X POST https://sdk.usegrant.dev/v1/providers \
-H "Authorization: Bearer uga_<key>" \
-H "Content-Type: application/json" \
-d '{"name": "acme-prod", "description": "Production workloads for Acme"}'Self-hosted
On a self-hosted instance the API is served under /api/sdk, for example
https://usegrant.example.com/api/sdk/v1/providers.