Idempotency-Key.
How It Works
Job Statuses
Response Envelope
All graph endpoints return a consistent envelope:status- Current job statejobId- Unique identifier for the jobretryAfter- Recommended seconds to wait before the next poll (only present for pending/processing)result- The graph data (only present when completed)error- Error description (only present when failed)
Polling with cURL
Store theIdempotency-Key in a variable and re-use it for polling:
Using the SDK
The@supermodeltools/sdk package handles polling automatically. Install it with:
Basic Usage
Configuring Polling Behavior
Available Methods
Error Handling
If a job fails, the response will havestatus: "failed" with an error message:
Idempotency Key Behavior
TheIdempotency-Key scopes a job to your API key. Key behaviors:
- Same key, same user: Returns the existing job (no duplicate processing)
- Same key, different user: Creates independent jobs (no conflict)
- New key, same file: Creates a new job (useful for re-analysis after code changes)
Completed jobs are retained for 24 hours. After that, submitting the same idempotency key will create a new job.