Skip to main content
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.

The lifecycle

You learn about completion by polling or by webhooks.

Polling

The SDK ships a tiny poll() helper:
For batch operations, every resource that supports generation also has a getStatus(ids[]) call so you can poll many at once:

Webhooks

Recommended in production. Subscribe to events in the dashboard:
  • course.syllabus_generated
  • lesson.content_generated
  • activity.generated
  • submission.graded
Hawkings POSTs to your URL with:
Verify the signature with 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:
Research artefacts are reusable across generations. They expire after 30 days unless pinned.

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 throws RateLimitError with code: "quota_exceeded".

When generation fails

status: "error" resources carry an error object:
If retriable: true, calling the same *.generate*() again with the same parameters is safe. If it’s false, fix the input and try again.