Skip to main content
LocoPal AiLocoPal Ai
API Integration

Guide

API Overview

All public APIs, authentication methods, and links to detailed documentation

View Markdown

API Overview

The base URL is always https://locopalai.com, and all APIs use the same platform API key. For shared conventions (authentication, response structure, pagination, rate limiting, idempotency), see Authentication and Common Conventions.

Models and generation APIs

PurposeMethodPathDetails
Query available modelsGET/v1/modelsModels and Text API
Text chat (including streaming)POST/v1/chat/completionsModels and Text API
Image generationPOST/v1/images/generationsImage Generation API
Text-to-speechPOST/v1/audio/speechText-to-Speech API
Create a video taskPOST/v1/video/generationsVideo Generation API
Query a video taskGET/v1/video/generations/{task_id}Video Generation API
Create a video task (OpenAI-compatible form)POST/v1/videosVideo Generation API
Query a video task (OpenAI-compatible form)GET/v1/videos/{task_id}Video Generation API

Asset library APIs

All asset library APIs use the API key and return a uniform success response: { "code": 0, "data": ..., "msg": "..." }.

PurposeMethodPathDetails
Query asset groupsGET/api/v1/materials/groupsAsset Groups
Create an asset group (virtual / real)POST/api/v1/materials/groupsAsset Groups
Query the asset list (supports group_id and pagination)GET/api/v1/materials/assetsAssets
Submit an image asset (image_url or data_url)POST/api/v1/materials/assetsAssets
Query a single asset's statusGET/api/v1/materials/assets/{asset_id}Assets
Sync asset statusPOST/api/v1/materials/syncSync Asset Status
Create a portrait QR code authorization sessionPOST/api/v1/materials/portrait/sessionsPortrait Asset Authorization
Confirm portrait QR code completionPOST/api/v1/materials/portrait/resolvePortrait Asset Authorization

For detailed parameters, examples, and error descriptions, see Asset Library API Overview.

Typical call flows

Models and video

GET  /v1/models
  → POST /v1/video/generations
  → GET  /v1/video/generations/{task_id}

After creating a task, you must save the task ID; if the network is interrupted, keep querying the original task instead of creating a new one.

Text-to-speech

GET  /v1/models
  → POST /v1/audio/speech
  → 保存二进制音频响应

Whether the audio API is available and which voice and response_format values are supported depend on the current key's model catalog and the actual model capabilities.

Virtual assets

POST /api/v1/materials/groups
  → POST /api/v1/materials/assets
  → GET  /api/v1/materials/assets/{asset_id}   (轮询到 status 为 Active)
  → 在视频 content 中使用 asset://<asset_id>

Portrait assets

POST /api/v1/materials/groups {"type":"real"}
  → POST /api/v1/materials/portrait/sessions   (拿到二维码链接)
  → 由真人本人扫码完成采集
  → POST /api/v1/materials/portrait/resolve
  → POST /api/v1/materials/sync
  → 查询素材状态后用于支持真人素材库的模型

For an end-to-end example, see Portrait Assets and Reference Video Integration Workflow; for the capability boundaries of multiple images and reference videos, see Multiple Images and Reference Videos.

Responses and errors

API typeSuccessFailure
Model / image / videoReturns the result object directlyHTTP non-2xx; read error.message
Asset library{ "code": 0, "data": ..., "msg": "OK" }HTTP status code matches code

Clients must check both the HTTP status and the response body. For the complete list of error codes and troubleshooting steps, see Error Codes and Troubleshooting.

Was this page helpful?

On this page