Exercise Generation
Generate AI-powered exercises on any Korean language topic.
2 min read
The exercise generation endpoint uses AI to create custom practice exercises on any topic. It supports multiple exercise types and difficulty levels.
Generate Exercises#
bash
curl -X POST https://api.chamelingo.com/api/v1/exercises/generate \
-H "Authorization: Bearer ck_live_YOUR_KEY_HERE" \
-H "Content-Type: application/json" \
-d '{
"topic": "ordering food at a restaurant",
"level": "beginner",
"count": 5,
"exercise_types": ["multiple_choice", "fill_blank"]
}'
Request Parameters#
| Field | Type | Required | Description |
|---|---|---|---|
topic | string | Yes | Topic to generate exercises about (1-200) |
level | string | No | beginner, elementary, intermediate, upper_intermediate, advanced |
count | number | No | Number of exercises (1-20) |
exercise_types | string[] | No | Types to generate (see table below) |
Exercise Types#
| Type | Description |
|---|---|
multiple_choice | Pick the correct answer from options |
fill_blank | Fill in the missing word |
translate | Translate between Korean and English |
Response#
JSON
{
"lesson_id": "lesson_abc...",
"generated": 5,
"exercises": [
{
"id": "ex_123",
"exercise_type": "multiple_choice",
"prompt_korean": "이것은 뭐에요?",
"prompt_english": "What is this?",
"answers": ["비빔밥"],
"distractors": ["냉면", "김치", "떡볶이"],
"explanation": "비빔밥 (bibimbap) means mixed rice...",
"difficulty": 1
}
]
}
Rate Limits#
Exercise generation is rate limited to 5 requests per 5 minutes per user because each request triggers an AI generation.
Tip
Generate exercises in batches (up to 20 per request) to make the most of each rate limit window.
Use Cases#
- Adaptive practice: Generate exercises for topics where the user is struggling (combine with
/progress/vocabulary/difficult) - Custom lessons: Let users request practice on any topic they choose
- Assessment: Generate exercises to test knowledge after a study session