Purpose
Theintegration-api is the single point of contact with every external AI provider in the platform. It:
- Stores provider API keys encrypted at rest using AES-256-GCM
- Decrypts credentials in-memory per request (never written to logs or disk)
- Executes LLM streaming and non-streaming inference
- Generates embeddings for RAG search
- Verifies provider credentials before saving them
Port
9004 — HTTP · gRPC (cmux)Language
Go 1.25
Gin (REST) + gRPC
Storage
PostgreSQL
integration_db
Redis (provider cache)integration-api is the only service that decrypts and uses provider API keys. Keys are decrypted in-memory per request and are never written to logs, forwarded to other services, or stored in plaintext anywhere.Credential Encryption Flow
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 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 |
| VoyageAI | Embeddings and reranking |
Caller Architecture
Each LLM provider lives underapi/integration-api/internal/caller/<provider>/. The directory structure is:
| File | Purpose |
|---|---|
<provider>.go | Client initialization, credential binding |
llm.go | LargeLanguageCaller implementation |
embedding.go | EmbeddingCaller (where supported) |
verify-credential.go | Pre-storage credential validation |
Running
- Docker Compose
- From Source
Health Endpoints
| Endpoint | Purpose |
|---|---|
GET /readiness/ | Service ready (DB + Redis connected) |
GET /healthz/ | Liveness probe |
Next Steps
Configuration
Environment variables including INTEGRATION_CRYPTO_KEY.
Adding Providers
LargeLanguageCaller interface and how to add a new LLM provider.
Assistant API
How assistant-api calls integration-api during a live voice conversation.
Architecture
Full system topology.