Open-ended texts
This endpoint generates open-ended texts based on your videos, including but not limited to tables of content, action items, memos, and detailed analyses.
Notes
- This endpoint is rate-limited. For details, see the Rate limits page.
- This endpoint supports streaming responses. For details on integrating this feature into your application, refer to the Streaming response guide.
Headers
Request
The unique identifier of the video for which you wish to generate a text.
A prompt that guides the model on the desired format or content.
Notes
- Even though the model behind this endpoint is trained to a high degree of accuracy, the preciseness of the generated text may vary based on the nature and quality of the video and the clarity of the prompt.
- Your prompts can be instructive or descriptive, or you can also phrase them as questions.
- The maximum length of a prompt is 375 tokens.
Examples:
- Based on this video, I want to generate five keywords for SEO (Search Engine Optimization).
- I want to generate a description for my video with the following format: Title of the video, followed by a summary in 2-3 sentences, highlighting the main topic, key events, and concluding remarks.
Controls the randomness of the text output generated by the model. A higher value generates more creative text, while a lower value produces more deterministic text output.
Default: 0.2 Min: 0 Max: 1
Set this parameter to true
to enable streaming responses in the NDJSON format.
Default: false
Response
The specified video has successfully been processed.
When the value of the stream
parameter is set to false
, the response is as follows:
When the value of the stream
parameter is set to true
, the platform provides a streaming response in the NDJSON format.
The stream contains three types of events:
- Stream start
- Text generation
- Stream end
To integrate the response into your application, follow the guidelines below:
- Parse each line of the response as a separate JSON object.
- Check the
event_type
field to determine how to handle the event. - For
text_generation
events, process thetext
field as it arrives. Depending on your application’s requirements, this may involve displaying the text incrementally, storing it for later use, or performing any tasks. - Use the
stream_start
andstream_end
events to manage the lifecycle of your streaming session.