If a request carries both, the API returns
400 with Send either an API key or an access token, not both.
Permissions
Both credentials carry permissions namedpricing:read and pricing:write.
Changes with
pricing:write also need an admin role. A request without the required permission returns 403 with code permission_denied.
Get an API key
Create an API key at app.costgraph.ai and set its permissions when you create it.Get an access token
Register an app and sign people in as described in Sign in with CostGraph. Requestpricing:read, pricing:write, or both in the scope parameter, then send the access token as a bearer token.
Authenticate with the SDK
The SDK examples send an API key.- Go
- TypeScript
Raw HTTP
Include your API key in theX-API-KEY header:
401 problem document with code unauthenticated. On /v1, every error is an RFC 9457 problem document; see Errors.