Connecting Providers
StackSpend uses read-only credentials to fetch cost data from your cloud and AI providers. Nothing is modified in your accounts.
Before you start
- You need to be an admin or owner of your StackSpend organisation.
- You need admin or billing access to the provider account you're connecting.
- All credentials are encrypted at rest using AES-256-GCM. StackSpend uses read-only access only.
Adding a provider
Navigate to Settings → Providers in your dashboard and click Add Provider. Select the provider type from the list below and follow the steps.
Uses the Cost Explorer API with a read-only IAM role. Supports multi-account setups via AWS Organizations.
- 1In your AWS account, create a new IAM role with the CostExplorerReadOnlyAccess policy.
- 2Set the trust policy to allow StackSpend's AWS account to assume the role.
- 3Copy the Role ARN and paste it into the StackSpend provider connection form.
- 4Click Test Connection to verify access, then Save.
Uses BigQuery billing export. StackSpend auto-detects your billing export tables.
- 1Enable Cloud Billing API in your GCP project.
- 2Create a service account with Billing Account Viewer (at the billing account level), BigQuery Job User (at the project level), and BigQuery Data Viewer (at the dataset level).
- 3Download the service account JSON key.
- 4Upload the key in the StackSpend provider connection form and click Test Connection.
Azure
Detailed guideUses the Cost Management Query API with service principal authentication.
- 1Register an app in Azure Active Directory.
- 2Grant the app Cost Management Reader role on the subscription or management group.
- 3Copy the Tenant ID, Client ID, and Client Secret.
- 4Enter these in the StackSpend provider connection form and click Test Connection.
OpenAI
Detailed guideReads usage data from the OpenAI API using a read-only API key.
- 1Go to the OpenAI dashboard and create a new API key (or use an existing one).
- 2The key only needs read access to usage and billing data.
- 3Paste the API key into the StackSpend provider connection form.
- 4Click Test Connection to verify, then Save.
Anthropic
Detailed guideReads usage data from the Anthropic API.
- 1Go to the Anthropic console and generate an API key.
- 2Paste the API key into the StackSpend provider connection form.
- 3Click Test Connection to verify, then Save.
Cursor
Detailed guideUses the Cursor Admin API. Requires an Enterprise plan and team admin access.
- 1In your Cursor team settings, navigate to the Admin API section.
- 2Generate an API key.
- 3Paste the API key into the StackSpend provider connection form.
- 4Click Test Connection to verify, then Save.
GitHub
Detailed guideUses the GitHub Billing API. Requires an organisation account with owner or admin access.
- 1Create a Personal Access Token (classic) with read:org, read:user, and manage_billing:enterprise scopes.
- 2For Copilot billing, also add manage_billing:copilot scope.
- 3Enter your organisation name and the token in the StackSpend provider connection form.
- 4Click Test Connection to verify, then Save.
Hugging Face
Detailed guideUses the Hugging Face billing API. Requires an organisation with owner or admin access.
- 1Create a Fine-grained token with User permission "Read access to your billing usage..." and Org "Read access to organizations settings", or use a Read token.
- 2Enter your organisation slug and the token in the StackSpend provider connection form.
- 3Click Test Connection to verify, then Save.
Grok (xAI)
Detailed guideUses the xAI Management API for billing. Requires a Management API key (not the inference API key) and Team ID.
- 1Go to xAI Console → Settings → Management Keys and create a Management API key.
- 2Find your Team ID in the console URL (e.g. console.x.ai/team/default).
- 3Enter the Management API key and Team ID in the StackSpend provider connection form.
- 4Click Test Connection to verify, then Save.
Twilio
Detailed guideUses the Twilio Usage Records API with Account SID and Auth Token.
- 1Log in to the Twilio Console and find your Account SID and Auth Token.
- 2Enter both values in the StackSpend provider connection form.
- 3Click Test Connection to verify, then Save.
After connecting
Once a provider is connected, StackSpend begins syncing historical cost data. The first sync typically takes a few minutes depending on the size of your billing history.
After the initial sync, costs are updated automatically on a daily schedule. You can also trigger a manual sync from the provider settings page.