Integrations

Integrations allow your app to access external services (Google Sheets, Drive, etc.) on behalf of users through OAuth.


Declaring Integrations

Define in inf.yml:

yaml
1integrations:2  - key: google.sheets3    description: Access to read/write Google Sheets4    optional: false56  - key: google.drive7    description: Access to Google Drive files8    optional: true

Properties

PropertyTypeDescription
keystringIntegration identifier
descriptionstringShown to users
optionalbooleanIf false, app won't run without it

Available Integrations

List all available integrations:

bash
1infsh app integrations list

Common Integrations

KeyDescription
google.sheetsRead/write Google Sheets
google.sheets.readonlyRead-only Sheets access
google.driveGoogle Drive files
google-sa.filesService account access (Sheets, Docs, Drive)
microsoft.mail.readRead Outlook email
notion.readRead shared Notion pages
salesforce.apiSalesforce REST API access
reddit.readRead Reddit posts and comments

Integrations overview for setup guides (Google, Slack, Microsoft, Notion, Salesforce, Reddit, and more)


Accessing Credentials

OAuth Integrations

1import os, json23class App(BaseApp):4    async def setup(self, config):5        creds_json = os.environ.get("GOOGLE_OAUTH_CREDENTIALS")6        if creds_json:7            self.credentials = json.loads(creds_json)

Service Account

1from google.oauth2 import service_account23sa_json = os.environ.get("GOOGLE_SA_CREDENTIALS")4if sa_json:5    self.credentials = service_account.Credentials.from_service_account_info(6        json.loads(sa_json)7    )

Secrets vs Integrations

FeatureSecretsIntegrations
User providesRaw value (API key)OAuth authorization
RefreshManualAutomatic
Scope controlNoneFine-grained
Best forAPI keysOAuth services

Check before run

Validate that your team has the secrets and integrations an app requires before calling POST /run:

POST /integrations/check

Requires integrations:read scope. Send the same secrets and integrations arrays from your app's inf.yml:

bash
1curl -X POST https://api.inference.sh/integrations/check \2  -H "Authorization: Bearer inf_your_key" \3  -H "Content-Type: application/json" \4  -H "X-API-Version: 2" \5  -d '{6    "secrets": [{ "key": "OPENAI_API_KEY" }],7    "integrations": [{ "key": "google.sheets" }]8  }'

When requirements are missing, the response matches the 412 body from POST /run (satisfied: false and an errors array). See REST overview — Missing requirements.

Connect from the CLI

Connect native OAuth and service-account providers without the dashboard:

bash
1belt integrations connect google2belt integrations connect slack3belt integrations disconnect google

For MCP connector servers, use belt mcp connect <slug> instead. List connected services with belt integrations list.

When a provider supports multiple connection types (Google has OAuth at google and a separate service account at google-sa), use the provider key that matches the connection you need. Connect a Google service account from Settings → Integrations (google-sa slug) or with belt integrations connect google-sa.

When you run an app or agent and requirements are still missing, the CLI prints the same errors[] categories with actionable commands — for example belt secrets set OPENAI_API_KEY <value> or belt integrations connect google.

CLI setup — Integrations · Integrations API


Best Practices

  1. Request minimal scopes - use readonly if you only read
  2. Clear descriptions - explain why access is needed
  3. Handle missing gracefully - check if optional integrations exist
  4. Test without - ensure app works without optional integrations

REST API

Programmatic connect, disconnect, and requirements checks:

Integrations APIPOST /integrations, POST /integrations/check, MCP tool proxy


Next

Troubleshooting - Common issues and solutions

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.