Skip to main content

Purpose

The integration-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

ProviderNotes
OpenAIGPT-4o, GPT-4, GPT-3.5 · Function calling · Streaming
AnthropicClaude 3.5 Sonnet, Claude 3 · Tool use · Streaming
Google GeminiGemini Pro · Flash · Streaming
Google Vertex AIEnterprise Gemini deployment
Azure OpenAIEnterprise GPT with custom endpoint
AWS BedrockLlama, Titan, Mistral via AWS
CohereCommand R+ · Streaming
MistralMistral Large · Small · Streaming
HuggingFaceInference API
ReplicateModel hosting
VoyageAIEmbeddings and reranking

Caller Architecture

Each LLM provider lives under api/integration-api/internal/caller/<provider>/. The directory structure is:
api/integration-api/internal/caller/
├── callers.go              ← interfaces + factory
├── chat_options.go         ← ChatCompletionOptions, ToolDefinition
├── embedding_options.go    ← EmbeddingOptions
├── reranking_options.go    ← RerankerOptions
├── anthropic/
├── azure/
├── cohere/
├── gemini/
├── huggingface/
├── mistral/
├── openai/                 ← reference implementation
├── replicate/
├── vertexai/
└── voyageai/
Each provider package contains:
FilePurpose
<provider>.goClient initialization, credential binding
llm.goLargeLanguageCaller implementation
embedding.goEmbeddingCaller (where supported)
verify-credential.goPre-storage credential validation

Running

make up-integration

make logs-integration

make rebuild-integration

Health Endpoints

EndpointPurpose
GET /readiness/Service ready (DB + Redis connected)
GET /healthz/Liveness probe
curl http://localhost:9004/readiness/

Next Steps