Skip to content

Commit 677c756

Browse files
chengzeyiclaude
andcommitted
Document that retries never re-submit the task POST
Task-level maxRetries (default 0) re-runs only a task that reported a transient failure and creates a new paid task; poll errors and wait timeouts never re-submit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent c1809f4 commit 677c756

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Map<String, Object> output = Wavespeed.run(
8282
36000.0, // timeout - Max wait time in seconds (default: 36000.0)
8383
1.0, // pollInterval - Status check interval (default: 1.0)
8484
false, // enableSyncMode - Best-effort sync result attempt (default: false)
85-
null // maxRetries - Task-level retries (default: 0)
85+
null // maxRetries - Task re-runs after a reported failure; each is a new paid task (default: 0)
8686
);
8787
```
8888

@@ -110,13 +110,19 @@ never retried, because a failed submission may still have created the task
110110
on the server. When that happens the SDK throws
111111
`ai.wavespeed.WavespeedSubmissionException`.
112112

113+
`maxRetries` (default: 0) only re-runs a task that itself reported failure with
114+
a transient HTTP 5xx/429. Each re-run submits a **new, separately billed task**.
115+
Poll-side HTTP errors and wait timeouts never re-submit. There is no overall
116+
timeout requirement: tasks can run for hours, and a client-side wait timeout
117+
does not mean the task failed.
118+
113119
```java
114120
import ai.wavespeed.api.Client;
115121

116122
// Simple retry configuration
117123
Client client = new Client(
118124
"your-api-key",
119-
3, // maxRetries - Task-level retries (default: 0)
125+
0, // maxRetries - Task re-runs after a reported failure; each is a new paid task (default: 0)
120126
5, // maxConnectionRetries - Result-query GET retries; the submission POST is never retried (default: 5)
121127
1.0 // retryInterval - Base delay between retries in seconds (default: 1.0)
122128
);

0 commit comments

Comments
 (0)