AI Features Overview
Engagement portraits powered by Kie.ai, with legacy Volcano Engine demos.
Overview
The production portrait flow uses Kie.ai GPT Image 2. The bundled chat and video demos retain their original Volcano Engine integrations:
| Feature | Model | Endpoint |
|---|---|---|
| Chat demo | doubao-1-5-thinking-pro-250415 | /api/chat/stream |
| Engagement portraits | gpt-image-2-image-to-image | /api/image/generate |
| Video demo | doubao-seedance-1-0-pro-250528 | /api/video/generate |
Configuration
Production portrait generation requires Kie.ai:
IMAGE_PROVIDER="kie"
KIE_API_KEY="your-kie-api-key"
KIE_IMAGE_MODEL="gpt-image-2-image-to-image"The legacy chat and video demos require Volcano Engine:
VOLCANO_ENGINE_API_KEY="your-api-key"
VOLCANO_ENGINE_API_URL="https://ark.cn-beijing.volces.com/api/v3"Architecture
Provider wrappers are split by product ownership:
lib/image-providers/ # Production engagement image providers
lib/volcano-engine/ # Legacy chat, image, and video demo wrappersCredit Integration
Every AI operation follows the deduct-first, refund-on-failure pattern:
- Check if user has enough credits
- Deduct credits from balance
- Call AI API
- If API fails, refund credits automatically
Replacing the AI Provider
To switch the production image provider:
- Add or replace the adapter in
lib/image-providers/ - Update environment variables
- Adjust model configuration
- Keep the same credit deduction pattern