Skip to main content
POST
/
collection
/
{collection_id}
/
generate
/
text
Generate text using AI
curl --request POST \
  --url https://api.videodb.io/collection/{collection_id}/generate/text/ \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "prompt": "Summarize the content of this video",
  "video_id": "m-12345",
  "model_name": "gpt-4",
  "max_tokens": 500,
  "temperature": 0.7,
  "callback_url": "https://webhook.example.com/callback"
}
'
{
  "success": true,
  "status": "processing",
  "data": {
    "id": "job-123",
    "output_url": "https://api.videodb.io/async-response/job-123"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.videodb.io/llms.txt

Use this file to discover all available pages before exploring further.

Generate text content using AI language models with different model tiers. Choose between basic, pro, and ultra models, and get results as plain text or JSON.
import videodb

conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()

# Generate plain text
response = coll.generate_text(
    prompt="Write a 30-second commercial script for a coffee brand",
    model_name="pro",
    response_type="text"
)

script = response["output"]
print(script)

# Generate JSON response
response = coll.generate_text(
    prompt="Extract key points from a video summary",
    model_name="pro",
    response_type="json"
)

data = response["output"]
print(data)
  • Model options: basic (default), pro, ultra with increasing complexity and quality
  • Response types: text (plain string) or json (structured object)
  • Returns an object with the generated content in the output field
  • Useful for generating captions, scripts, summaries, and extracted data

Generative Media Guide

Learn about all AI generation capabilities

Text Prompts Tutorial

Master text prompting strategies for generation

Authorizations

x-access-token
string
header
required

API key for authentication (sk-xxx format)

Path Parameters

collection_id
string
required
Example:

"default"

Body

application/json
prompt
string
required
Example:

"Summarize the content of this video"

video_id
string
Example:

"m-12345"

model_name
string
Example:

"gpt-4"

max_tokens
integer
Example:

500

temperature
number
Example:

0.7

callback_url
string
Example:

"https://webhook.example.com/callback"

Response

200 - application/json

Text generation started or completed

success
boolean
Example:

true

status
enum<string>
Available options:
processing,
done,
failed
Example:

"processing"

data
object