Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Endpoints

This guide documents the public client contract for listing AI models and using text, image, video, and audio generation endpoints.

Base path: /api/v1

Authentication: generation endpoints require either a bearer JWT or an x-api-key header. Model listing endpoints follow the route guard configuration in the controller; check deployed access policy before exposing them to external clients.

Clients should select a user-facing model; the backend resolves the best active provider model automatically.

Validation Notes

The API uses Nest ValidationPipe with whitelist: true and transform: true.

  • Unknown request fields are stripped before the DTO reaches the service.

  • DTO validation failures return 400.

  • Model resolution failures return 400 for generation endpoints when no active provider supports the requested model.

  • Some provider-specific validation happens after DTO validation. For example, unsupported video maxTokens values or unsupported multi-image requests can return 400 even when the DTO shape is valid.

  • Generation parameters are model-scoped, not provider-scoped. A parameter the selected model does not support returns 400 naming the model, for example cameraFixed on a Seedance 2.0 model. Provider identity is never part of the request contract.

  • resolution and ratio are open string tokens. The DTO does not enumerate them, so new model tokens pass DTO validation and are checked by the provider.

  • Image and video requests accept ordered content arrays. Order is preserved and can affect provider behavior, especially first/last-frame video requests.

  • Base64 inputs may be raw base64 or a full data URL. When raw base64 is used, include mediaType.

Endpoint Sections

  1. List AI Models — GET /api/v1/ai/models — Discover available models and their capabilities

  2. Text Completion — POST /api/v1/text/completions — Stream chat-style text completions

  3. Image Generation — POST /api/v1/image/generations — Generate images synchronously or asynchronously

  4. Video Generation — POST /api/v1/video/generations — Generate videos with task-based polling

  5. Seedance 2.0 KYC Flow — KYC asset management for identity-bound video generation

  6. Audio Generation — POST /api/v1/audio/text-to-speech and POST /api/v1/audio/generation-with-reference — Text-to-Speech and reference-conditioned audio generation, both task-based

Last updated

Was this helpful?