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
400for generation endpoints when no active provider supports the requestedmodel.Some provider-specific validation happens after DTO validation. For example, unsupported video
maxTokensvalues or unsupported multi-image requests can return400even when the DTO shape is valid.Generation parameters are model-scoped, not provider-scoped. A parameter the selected
modeldoes not support returns400naming the model, for examplecameraFixedon a Seedance 2.0 model. Provider identity is never part of the request contract.resolutionandratioare 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
contentarrays. 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
List AI Models —
GET /api/v1/ai/models— Discover available models and their capabilitiesText Completion —
POST /api/v1/text/completions— Stream chat-style text completionsImage Generation —
POST /api/v1/image/generations— Generate images synchronously or asynchronouslyVideo Generation —
POST /api/v1/video/generations— Generate videos with task-based pollingSeedance 2.0 KYC Flow — KYC asset management for identity-bound video generation
Audio Generation —
POST /api/v1/audio/text-to-speechandPOST /api/v1/audio/generation-with-reference— Text-to-Speech and reference-conditioned audio generation, both task-based
Last updated
Was this helpful?