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#

FieldTypeRequiredDescription
topicstringYesTopic to generate exercises about (1-200)
levelstringNobeginner, elementary, intermediate, upper_intermediate, advanced
countnumberNoNumber of exercises (1-20)
exercise_typesstring[]NoTypes to generate (see table below)

Exercise Types#

TypeDescription
multiple_choicePick the correct answer from options
fill_blankFill in the missing word
translateTranslate 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