Overview
Theintegration-api is the provider execution layer. It sits between assistant-api and every external AI provider — OpenAI, Anthropic, Deepgram, ElevenLabs, and others. It stores all provider credentials encrypted at rest and is the only service in the platform that ever holds or transmits plaintext API keys.
Port
9004 — HTTP · gRPC (cmux)Language
Go 1.25
Gin (REST) + gRPC
Storage
PostgreSQL
integration_db
Redis (provider cache)The
integration-api is the only service that decrypts and uses provider API keys. Keys are decrypted in-memory per request and never written to logs, forwarded to other services, or stored in plaintext anywhere on disk.Components
Caller Layer — Provider API implementations
Caller Layer — Provider API implementations
Each external provider is implemented as a Go package under
The
api/integration-api/internal/caller/<provider>/. Every package follows a consistent structure:| File | Purpose |
|---|---|
<provider>.go | Client initialization, credential binding |
llm.go | LLM caller — streaming token inference |
embedding.go | Embedding model invocation (where supported) |
verify-credential.go | Pre-storage credential validation |
caller/callers.go factory registers all providers and routes execution to the correct implementation based on the credential type stored in integration_db.Adding a new LLM providerCreate api/integration-api/internal/caller/<provider>/ with the above files, then register in callers.go. No changes to other services are needed.Credential Encryption
Credential Encryption
Credentials follow a strict encrypt-on-write, decrypt-on-use lifecycle:
OAuth 2.0 Integration
OAuth 2.0 Integration
For providers that use OAuth (e.g., Google, GitHub), integration-api manages the full OAuth flow: redirect, callback, token storage, and automatic refresh.
| OAuth Setting | Variable |
|---|---|
| Callback URL | OAUTH_CALLBACK_URL |
| Google client | GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET |
| GitHub client | GITHUB_OAUTH_CLIENT_ID, GITHUB_OAUTH_CLIENT_SECRET |
Supported Providers
- LLM
- STT
- TTS
- Telephony
| Provider | Notes |
|---|---|
| OpenAI | GPT-4o, GPT-4, GPT-3.5 · Function calling · Streaming |
| Anthropic | Claude 3.5 Sonnet, Claude 3 · Tool use · Streaming |
| Google Gemini | Gemini Pro · Flash · Streaming |
| Google Vertex AI | Enterprise Gemini deployment |
| Azure OpenAI | Enterprise GPT deployment with custom endpoint |
| AWS Bedrock | Llama, Titan, Mistral via AWS |
| Cohere | Command R+ · Streaming |
| Mistral | Mistral Large · Small · Streaming |
| HuggingFace | Inference API |
| Replicate | Model hosting via Replicate API |
| VoyageAI | Embeddings and reranking |
Configuration
Editdocker/integration-api/.integration.env before starting the service.
Required variables
| Variable | Required | Default | Description |
|---|---|---|---|
SECRET | ✅ Yes | rpd_pks | JWT signing secret — must match all services |
POSTGRES__HOST | ✅ Yes | postgres | PostgreSQL host |
POSTGRES__DB_NAME | ✅ Yes | integration_db | Database name |
POSTGRES__AUTH__USER | ✅ Yes | rapida_user | Database user |
POSTGRES__AUTH__PASSWORD | ✅ Yes | — | Database password |
REDIS__HOST | ✅ Yes | redis | Redis host |
INTEGRATION_CRYPTO_KEY | ✅ Yes | — | AES-256-GCM key for credential encryption |
WEB_HOST | ✅ Yes | web-api:9001 | web-api gRPC address |
Optional OAuth variables
| Variable | Required | Description |
|---|---|---|
OAUTH_CALLBACK_URL | No | OAuth redirect URI |
GOOGLE_OAUTH_CLIENT_ID | No | Google OAuth app client ID |
GOOGLE_OAUTH_CLIENT_SECRET | No | Google OAuth app client secret |
GITHUB_OAUTH_CLIENT_ID | No | GitHub OAuth app client ID |
GITHUB_OAUTH_CLIENT_SECRET | No | GitHub OAuth app client secret |
Full environment file
Running
- Docker Compose
- From Source
Health & Observability
| Endpoint | Purpose |
|---|---|
GET /readiness/ | Reports whether the service is ready (DB + Redis connected) |
GET /healthz/ | Liveness probe |
Troubleshooting
Credential test fails for a provider
Credential test fails for a provider
- Verify the API key has the correct permissions for your account tier.
- Check the provider’s status page for outages.
- Confirm
INTEGRATION_CRYPTO_KEYhas not changed since the credential was stored.
LLM streaming times out
LLM streaming times out
- Check
make logs-integrationfor provider-side timeout errors. - Increase
POSTGRES__MAX_OPEN_CONNECTIONif database contention is visible. - For Azure OpenAI: confirm the deployment name in the credential matches the actual Azure deployment.
Stored credentials unreadable after restart
Stored credentials unreadable after restart
INTEGRATION_CRYPTO_KEY has changed between restarts. Credentials encrypted with the old key cannot be decrypted. Set the key back to its original value, or re-enter all provider credentials through the dashboard.