API Documentation
Learn how to use the Y2MD API to convert videos to Markdown
Quick Start
1. Get your API Token
Log in to get your API token, or create an API Key in your console:
POST https://api.opensota.ai/auth/email
Content-Type: application/json
{
"email": "your@email.com",
"password": "your-password"
}API Endpoints
POST
/vlm/v1/analyze-videoRequest Body
{
"youtubeUrl": "https://www.youtube.com/watch?v=VIDEO_ID",
"prompt": "Convert this video to markdown...",
"model": "google/gemini-2.5-flash-lite",
"useCache": true
}Response
{
"result": "# Video Title\n\n## Summary\n...",
"model": "google/gemini-2.5-flash-lite",
"cost": 17,
"fromCache": true,
"metadata": {
"title": "Video Title",
"duration": "10:30"
}
}Authentication
JWT Token
For web apps, obtained automatically after login.
Authorization: Bearer eyJhbGciOiJIUzI1NiI...API Key
For scripts and backend integrations, create in console.
Authorization: Bearer os_ak_YOUR_API_KEYCode Examples
JavaScript / TypeScript
const response = await fetch('https://api.opensota.ai/vlm/v1/analyze-video', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
},
body: JSON.stringify({
youtubeUrl: 'https://www.youtube.com/watch?v=VIDEO_ID',
prompt: 'Convert this video to markdown',
model: 'google/gemini-2.5-flash-lite'
})
});
const data = await response.json();
console.log(data.result);Python
import requests
response = requests.post(
'https://api.opensota.ai/vlm/v1/analyze-video',
headers={
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
},
json={
'youtubeUrl': 'https://www.youtube.com/watch?v=VIDEO_ID',
'prompt': 'Convert this video to markdown',
'model': 'google/gemini-2.5-flash-lite'
}
)
data = response.json()
print(data['result'])cURL
curl -X POST 'https://api.opensota.ai/vlm/v1/analyze-video' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{
"youtubeUrl": "https://www.youtube.com/watch?v=VIDEO_ID",
"prompt": "Convert this video to markdown",
"model": "google/gemini-2.5-flash-lite"
}'