curl --request POST \
--url https://api.example.com/api/generate-flashcards \
--header 'Content-Type: application/json' \
--data '
{
"topic": "<string>",
"content": "<string>",
"numCards": 123
}
'{
"cards": [
{
"front": "<string>",
"back": "<string>"
}
],
"topic": "<string>",
"error": "<string>"
}Generate flashcard sets with front/back pairs based on a topic and optional content
curl --request POST \
--url https://api.example.com/api/generate-flashcards \
--header 'Content-Type: application/json' \
--data '
{
"topic": "<string>",
"content": "<string>",
"numCards": 123
}
'{
"cards": [
{
"front": "<string>",
"back": "<string>"
}
],
"topic": "<string>",
"error": "<string>"
}POST /api/generate-flashcards
curl -X POST https://yourdomain.com/api/generate-flashcards \
-H "Content-Type: application/json" \
-d '{
"topic": "Spanish Vocabulary - Food",
"content": "Common Spanish words for food and dining...",
"numCards": 10
}'
{
"cards": [
{
"front": "What is 'bread' in Spanish?",
"back": "pan"
},
{
"front": "What is 'water' in Spanish?",
"back": "agua"
},
{
"front": "What is 'apple' in Spanish?",
"back": "manzana"
},
{
"front": "What is 'milk' in Spanish?",
"back": "leche"
}
],
"topic": "Spanish Vocabulary - Food"
}
{
"error": "Topic is required"
}
topic field is missing or empty.
{
"error": "Failed to generate flashcards"
}
{
"error": "Failed to parse flashcards"
}
{
"error": "Failed to generate flashcards"
}
mixtral-8x7b-32768 model