# External API Integrations

This document catalogs external API integrations across the Oshun platform.

> **Note**: This inventory was originally generated from the Lilith and Yemaya
> codebases during the initial monorepo migration. Additional domains (Iris,
> Tara, Veritas, Psyche, Nyx, Aja, Aphrodite, and others) have since been added
> and may have their own external integrations not listed here.

---

## Summary

| Category             | Count   | Primary Providers                                                    |
| -------------------- | ------- | -------------------------------------------------------------------- |
| AI/ML Providers      | 7       | OpenAI, Anthropic, Google AI, ElevenLabs, Replicate, RunPod, Civitai |
| Asset/Media          | 5       | Stability AI, Runway, Suno, Rodin, ComfyUI                           |
| Payments             | 3       | Stripe, RevenueCat, PayPal (planned)                                 |
| Cloud Infrastructure | 4       | AWS, GCP, Cloudflare, MinIO                                          |
| Communication        | 3       | SendGrid, Twilio, Firebase FCM                                       |
| Authentication       | 5       | Google, GitHub, Discord, Apple, Microsoft OAuth                      |
| Database/Cache       | 2       | PostgreSQL, Redis                                                    |
| Game Engines         | 3       | Godot, Blender, Unreal                                               |
| Monitoring           | 1       | Sentry                                                               |
| **Total**            | **34+** |                                                                      |

---

## AI/ML Providers

### 1. OpenAI

| Field                     | Value                                                                        |
| ------------------------- | ---------------------------------------------------------------------------- |
| **Provider**              | OpenAI                                                                       |
| **Used For**              | LLM completions, embeddings, image generation, moderation                    |
| **Services**              | `apps/lilith/svc-ai`, `apps/sophia/search-api`, `apps/lilith/svc-moderation` |
| **Environment Variables** | `OPENAI_API_KEY`, `OPENAI_MODEL`                                             |
| **Models**                | gpt-4o, gpt-4o-mini, gpt-4-turbo, text-embedding-3-small                     |

### 2. Anthropic (Claude)

| Field                     | Value                                              |
| ------------------------- | -------------------------------------------------- |
| **Provider**              | Anthropic                                          |
| **Used For**              | Advanced LLM completions, multi-turn conversations |
| **Services**              | `services/ai`, `packages/ai` (yemaya)              |
| **Environment Variables** | `ANTHROPIC_API_KEY`, `ANTHROPIC_MODEL`             |
| **Models**                | claude-3-5-sonnet-20241022, claude-3-opus          |

### 3. Google AI (Gemini)

| Field                     | Value                                 |
| ------------------------- | ------------------------------------- |
| **Provider**              | Google                                |
| **Used For**              | Alternative LLM, embeddings, vision   |
| **Services**              | `services/ai`, `packages/ai` (yemaya) |
| **Environment Variables** | `GOOGLE_API_KEY`, `GOOGLE_MODEL`      |
| **Models**                | gemini-1.5-pro, gemini-1.5-flash      |

### 4. OpenRouter

| Field                     | Value                                              |
| ------------------------- | -------------------------------------------------- |
| **Provider**              | OpenRouter                                         |
| **Used For**              | Multi-model LLM routing, cost optimization         |
| **Services**              | `services/ai/src/providers/openrouter-provider.ts` |
| **Environment Variables** | `OPENROUTER_API_KEY`                               |
| **Features**              | 100+ models, automatic fallback, rate limiting     |

### 5. ElevenLabs

| Field                     | Value                                                                   |
| ------------------------- | ----------------------------------------------------------------------- |
| **Provider**              | ElevenLabs                                                              |
| **Used For**              | Text-to-speech synthesis, voice cloning                                 |
| **Services**              | `services/tts`, `services/ai/src/providers/elevenlabs-provider.ts`      |
| **Environment Variables** | `ELEVENLABS_API_KEY`                                                    |
| **Models**                | eleven_v3, eleven_flash_v2_5, eleven_turbo_v2_5, eleven_multilingual_v2 |
| **Features**              | Voice cloning, WebSocket streaming, dubbing, emotional tags             |

### 6. Replicate

| Field                     | Value                                     |
| ------------------------- | ----------------------------------------- |
| **Provider**              | Replicate                                 |
| **Used For**              | On-demand ML model execution              |
| **Services**              | `services/ai`                             |
| **Environment Variables** | `REPLICATE_API_TOKEN`                     |
| **Features**              | Pay-per-use, no GPU infrastructure needed |

### 7. RunPod

| Field                     | Value                                                               |
| ------------------------- | ------------------------------------------------------------------- |
| **Provider**              | RunPod                                                              |
| **Used For**              | GPU-accelerated computation                                         |
| **Services**              | `services/ai/src/providers/runpod-serverless/`, `packages/gpu-jobs` |
| **Environment Variables** | `RUNPOD_API_KEY`                                                    |
| **Features**              | Serverless GPU, ComfyUI integration, network volumes                |

---

## Asset & Media Providers

### 8. Civitai

| Field                     | Value                                                  |
| ------------------------- | ------------------------------------------------------ |
| **Provider**              | Civitai                                                |
| **Used For**              | AI model marketplace, Stable Diffusion models          |
| **Services**              | `services/ai/src/providers/civitai/civitai-service.ts` |
| **Environment Variables** | `CIVITAI_API_KEY`                                      |
| **Features**              | Model discovery, version management, content filtering |
| **Rate Limit**            | 60 requests/minute                                     |

### 9. Stability AI

| Field                     | Value                               |
| ------------------------- | ----------------------------------- |
| **Provider**              | Stability AI                        |
| **Used For**              | Image generation (Stable Diffusion) |
| **Services**              | `services/ai`                       |
| **Environment Variables** | `STABILITY_API_KEY`                 |
| **Models**                | SDXL 1.0, Stable Diffusion 3        |

### 10. Runway

| Field                     | Value                         |
| ------------------------- | ----------------------------- |
| **Provider**              | Runway                        |
| **Used For**              | AI video generation           |
| **Services**              | `packages/ai-video` (yemaya)  |
| **Environment Variables** | `RUNWAY_API_KEY`              |
| **Features**              | Text-to-video, image-to-video |

### 11. Suno

| Field                     | Value                                |
| ------------------------- | ------------------------------------ |
| **Provider**              | Suno                                 |
| **Used For**              | AI music generation                  |
| **Services**              | `packages/ai-video` (yemaya)         |
| **Environment Variables** | `SUNO_API_KEY`                       |
| **Features**              | Music composition, lyrics generation |

### 12. Rodin

| Field                     | Value                             |
| ------------------------- | --------------------------------- |
| **Provider**              | Rodin                             |
| **Used For**              | 3D model generation               |
| **Services**              | `packages/3d-generation` (yemaya) |
| **Environment Variables** | `RODIN_API_KEY`                   |
| **Features**              | Text-to-3D, model optimization    |

---

## Payment Providers

### 13. Stripe

| Field                     | Value                                                                                    |
| ------------------------- | ---------------------------------------------------------------------------------------- |
| **Provider**              | Stripe                                                                                   |
| **Used For**              | Payment processing, subscriptions, billing                                               |
| **Services**              | `services/payment-orchestrator`                                                          |
| **Environment Variables** | `STRIPE_API_KEY`, `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET`, `STRIPE_PUBLISHABLE_KEY` |
| **Features**              | Customers, payment intents, subscriptions, billing portal, webhooks                      |

### 14. RevenueCat

| Field                     | Value                                       |
| ------------------------- | ------------------------------------------- |
| **Provider**              | RevenueCat                                  |
| **Used For**              | Mobile in-app purchase management           |
| **Services**              | `services/payment-orchestrator`             |
| **Environment Variables** | `REVENUECAT_API_KEY`                        |
| **Features**              | Multi-platform IAP, subscription management |

---

## Cloud Infrastructure

### 15. AWS (S3, CloudFront, etc.)

| Field                     | Value                                                                                   |
| ------------------------- | --------------------------------------------------------------------------------------- |
| **Provider**              | Amazon Web Services                                                                     |
| **Used For**              | Object storage, CDN, compute                                                            |
| **Services**              | `services/media`, all services                                                          |
| **Environment Variables** | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`, `S3_BUCKET`, `CLOUDFRONT_*` |
| **Features**              | S3, CloudFront, EC2, RDS, Lambda                                                        |

### 16. MinIO

| Field                     | Value                                                                      |
| ------------------------- | -------------------------------------------------------------------------- |
| **Provider**              | MinIO                                                                      |
| **Used For**              | S3-compatible object storage                                               |
| **Services**              | `services/media`, `packages/database` (yemaya)                             |
| **Environment Variables** | `MINIO_ENDPOINT`, `MINIO_ACCESS_KEY`, `MINIO_SECRET_KEY`, `MINIO_BUCKET_*` |
| **Features**              | S3 API compatibility, multi-part uploads, versioning                       |

### 17. Cloudflare (R2, Workers)

| Field                     | Value                                    |
| ------------------------- | ---------------------------------------- |
| **Provider**              | Cloudflare                               |
| **Used For**              | CDN, object storage (R2), edge computing |
| **Services**              | Multiple services                        |
| **Environment Variables** | `CLOUDFLARE_*`                           |
| **Features**              | Zero-egress R2, Workers, DNS             |

---

## Communication Providers

### 18. SendGrid

| Field                     | Value                                     |
| ------------------------- | ----------------------------------------- |
| **Provider**              | SendGrid                                  |
| **Used For**              | Email delivery                            |
| **Services**              | `services/notification`, `services/auth`  |
| **Environment Variables** | `SENDGRID_API_KEY`, `SENDGRID_FROM_EMAIL` |
| **Features**              | Templates, tracking, attachments          |

### 19. Twilio

| Field                     | Value                                                            |
| ------------------------- | ---------------------------------------------------------------- |
| **Provider**              | Twilio                                                           |
| **Used For**              | SMS messaging, OTP                                               |
| **Services**              | `services/auth/src/twilio-sms.ts`                                |
| **Environment Variables** | `TWILIO_ACCOUNT_SID`, `TWILIO_AUTH_TOKEN`, `TWILIO_PHONE_NUMBER` |
| **Features**              | SMS sending, phone validation                                    |

### 20. Firebase Cloud Messaging

| Field                     | Value                                                                  |
| ------------------------- | ---------------------------------------------------------------------- |
| **Provider**              | Firebase (Google)                                                      |
| **Used For**              | Push notifications                                                     |
| **Services**              | `services/notification`                                                |
| **Environment Variables** | `FIREBASE_PROJECT_ID`, `FIREBASE_PRIVATE_KEY`, `FIREBASE_CLIENT_EMAIL` |
| **Features**              | iOS, Android, Web push                                                 |

---

## Authentication Providers

### 21-25. OAuth Providers

| Provider      | Environment Variables                                                                           |
| ------------- | ----------------------------------------------------------------------------------------------- |
| **Google**    | `OAUTH_GOOGLE_CLIENT_ID`, `OAUTH_GOOGLE_CLIENT_SECRET`                                          |
| **GitHub**    | `OAUTH_GITHUB_CLIENT_ID`, `OAUTH_GITHUB_CLIENT_SECRET`                                          |
| **Discord**   | `OAUTH_DISCORD_CLIENT_ID`, `OAUTH_DISCORD_CLIENT_SECRET`                                        |
| **Apple**     | `OAUTH_APPLE_CLIENT_ID`, `OAUTH_APPLE_TEAM_ID`, `OAUTH_APPLE_KEY_ID`, `OAUTH_APPLE_PRIVATE_KEY` |
| **Microsoft** | `OAUTH_MICROSOFT_CLIENT_ID`, `OAUTH_MICROSOFT_CLIENT_SECRET`                                    |

**Services**: `services/auth`, `packages/auth` (yemaya)

---

## Game Engine Integrations

### 26. Godot

| Field        | Value                         |
| ------------ | ----------------------------- |
| **Provider** | Godot Engine                  |
| **Used For** | Game development integration  |
| **Services** | `packages/godot` (yemaya)     |
| **Features** | GDExtension, WebSocket bridge |

### 27. Blender

| Field        | Value                          |
| ------------ | ------------------------------ |
| **Provider** | Blender                        |
| **Used For** | 3D rendering, asset generation |
| **Services** | `packages/blender` (yemaya)    |
| **Features** | Python API, headless rendering |

### 28. Unreal Engine

| Field        | Value                        |
| ------------ | ---------------------------- |
| **Provider** | Unreal Engine                |
| **Used For** | Game development integration |
| **Services** | `packages/unreal` (yemaya)   |
| **Features** | Asset import/export          |

---

## Monitoring & Security

### 29. Sentry

| Field                     | Value                                  |
| ------------------------- | -------------------------------------- |
| **Provider**              | Sentry                                 |
| **Used For**              | Error tracking, performance monitoring |
| **Services**              | All services                           |
| **Environment Variables** | `SENTRY_DSN`                           |

### 30. HashiCorp Vault (Optional)

| Field                     | Value                          |
| ------------------------- | ------------------------------ |
| **Provider**              | HashiCorp                      |
| **Used For**              | Secret management              |
| **Services**              | `services/lib/vault-client.js` |
| **Environment Variables** | `VAULT_ADDR`, `VAULT_TOKEN`    |

---

## Database & Cache

### 31. PostgreSQL

| Field                     | Value                        |
| ------------------------- | ---------------------------- |
| **Provider**              | PostgreSQL                   |
| **Used For**              | Primary relational database  |
| **Services**              | All services                 |
| **Environment Variables** | `DATABASE_URL`, `POSTGRES_*` |

### 32. Redis

| Field                     | Value                                                     |
| ------------------------- | --------------------------------------------------------- |
| **Provider**              | Redis                                                     |
| **Used For**              | Caching, sessions, queues                                 |
| **Services**              | All services                                              |
| **Environment Variables** | `REDIS_URL`, `REDIS_HOST`, `REDIS_PORT`, `REDIS_PASSWORD` |

---

## Target Domain Mapping

| Integration                    | Target Domain            |
| ------------------------------ | ------------------------ |
| OpenAI, Anthropic, Google AI   | Isis (AI orchestration)  |
| ElevenLabs, Suno               | Isis (audio generation)  |
| Stability AI, Civitai, ComfyUI | Isis (image generation)  |
| Runway                         | Isis (video generation)  |
| Rodin                          | Isis (3D generation)     |
| RunPod, Replicate              | Isis (GPU compute)       |
| Stripe, RevenueCat             | Oshun Auth (billing)     |
| SendGrid, Twilio, FCM          | Oshun (notifications)    |
| OAuth providers                | Oshun Auth               |
| Godot, Blender, Unreal         | Bellona (engine bridges) |
| Sentry                         | Shared (observability)   |
| PostgreSQL, Redis              | Shared (infrastructure)  |
| S3, MinIO, R2                  | Shared (storage)         |

---

## Revision History

| Version | Date       | Author           | Changes         |
| ------- | ---------- | ---------------- | --------------- |
| 1.0     | 2026-01-10 | Development Team | Initial version |
