

2Slides API के साथ 100 Vocabulary Decks Batch-Generate कैसे करें (2026 Content Factory Playbook)
जब आप manual वर्कफ़्लो validate कर लेते हैं — एक vocabulary deck जनरेट करें, narrate करें, assets एक्सपोर्ट करें — अगली रुकावट volume है। 12 levels और 30 weekly themes वाले एक language school को साल में 360 decks चाहिए। Daily post करने वाले faceless TikTok channel को 365 decks plus variant aspect ratios चाहिए। एक EdTech कंपनी की content team को L1/L2 pairs से segmented सैकड़ों decks चाहिए।
आप 360 decks हाथ से नहीं बनाते। आप एक content factory बनाते हैं।
यह गाइड 2Slides API के साथ vocabulary decks (और कोई भी अन्य slide content) batch-generate करने के लिए practical 2026 playbook है। सबसे ज़रूरी architectural निर्णय — और जिसे सबसे ज़्यादा गलत किया जाता है — सही generation endpoint चुनना है।
पहले सही endpoint चुनें (यहां ज़्यादातर factories टूटती हैं)
2Slides API पर दो अलग generation flows expose करता है। उनमें से सिर्फ़ एक ऐसे decks बनाता है जिन्हें बाद में narrate किया जा सकता है।
| Endpoint | क्या बनाता है | Narration संभव? | Credits |
|---|---|---|---|
POST /api/v1/slides/generate | Fast PPT — template-driven PPTX। Templates library से एक themeId | ❌ नहीं। Narration endpoint यहां बने jobs को स्पष्ट रूप से reject करता है। | 10 / पेज |
POST /api/v1/slides/create-pdf-slides | Nano Banana — text prompt से image-generated स्लाइड्स। Workspace के समान engine। | ✅ हां | 10 (planning) + 100 / स्लाइड (1K/2K) या 200 / स्लाइड (4K) |
POST /api/v1/slides/create-like-this | Nano Banana — reference image से मेल खाती image-generated स्लाइड्स। | ✅ हां | वही जो ऊपर |
Narration और exportable audio वाली vocabulary-card content factory के लिए, create-pdf-slidescreate-like-this
/api/v1/slides/generateअगर आपकी factory को सिर्फ़ silent PPTX (कोई audio नहीं, कोई video नहीं) चाहिए, तो
/api/v1/slides/generateएक diagram में architecture
[Source data] [Orchestrator] [2Slides API] [Outputs] │ │ │ │ vocabulary ──prompt──▶ Job queue ──POST──▶ /api/v1/slides/create-pdf-slides ──▶ jobId (UUID) spreadsheet (Cron/script) │ │ │ │ │ │ Poll ──GET──▶ /api/v1/jobs/{jobId} ◀─────────────────────────────┘ every 20-30s status: success │ │ ▼ │ [pages slides PNG · downloadUrl PDF] │ ▶ POST /api/v1/slides/generate-narration │ (jobId, voice, mode, etc.) — async only │ Poll ──GET──▶ /api/v1/jobs/{jobId} message: "Voice narration generation in progress" → success │ ▶ POST /api/v1/slides/download-slides-pages-voices │ (free; returns ZIP) ▼ pages/*.png + voices/*.{wav,mp3} + transcript.txt │ ▼ (Optional) compose MP4 client-side with FFmpeg, or use the Workspace UI │ ▼ [LMS / TikTok / newsletter / S3]
Source data → orchestrator → API → pages + voices का ZIP → distribution। MP4 composition वैकल्पिक है और 2026 तक public API endpoint नहीं है — यह browser में FFmpeg.wasm का इस्तेमाल करने वाला Workspace UI feature है। API equivalent pages-and-voices ZIP है, जिसे आप
ffmpegStep 1 — पहले source schema design करें
सबसे ज़्यादा high-leverage move किसी भी API call से पहले source data schema define करना है। साफ़ schema से बने decks reproducible हैं; ad-hoc prompts से बने decks नहीं।
Scale करने वाला vocabulary-deck source row:
deck_id: vocab-b1-travel-2026-w14 source_l1: en # learner की मातृभाषा target_l2: es # सीखी जा रही भाषा cefr_level: B1 theme: travel words: - { word: "boarding pass", ipa: "/ˈbɔːrdɪŋ pæs/", pos: noun, l1: "tarjeta de embarque" } - { word: "layover", ipa: "/ˈleɪoʊvər/", pos: noun, l1: "escala" } - { word: "to delay", ipa: "/dɪˈleɪ/", pos: verb, l1: "retrasar" } # ... 27 more generation: endpoint: create-pdf-slides aspect_ratio: "9:16" # शॉर्ट-फ़ॉर्म review के लिए vertical resolution: "2K" page_count: 30 content_detail: "concise" narration: enabled: true voice: "Puck" # catalog के लिए /tts_sample_voices देखें mode: "single" distribution: social: [tiktok, reels, shorts] newsletter: monday-2026-w14
वह object work की unit है। बाकी सब कुछ इसे consume करता है।
जो आपके पास पहले से है उसी में source schema बनाएं: non-technical teams के लिए Google Sheet, engineering teams के लिए Postgres table, content teams के लिए structured fields वाला CMS। इसे plain Markdown files में बनाने से बचें — Markdown human writing के लिए ठीक है लेकिन batch automation के लिए खराब।
Step 2 — Authenticate
API management page से एक API key लें। Format है:
sk-2slides-{64-character-hex-string}
सभी requests bearer auth इस्तेमाल करते हैं:
Authorization: Bearer sk-2slides-...
Per-endpoint rate limits 2slides.com/api.md पर documented हैं। Batch production के लिए:
- और
create-pdf-slides: अपनी queue उनकी concurrency limits के आसपास design करें, 429 पर exponential backoff के साथcreate-like-this - (poll): नीचे की polling cadence respect करें — 20–30s, aggressive नहीं
jobs/{id} - : मुफ़्त और तेज़, लेकिन फिर भी rate-limited
download-slides-pages-voices
Step 3 — Nano Banana generation job submit करें
Vocabulary cards async mode में सबसे अच्छे काम करते हैं (30-card deck के लिए per-slide image generation 1–3 मिनट लेती है)।
curl -X POST "https://2slides.com/api/v1/slides/create-pdf-slides" \ -H "Authorization: Bearer sk-2slides-..." \ -H "Content-Type: application/json" \ -d '{ "userInput": "<your deck-shaped prompt — see Step 4>", "responseLanguage": "en", "aspectRatio": "9:16", "resolution": "2K", "page": 30, "contentDetail": "concise", "mode": "async" }'
Response में
jobIdcurl -X GET "https://2slides.com/api/v1/jobs/{jobId}" \ -H "Authorization: Bearer sk-2slides-..."
Polling cadence: हर 20–30 सेकंड। ज़्यादा तेज़ poll न करें — API documentation स्पष्ट रूप से कहता है, और aggressive polling 429s का सबसे common cause है। ज़्यादातर decks 1–3 मिनट में पूरे होते हैं।
जब
status: "success"downloadUrlStep 4 — Scale पर टिकने वाले prompt templates बनाएं
एक flaky factory और reliable factory के बीच सबसे बड़ा अंतर prompt templates है। Per deck runtime पर prompts न लिखें। Per deck type एक template define करें और values substitute करें।
Vocabulary deck template (
userInputGenerate a {{cefr_level}}-level vocabulary deck for {{source_l1}}-speaking learners of {{target_l2}}. Theme: {{theme}}. Number of cards: {{word_count}}. For each card, output exactly: - Target word (in {{target_l2}}) - Part of speech - IPA transcription - Translation in {{source_l1}} - Two example sentences in natural {{theme}} context, B1 syntax, 8–14 words each Words to include: {{word_list_yaml}} End with a 3-card recap of the most useful 3 words from the deck.
Visual style
designStyleStep 5 — Narration जोड़ें
जब generation job
status: "success"jobIdcurl -X POST "https://2slides.com/api/v1/slides/generate-narration" \ -H "Authorization: Bearer sk-2slides-..." \ -H "Content-Type: application/json" \ -d '{ "jobId": "550e8400-e29b-41d4-a716-446655440000", "mode": "single", "voice": "Puck", "speakerName": "Vocabulary Coach", "contentMode": "concise", "includeIntro": true }'
फिर उसी
/api/v1/jobs/{jobId}Vocabulary cards के लिए दो voice patterns अच्छा काम करते हैं:
- एक voice के साथ — सीधा शब्द + IPA + sentence reading
mode: "single" - दो voices के साथ — example sentences speakers के बीच split, verbs और idioms के लिए ideal
mode: "multi"
Voice catalog
/tts_sample_voices/PuckAoedeCharonKoreज़रूरी: यह single endpoint voice text और voice audio दोनों जनरेट करता है। अलग "voice text" और "voice audio" endpoints call न करें — उन steps के लिए independently कोई public API नहीं है। Narration request एक बार configure करें और API दोनों करता है।
Step 6 — Pages और voices एक्सपोर्ट करें (मुफ़्त)
Narration पूरी होने पर, सभी assets एक ही ZIP में retrieve करें:
curl -X POST "https://2slides.com/api/v1/slides/download-slides-pages-voices" \ -H "Authorization: Bearer sk-2slides-..." \ -H "Content-Type: application/json" \ -d '{ "jobId": "550e8400-e29b-41d4-a716-446655440000" }'
Response में एक
downloadUrlpages/ page_01.png page_02.png ... voices/ page_01.wav page_02.wav ... transcript.txt
यह export मुफ़्त है — कोई credits consume नहीं। ZIP download करें और assets अपने object store में store करें। Presigned URL 1 घंटे बाद expire हो जाता है।
Step 7 — (वैकल्पिक) Server-side MP4 compose करें
2Slides API वर्तमान में MP4 composition endpoint expose नहीं करता — MP4 generation Workspace UI में browser में FFmpeg.wasm के ज़रिए रहती है। Content factory के लिए,
ffmpeg# हर पेज के लिए, (image still) + (voice audio) का clip बनाएं। ffmpeg -loop 1 -i pages/page_01.png -i voices/page_01.wav \ -c:v libx264 -tune stillimage -c:a aac -b:a 192k \ -pix_fmt yuv420p -shortest clips/page_01.mp4 # सभी per-page clips को final MP4 में concatenate करें। ffmpeg -f concat -safe 0 -i clip_list.txt -c copy final.mp4
Per page audio cadence जो भी narration generator ने produce किया वही है — vocabulary cards के लिए आम तौर पर 5–12 सेकंड per slide। Result वही MP4 है जो user Workspace UI से download करता, लेकिन आपकी factory pipeline में headlessly produce किया गया।
अगर आप same deck के vertical (9:16) और horizontal (16:9) variants चाहते हैं, सबसे साफ़ रास्ता slide-generation stage पर deck को दो बार generate करना है अलग aspect ratios पर (
aspectRatio: "9:16""16:9"Step 8 — Orchestrator बनाएं
एक minimal orchestrator पांच loops संभालता है:
# Pseudocode while there_is_work(): deck = pull_one_pending_deck_from_source() if not deck: sleep(60); continue # 1. Nano Banana endpoint के ज़रिए slides जनरेट करें job = post("/api/v1/slides/create-pdf-slides", body=build_payload(deck)) deck_artifact = poll_until_complete(job.data.jobId) # 2. Narrate (only async) if deck.narration.enabled: post("/api/v1/slides/generate-narration", body={ "jobId": deck_artifact.id, "voice": deck.narration.voice, "mode": deck.narration.mode, }) poll_until_narration_complete(deck_artifact.id) # 3. Pages + voices ZIP एक्सपोर्ट करें (मुफ़्त) zip_url = post("/api/v1/slides/download-slides-pages-voices", body={"jobId": deck_artifact.id}) # 4. assets download करें और अपने object store में store करें download_to_s3(zip_url, deck.id) # 5. (वैकल्पिक) ffmpeg के साथ MP4 compose करें, फिर distribute करें if deck.distribution.social: compose_mp4(deck.id) distribute(deck)
इसे queue के साथ एक worker box पर चलाएं। Per day 100 decks के लिए, एक worker काफ़ी है। 1,000+ के लिए, छोटे worker pool पर fan out करें — लेकिन सुनिश्चित करें कि pool हर API endpoint के rate limits respect करे, सिर्फ़ worker count नहीं।
Step 9 — Distribution patterns
Distribution layer artifacts को business value में बदलती है:
- LMS: composed MP4 को Canvas / Moodle / Blackboard / Google Classroom पर उनके respective APIs के ज़रिए upload करें
- TikTok / Reels / Shorts: 9:16 MP4 को posting tool (Buffer, Later, native scheduler) पर queue करें, per day एक
- Newsletter: PDF compilation (original generation job के से) को weekly issue में download link के तौर पर embed करें
downloadUrl - Sales / lead magnet: Stan Store / Gumroad page पर PDF upload करें; carousel teaser traffic drive करता है
Distribution invent करने की कोशिश न करें। Platform-native APIs इस्तेमाल करें और orchestrator को scheduler में row drop करने दें।
Cost गणित (पहले plan करने वाला हिस्सा)
Narration के साथ Nano Banana decks के लिए, credits Fast PPT pricing से तेज़ी से जुड़ते हैं जो कुछ readers ने पहले देखी होगी। 30-card deck (1K/2K resolution, narration के साथ) के लिए गणित:
- Planning: 10 credits
- Slide generation: 30 × 100 = 3,000 credits
- Narration (text + audio): 30 × 210 = 6,300 credits
- Pages + voices export: 0 credits (मुफ़्त)
- Total: per narrated 30-card deck ~9,310 credits
Narration के बिना, वही deck ~3,010 credits है। 4K resolution पर, slide-generation हिस्सा double: 30 × 200 = 6,000 → narration के साथ ~12,310 credits।
100-deck/महीना factory के लिए: 100 × 9,310 = ~931,000 credits/महीना। Tier चुनने के लिए pricing page से तुलना करें — और 4K का budget तब रखें जब output ऐसे context में जा रहा हो जो उससे benefit उठाए (बड़ी screens, premium video)। TikTok / Reels review videos के लिए, 1K या 2K काफ़ी है।
आग रोकने वाले operational patterns
Idempotency
हर deck submission
deck_id(deck_id, status)pending → generating → narrating → exporting → composed → distributedQuality gates
Auto-distribute न करें। TikTok या Canvas पर push करने से पहले, artifact पर एक machine-readable quality check चलाएं:
- Page count requested count से match करता है
- ZIP में expected number के और
pages/page_NN.pngfiles हैंvoices/page_NN.wav - Per page audio duration 3 और 15 सेकंड के बीच है (30-second card लगभग हमेशा hallucinated long script का मतलब है)
- non-empty है और target words contain करता है
transcript.txt
पहले 50 batches के लिए, 10 में 1 deck का manual spot check भी करें। पहले 50 batches में systemic prompt issues surface होते हैं।
Versioning
हर artifact store करता है: prompt template version, image model version (
gemini-3-pro-image-previewgemini-3.1-flash-image-previewCost telemetry
हर deck की एक known credit cost है (ऊपर math देखें)। Per deck consumed credits track करें। जब per deck credit usage unexpectedly double हो, कुछ बदला है (page count drift, retries, 4K पर switch)। Credit bill आपको चौंकाने से पहले उसे ढूंढें।
Failure handling
A failed job normal है — network blip, model load, rare 5xx। Backoff के बाद एक बार retry करें। दो failures के बाद, deck को
needs_humanBuild vs buy: कब API ही इस्तेमाल करें
API सही जवाब है जब:
- आप >10 decks/हफ़्ता produce करते हैं
- आपके पास structured source data है
- आपको narrated MP4s चाहिए जिन्हें आप server-side compose और distribute करेंगे
- आप LMS, scheduler या CMS के साथ integrate करते हैं
- आप prompt versioning के तहत reproducibility चाहते हैं
API overkill है जब:
- आप हफ़्ते में 1 deck produce करते हैं और हर बार visually tune करते हैं
- आप personal study के लिए decks बनाने वाले learner हैं (UI तेज़ है — और Workspace UI आपके लिए MP4 composition भी करती है)
- आप per lesson एक deck बनाने वाले teacher हैं (Create Slides from File या Create Slides Like This इस्तेमाल करें और orchestration skip करें)
अक्सर पूछे जाने वाले सवाल
मुझे API key कहां मिलेगी?
2slides.com/api। Keys API management tab में रहती हैं।
मैं /api/v1/slides/generate job में narration क्यों नहीं जोड़ सकता?
/api/v1/slides/generategeneratecreate-pdf-slidescreate-like-thisक्या मैं API से सीधे MP4 export कर सकता हूं?
नहीं, 2026 तक। MP4 export client-side FFmpeg.wasm के साथ implemented एक Workspace UI feature है। API equivalent
download-slides-pages-voicesffmpegGeneration के लिए API कौन-सी भाषाएं support करता है?
22+ भाषाएं जिनमें Spanish, French, German, Arabic, Japanese, Korean, Hindi, Vietnamese, Russian, Polish, Italian, Portuguese, Indonesian, Thai, Turkish, और Chinese (Simplified/Traditional) शामिल हैं।
responseLanguageCredit cost क्या है?
Nano Banana decks के लिए: slide generation के लिए 10 (planning) + 1K/2K पर 100/slide (या 4K पर 200/slide), plus narration के लिए 210/page (10 text + 200 audio)। Pages + voices export मुफ़्त है। 2K पर 30-card narrated deck ~9,310 credits है। pricing page और ऊपर का cost-math section देखें।
मैं 429 rate limits कैसे संभालूं?
Exponential backoff। 1s से शुरू करें, 60s तक double करें। तीन consecutive 429s के बाद, अपने concurrent worker count को आधा करें।
/api/v1/jobs/{id}क्या मैं Zapier / Make / n8n के साथ integrate कर सकता हूं?
हां — कोई भी tool जो authenticated HTTP requests कर सकता है, 2Slides API drive कर सकता है। n8n खासकर content factories के लिए popular है क्योंकि यह polling और queue patterns को natively handle करता है।
Generated decks को publicly indexed होने से कैसे रोकूं?
API के ज़रिए generated decks default रूप से आपके account के लिए private हैं। Public sharing एक अलग explicit action है।
मैं same deck के vertical (9:16) और horizontal (16:9) versions कैसे जनरेट करूं?
Deck को दो बार generate करें — एक बार
aspectRatio: "9:16"aspectRatio: "16:9"निष्कर्ष
एक content factory structured source data + एक stable orchestrator + सही API endpoints है। 2Slides API तीसरा हिस्सा है; पहले दो के लिए आप ज़िम्मेदार हैं। Single most common factory failure
/api/v1/slides/generatecreate-pdf-slidescreate-like-thisgenerate-narrationdownload-slides-pages-voicesffmpegउसी वर्कफ़्लो के manual side के लिए, vocabulary cards guide और creator workflow guide देखें। वहां के UI patterns वही patterns हैं जिन्हें आप API के साथ automate कर रहे हैं; पहले manual flow समझना API integration को बहुत तेज़ बनाता है।
About 2Slides
Create stunning AI-powered presentations in seconds. Transform your ideas into professional slides with 2slides AI Agent.
Try For Free