수업 계획 만들기
API 버전 2026-10-affable-towhee
post https://api.getlingara.com/v1/lesson-plans
수업 계획 생성을 시작하고 진행 상황을 스트리밍합니다. started는 계획이 생기는 즉시 그 계획을 알려 주므로, 연결이 끊겨도 GET /v1/lesson-plans/{id}/stream으로 다시 연결할 수 있습니다. 스트림은 result 또는 error로 끝납니다. 라이브러리에서 제공되는 계획은 result 하나로만 도착합니다.
스코프 lesson_plans:write
매개변수
Lingara-Versionheaderstring선택- 이 요청에 응답할 API 버전입니다. 지정하지 않으면 액세스 토큰은 해당 클라이언트에 고정된 버전을, 토큰이 없는 요청은 현재 버전을 받습니다. 개발 중인 버전은 여기에서 지정해야만 사용할 수 있습니다. 알 수 없는 버전에는 코드
api_version_unknown과 함께400으로 응답합니다.GET /v1/versions에서 버전 목록을 확인할 수 있습니다.
요청 본문 application/json
contextstring필수source_langstring필수target_langstring필수levelinteger필수
응답
200 계획의 진행 상황, 그다음 계획
스트림 이벤트 text/event-stream
15초마다 keepalive 주석을 보냅니다.
-
startedPlanStarted -
plan_idstring필수
-
phasePlanPhase -
phasestring필수attemptinteger필수
-
resultPlanResult 스트림 종료 -
planLessonPlan필수idstring필수statusPlanStatus필수titlestring | null선택source_langstring필수target_langstring필수levelinteger필수created_atstring필수completed_atstring | null선택ai_generatedboolean필수contentLessonPlanContent | null선택introductionstring | null선택learning_objectivesarray of string필수vocabularyarray of PlanWord필수wordstring필수pronunciationstring | null선택translationstring필수
setsarray of PlanSet필수numberinteger필수contextstring | null선택questionsarray of PlanQuestion필수typestring필수promptstring필수optionsarray of string | null선택answerstring필수explanationstring필수hintstring | null선택
-
errorStreamError 스트림 종료 -
200 응답 안에서 도착합니다. 상태 줄이 이미 전송되었으므로 스트림이 열린 뒤의 실패는 이 이벤트로 보고됩니다.
codestring필수messagestring필수plan_idstring | null선택
오류
402application/json- 사용량 기반 과금 클라이언트의 호출이 아무것도 소모하기 전에 거부되었습니다.
spend_cap_reached: 클라이언트 또는 그 계정이 월 지출 한도에 도달했습니다. 연동 페이지에서 한도를 올리세요.metered_billing_inactive: 이 계정에서 사용량 기반 과금이 활성화되어 있지 않습니다. 연동 페이지에서 설정하거나 결제 수단을 업데이트하세요. 410application/json- 이 요청에 응답하는 API 버전은 지원이 종료되었습니다.
Lingara-Version에 지원되는 버전을 보내거나 클라이언트를 다른 버전에 다시 고정하세요. 4XXapplication/json- 요청이 거부되었습니다.
code는 이유를,error는 이를 문장으로 알려 줍니다. 503application/json · text/plain- 서비스를 일시적으로 사용할 수 없습니다.
Retry-After에 있는 초만큼 기다린 후 다시 시도하세요. 점검 중에는 본문이 오류 엔벨로프가 아닌 일반 텍스트입니다. 5XXapplication/json- 요청이 거부되었습니다.
code는 이유를,error는 이를 문장으로 알려 줍니다.
codestring필수요청이 거부된 이유를 분기에 쓸 수 있는 안정적인 코드로 나타냅니다. 예:
insufficient_scope(403),rate_limited(429), 사용량 기반 과금 클라이언트의 경우spend_cap_reached(402)와metered_billing_inactive(402).errorstring필수
예시
라이브러리가 더 편하신가요? 라이브러리 섹션을 보세요.
스트림 예시
event: started
data: {"plan_id":"3f1c2a9e-5b7d-4e21-9a0c-6d8e4f2b1a37"}
event: phase
data: {"phase":"selecting_vocabulary","attempt":1}
event: result
data: {"plan":{"id":"3f1c2a9e-5b7d-4e21-9a0c-6d8e4f2b1a37","status":"complete","title":"At the night market","source_lang":"en","target_lang":"zh","level":2,"created_at":"2026-09-23T10:00:00Z","completed_at":"2026-09-23T10:00:41Z","ai_generated":true,"content":{"introduction":"Order food and ask prices at a night market.","learning_objectives":["Ask how much something costs"],"vocabulary":[{"word":"多少钱","pronunciation":"duōshao qián","translation":"how much"}],"sets":[{"number":1,"questions":[{"type":"multiple_choice_word","prompt":"Which word asks for a price?","options":["多少钱","谢谢"],"answer":"多少钱","explanation":"多少钱 means how much money."}]}]}}}번역본과 영어 참조 문서의 내용이 다른 경우, 영어 참조 문서가 올바른 것으로 봅니다.