Anywhere you can author content by hand, you can also generate it. The generation API is async-first because most of it takes 10s–60s.Documentation Index
Fetch the complete documentation index at: https://docs.hawkings.education/llms.txt
Use this file to discover all available pages before exploring further.
The lifecycle
Polling
The SDK ships a tinypoll() helper:
getStatus(ids[]) call so you can poll many at once:
Webhooks
Recommended in production. Subscribe to events in the dashboard:course.syllabus_generatedlesson.content_generatedactivity.generatedsubmission.graded
hk.webhooks.verify(body, signature, secret).
What you can generate
| Method | Produces |
|---|---|
courses.generateSyllabus(id, ...) | Units, lessons, learning objectives. |
courses.adaptSyllabus(id, ...) | Re-tailors an existing syllabus to a new audience. |
courses.generateImage(id, ...) | Cover image for the course. |
lessonContents.generate(...) | Long-form HTML reading for a lesson. |
lessonContents.generateImages(...) | Inline diagrams and illustrations. |
activities.generate(...) | A mix of activities for a lesson. |
activities.create({ type: ..., }) | A specific activity (also async). |
tags.generate({ source }) | Tags extracted from a body of text. |
submissions.gradeWithAi(id) | Score + rationale for a submission. |
Grounded research (advanced)
By default, generation uses the model’s training. You can ground it in specific sources for higher factual accuracy:Cost & quotas
Every generation method consumes credits (see your dashboard for the per-call cost). Calls can be capped via per-key quotas; exceeding a quota throwsRateLimitError with code: "quota_exceeded".
When generation fails
status: "error" resources carry an error object:
retriable: true, calling the same *.generate*() again with the
same parameters is safe. If it’s false, fix the input and try again.