Multimodal AI aggregator: text, image, video, and audio behind one OpenAI-compatible API. Stripe + Coinbase Commerce billing. Single credit ledger. Drop-in for any OpenAI SDK — point
base_urlathttps://api.godance.ai/v1and it works.
godance/
├── backend/ Java 21 · Spring Boot 3.4 (WebFlux) · PostgreSQL · Redis · Flyway
│ OpenAI-compatible REST API, credit ledger, provider gateway with
│ regional allowlist enforcement, embedded Quartz scheduler.
│
├── app/ Vite · React 18 · TypeScript · Tailwind
│ Chat UI, dashboard, billing surface. Deploys as a static SPA
│ to Cloudflare Pages → app.godance.ai.
│
└── marketing/ Astro 5 · Tailwind
SSG marketing site → godance.ai. SEO + GEO optimized.
Each subdirectory has its own README with a quickstart.
- OpenAI-compatible HTTP contract. Existing OpenAI SDKs work with no
code changes — just swap
base_url. Routes:/v1/chat/completions,/v1/images/generations,/v1/videos/generations,/v1/audio/speech,/v1/audio/transcriptions,/v1/embeddings,/v1/models. - Regional provider allowlist is code, not config. The provider gateway enforces a hardcoded allowlist per region. Some upstream providers (Anthropic, OpenAI, Google Vertex, BFL Flux) cannot be served from Chinese-owned infrastructure under their terms of service — the Alicloud region's allowlist is empty for those providers. Fail-closed, not opt-in.
- Single credit ledger, append-only. All balance changes go through
CreditLedger. TheUser.credit_balance_centsfield is a denormalized cache; the source of truth isSUM(delta_cents). - Integer cents everywhere. Money is
longcents at every layer. Pricing internally uses microcents (1 ¢ = 10,000 µ¢) for per-1k-token arithmetic that would otherwise round to zero on cheap models. Conversion to display strings only at the boundary. - Idempotent webhooks. Stripe and Coinbase webhooks dedupe on the upstream event id, surfacing duplicate deliveries as success without double-crediting.
- Reactive end-to-end. WebFlux + Netty. SSE streaming for chat completions. Async generation jobs for image / video.
This is the v0.1 codebase from initial implementation. Not yet deployed to production. The full session-by-session build history is visible in the git log.
Apache License 2.0. Use it, fork it, embed it. Attribution appreciated, not required.
Issues and pull requests welcome. For substantial changes, open a discussion first so we can align on direction before code review.
The regional allowlist (backend/.../AlicloudProviderAllowlist) and the
billing / ledger code are the load-bearing safety surfaces — changes
there need a test in the same PR.