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
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.