Clean up manual requests¶
Topics: clients, errors, requests
Manual clients expose one HTTP exchange at a time. Use them only when your application persists the request ID and can guarantee a cancellation attempt after partial failure.
- Submit
ImageGenerateAsyncRequestand require anImageGenerateAsyncResponse. Persist itsid_before polling. - Poll
ImageGenerateCheckRequest(id=id_). Verifydone,wait_time,queue_position, andis_possibleon every response before scheduling the next poll. - Retrieve
ImageGenerateStatusRequest(id=id_)when the request completes. This final retrieval also releases the server-side request lifecycle. - In
finally, submitDeleteImageGenerateRequest(id=id_)if final retrieval did not succeed. Treat a missing or already-finalized request as a successful cleanup outcome.
Use AIHordeAPIClientSession as a context manager when you want low-level submission with tracked best-effort cleanup.
Verify cleanup by observing a terminal status or a successful delete response. A deleted request cannot be restored;
submit a new request if the work is still required.
The request/response contracts list the corresponding text and alchemy follow-up types.