Text-To-Motion
The Generate Contents API lets you submit motion-generation prompts programmatically and retrieve results once they're ready — the same flow used by the MOASIS web chat, exposed for integration into your own application. New to the API? Start with the Quick Start for a minimal end-to-end example.
Authentication
Every request must include an API key with the CHAT scope in the Authorization header:
Authorization: Bearer sk-<your-api-key>See API Key Management for how to create a key. All endpoints below are relative to your MOASIS instance's base URL, e.g. http://mohub-dev.vgentx.com/api/v1.
Overview
Generation is asynchronous:
- Submit a prompt with
POST /chat/generate. This creates a new conversation and immediately returns aconversationId— it does not wait for generation to finish. - The agent works in the background, creating one or more tasks as it processes your prompt, then closes out the turn once it's done responding.
- Retrieve results by polling either:
GET /chat/generate/tasks/:taskIdif you already know the task ID, orGET /chat/generate/conversation/:conversationId/tasksto discover which tasks were created and fetch their results in one call.
Submit a Prompt
POST /chat/generateBody
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Your generation prompt. |
parameters | object | No | Generation parameters (see below). Omit entirely to use the defaults. |
parameters.mode | Motion | Render | No | Generation mode. Defaults to Motion. |
parameters.model | Glide | Rhythm | No | Generation model. Defaults to Glide. |
Example
curl -X POST http://mohub-dev.vgentx.com/api/v1/chat/generate \
-H "Authorization: Bearer sk-<your-api-key>" \
-H "Content-Type: application/json" \
-d '{"message": "Generate a relaxing lo-fi track", "parameters": {"mode": "Motion", "model": "Glide"}}'Response
{
"data": {
"conversationId": "5f0b1e2a-..."
}
}Save the conversationId — you'll need it to poll for results.
Poll a Single Task
GET /chat/generate/tasks/:taskIdReturns the current status of a task. While the task is running, contents is omitted. Once status is COMPLETED, contents is populated with presigned download URLs.
Example
curl http://mohub-dev.vgentx.com/api/v1/chat/generate/tasks/<taskId> \
-H "Authorization: Bearer sk-<your-api-key>"Response while running
{
"data": {
"id": "f3a9...",
"status": "PROCESSING"
}
}Response when completed
{
"data": {
"id": "f3a9...",
"status": "COMPLETED",
"contents": [
{
"id": "c1b2...",
"title": "lo-fi-track-01",
"fileSize": 2048391,
"thumbnailUrl": "https://...",
"metadata": { "duration": 32.5 },
"presignedUrl": "https://..."
}
]
}
}Possible status values: PENDING, PROCESSING, UPLOADING, POLISHING, COMPLETED, FAILED, CANCELLED. On FAILED, check errorMessage for details.
List Tasks from a Conversation
GET /chat/generate/conversation/:conversationId/tasksReturns the tasks created during the most recently completed turn of a conversation — useful right after POST /chat/generate when you don't yet have a taskId to poll directly. Each entry has the same shape as the single-task response above.
Example
curl http://mohub-dev.vgentx.com/api/v1/chat/generate/conversation/<conversationId>/tasks \
-H "Authorization: Bearer sk-<your-api-key>"While the agent is still working on your request:
{
"data": {
"message": "The agent is still processing your request.",
"tasks": []
}
}Once the turn has completed:
{
"data": {
"tasks": [
{ "id": "f3a9...", "status": "COMPLETED", "contents": [ /* ... */ ] }
]
}
}Keep polling this endpoint (e.g. every few seconds) until message is absent and tasks is non-empty, then inspect each task's status as described above.