Jimeng video generation
POST
/jimeng/
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.mirapi.ai/jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31"
payload := strings.NewReader("{ \"req_key\": \"jimeng_video_generation\", \"prompt\": \"A cat playing the piano\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.mirapi.ai/jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"req_key":"jimeng_video_generation","prompt":"A cat playing the piano"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://api.mirapi.ai/jimeng/?Action=CVSync2AsyncSubmitTask&Version=2022-08-31' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "req_key": "jimeng_video_generation", "prompt": "A cat playing the piano" }'Video generation endpoint in the native Jimeng API format.
The Action parameter selects the operation:
CVSync2AsyncSubmitTask: submit a video generation taskCVSync2AsyncGetResult: fetch the task result
Action and Version must both be passed as query parameters.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Action
required
string
API action
Version
required
string
API version
Example
2022-08-31Request Body
Section titled “Request Body”Media typeapplication/json
Native Jimeng API request format
object
req_key
Request type identifier
string
prompt
Text description
string
binary_data_base64
Base64-encoded image data
Array<string>
Example
{ "req_key": "jimeng_video_generation", "prompt": "A cat playing the piano"}Responses
Section titled “Responses”Request processed
Media typeapplication/json
object
code
Response code
integer
message
Response message
string
data
Response data
object
Examplegenerated
{ "code": 1, "message": "example", "data": {}}Invalid request parameters
Media typeapplication/json
object
error
object
message
Error message
string
type
Error type
string
param
Related parameter
string
code
Error code
string
Examplegenerated
{ "error": { "message": "example", "type": "example", "param": "example", "code": "example" }}