The SDK exposes two task representations:Documentation Index
Fetch the complete documentation index at: https://docs.mynth.io/llms.txt
Use this file to discover all available pages before exploring further.
Taskfor completed workTaskAsyncfor in-progress work
Task
Task is returned from sync generation and from TaskAsync.wait().
Useful properties and helpers:
task.idtask.statustask.resulttask.urlstask.getImages()task.getImages({ includeFailed: true })task.getMetadata()
TaskAsync
TaskAsync is returned from:
task.idtask.access.publicAccessTokentask.wait()
Browser-safe access token
publicAccessToken is designed for client-side polling of:
GET /tasks/:id/statusGET /tasks/:id/results
Polling behavior
wait():
- starts polling lazily
- reuses the same promise if called multiple times
- polls quickly for the first few seconds, then slows down
- times out after five minutes
- retries transient fetch failures
Error classes
The SDK exposes dedicated error classes:MynthAPIErrorTaskAsyncTimeoutErrorTaskAsyncUnauthorizedErrorTaskAsyncFetchErrorTaskAsyncTaskFetchErrorTaskAsyncTaskFailedError