Generate flashcards
Feed it a chapter, a policy manual or a set of lecture notes, and the flashcard generator API hands back clean question-and-answer pairs sized for spaced repetition. No prompt engineering, no manual card-writing at 11pm before an exam — just structured cards your app can schedule and grade.
Run it online
Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.
Who ends up needing this
Ed-tech teams building a study app, internal-training platforms turning onboarding docs into quizzes, and language-learning products that need vocabulary pairs from a reading passage all hit the same wall: writing good flashcards by hand does not scale past a handful of documents. This endpoint exists for the moment your content library outgrows your team of writers.
What the endpoint actually does
Send the source text to POST /text/flashcards and the task is queued asynchronously — you get a task_id back immediately, and the finished set of cards arrives later by signed webhook or a signed link valid for 24 hours. Each card is a discrete question paired with a concise answer pulled from the meaning of the passage, not a copy-paste of a sentence fragment, so the pair still makes sense outside its original context.
A short note on spaced repetition
Spaced repetition as a study technique traces back to Hermann Ebbinghaus's forgetting-curve research in the 1880s, refined decades later into the card-based systems most people recognize today. The technique only works if the cards themselves are well formed: one idea per card, an unambiguous question, an answer that stands alone. That is the shape this endpoint targets by default.
Where it sits in a pipeline
Because the response is a task_id rather than a blocking answer, the endpoint drops cleanly into batch pipelines: queue flashcards for every chapter of a course overnight, catch each webhook as it lands, and insert the cards straight into your review-scheduling database. Nothing here depends on a live connection sitting open while generation happens.
What to expect on quality and limits
Longer source text naturally yields more cards and a proportionally longer wait in the queue; very short snippets may only support one or two meaningful questions, and the response reflects that rather than padding the set with filler. There is no free tier — every call requires prepaid balance, and requests without one return HTTP 402, which keeps the queue fast and free of throwaway abuse traffic. A task that fails after three retries returns a clear error and is never billed, so a batch job never quietly leaves you paying for chapters that did not actually generate cards.
What you can do with it
Course content at scale
An online course platform runs each lesson transcript through the endpoint overnight, populating a review deck for every module before students wake up.
Corporate onboarding
An HR tool converts the employee handbook and compliance policies into flashcards so new hires can self-quiz instead of re-reading a 40-page PDF.
Language learning readers
A reading app extracts vocabulary and comprehension cards from each graded reader, tuned to the difficulty level of the passage.
Certification prep
A study-prep startup turns exam objective documents into practice card sets, refreshed automatically whenever the certification body updates its syllabus.
FAQ
How does the flashcard generator API work?
You send text to POST /text/flashcards, the request is queued asynchronously, and you receive the finished flashcards by signed webhook or a signed link valid for 24 hours.
Is there a free tier for this flashcard generator API?
There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.
How is pricing calculated?
$0.003 per request plus $0.0135 per 1,000 words of source text, billed only on tasks that actually complete.
What happens if a task fails?
The task retries automatically up to three times; if it still fails you get a clear error and are never charged for it.
Can I generate flashcards from very long documents?
Yes — longer text produces more cards and takes proportionally longer in the queue, which is exactly why the endpoint is asynchronous rather than a blocking call.
What format are the cards returned in?
Structured question-and-answer pairs designed to work as standalone spaced-repetition cards, delivered as the task result via webhook or signed link.
Can I generate flashcards in bulk for a whole course?
Yes — queue one request per chapter or lesson; each returns its own task_id so you can process a full course library in parallel.
How long are results kept available?
The signed link stays valid for 24 hours, after which the underlying data is deleted and never used for training.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/text/flashcards \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"…"}'const res = await fetch("https://api.kit.forhosting.com/text/flashcards", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "…"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/text/flashcards",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "…"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/text/flashcards", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"…"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"…"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/text/flashcards", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "…"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "text.flashcards",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_tokens | 20000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
422 | task_failed | The task failed after 3 retries. You are never charged for it. |