2Slides Logo
2Slides API के साथ 100 Vocabulary Decks Batch-Generate कैसे करें (2026 Content Factory Playbook)
2Slides Team
16 min read

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-slides
(या reference layout है तो
create-like-this
) इस्तेमाल करें।
/api/v1/slides/generate
का इस्तेमाल न करें — यह Fast PPT endpoint है और आप इसमें narration नहीं जोड़ सकते।

अगर आपकी factory को सिर्फ़ silent PPTX (कोई audio नहीं, कोई video नहीं) चाहिए, तो

/api/v1/slides/generate
के ज़रिए Fast PPT सबसे सस्ता रास्ता है। बाकी playbook narrated वर्कफ़्लो मानता है।

एक 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 है, जिसे आप

ffmpeg
के साथ server-side compose कर सकते हैं अगर factory में MP4 चाहिए।

Step 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
    और
    create-like-this
    : अपनी queue उनकी concurrency limits के आसपास design करें, 429 पर exponential backoff के साथ
  • jobs/{id}
    (poll): नीचे की polling cadence respect करें — 20–30s, aggressive नहीं
  • download-slides-pages-voices
    : मुफ़्त और तेज़, लेकिन फिर भी rate-limited

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 में

jobId
(UUID) होता है। Completion के लिए poll करें:

curl -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"
, job के पास R2 पर stored slide images और PDF compilation के लिए
downloadUrl
होता है। Slide images खुद वही हैं जिन्हें आप बाद में audio के साथ combine करेंगे।

Step 4 — Scale पर टिकने वाले prompt templates बनाएं

एक flaky factory और reliable factory के बीच सबसे बड़ा अंतर prompt templates है। Per deck runtime पर prompts न लिखें। Per deck type एक template define करें और values substitute करें।

Vocabulary deck template (

userInput
):

Generate 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

designStyle
parameter (custom prompt) से control होती है या default पर छोड़ दी जाती है ("clean infographic, no photographs, balanced typography")। Prompts को git में versioned रखें। जब prompt बदले, हर generated deck के साथ version log करें ताकि आप quality regressions को prompt changes से correlate कर सकें।

Step 5 — Narration जोड़ें

जब generation job

status: "success"
हो, narration kick off करें। Narration केवल async है और उसी
jobId
पर operate करती है:

curl -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}
को तब तक poll करें जब तक message "Voice narration generation in progress" से success state में transition न हो।

Vocabulary cards के लिए दो voice patterns अच्छा काम करते हैं:

  • mode: "single"
    एक voice के साथ — सीधा शब्द + IPA + sentence reading
  • mode: "multi"
    दो voices के साथ — example sentences speakers के बीच split, verbs और idioms के लिए ideal

Voice catalog

/tts_sample_voices/
पर publish है। Common picks में
Puck
,
Aoede
,
Charon
,
Kore
शामिल हैं। Production में specific voice pin करने से पहले latest API docs से support confirm करें।

ज़रूरी: यह 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 में एक

downloadUrl
(1 घंटे के लिए valid) होता है एक ZIP के लिए जिसमें यह होता है:

pages/ 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
के साथ server-side MP4 compose करें:

# हर पेज के लिए, (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"
vs
"16:9"
)। बाद में FFmpeg cropping अक्सर बदसूरत results पैदा करती है क्योंकि स्लाइड्स specific aspect के लिए laid out थीं।

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 के
    downloadUrl
    से) को weekly issue में download link के तौर पर embed करें
  • 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
पर idempotent होनी चाहिए। अगर आपका worker mid-batch crash हो जाए, queue को restart करना duplicate decks produce न करे। सबसे साफ़ pattern: database row में
(deck_id, status)
store करें; states transition करें (
pending → generating → narrating → exporting → composed → distributed
)।

Quality gates

Auto-distribute न करें। TikTok या Canvas पर push करने से पहले, artifact पर एक machine-readable quality check चलाएं:

  • Page count requested count से match करता है
  • ZIP में expected number के
    pages/page_NN.png
    और
    voices/page_NN.wav
    files हैं
  • Per page audio duration 3 और 15 सेकंड के बीच है (30-second card लगभग हमेशा hallucinated long script का मतलब है)
  • transcript.txt
    non-empty है और target words contain करता है

पहले 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-preview
vs
gemini-3.1-flash-image-preview
), narration voice, generation timestamp। जब model improve हो या prompt बदले, सिर्फ़ affected decks दोबारा run कर सकते हैं।

Cost 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_human
queue पर push करें। Infinitely loop न करें।

Build 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 क्यों नहीं जोड़ सकता?

generate
endpoint Fast PPT है — template-driven PPTX। इसका output finalized .pptx file है, slide-image-plus-text job नहीं जिसे narration generator पढ़ सके। Narration generator स्पष्ट रूप से सिर्फ़
create-pdf-slides
या
create-like-this
से jobs accept करता है, जो structured per-page content के साथ nano banana slide jobs produce करते हैं।

क्या मैं API से सीधे MP4 export कर सकता हूं?

नहीं, 2026 तक। MP4 export client-side FFmpeg.wasm के साथ implemented एक Workspace UI feature है। API equivalent

download-slides-pages-voices
है जो slide images, audio files और transcript का ZIP returns करता है — आप
ffmpeg
के साथ खुद MP4 compose करते हैं अगर content factory pipeline में चाहिए। Step 7 देखें।

Generation के लिए API कौन-सी भाषाएं support करता है?

22+ भाषाएं जिनमें Spanish, French, German, Arabic, Japanese, Korean, Hindi, Vietnamese, Russian, Polish, Italian, Portuguese, Indonesian, Thai, Turkish, और Chinese (Simplified/Traditional) शामिल हैं।

responseLanguage
के ज़रिए pass करें।

Credit 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}
को हर 20 सेकंड से तेज़ poll न करें — यह 429 का सबसे common कारण है।

क्या मैं 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"
के साथ। Slides generation time पर per aspect ratio laid out होती हैं, तो post-hoc cropping शायद ही अच्छी दिखती है। हां, इसका मतलब credit cost double करना है; clean visuals के लिए वह deliberate tradeoff है।

निष्कर्ष

एक content factory structured source data + एक stable orchestrator + सही API endpoints है। 2Slides API तीसरा हिस्सा है; पहले दो के लिए आप ज़िम्मेदार हैं। Single most common factory failure

/api/v1/slides/generate
(Fast PPT) इस्तेमाल करना और फिर उसे narrate करने की कोशिश करना है — वह रास्ता बंद है। इसके बजाय
create-pdf-slides
या
create-like-this
इस्तेमाल करें,
generate-narration
के साथ narrate करें,
download-slides-pages-voices
के साथ export करें, और
ffmpeg
के साथ server-side MP4 compose करें।

उसी वर्कफ़्लो के 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