Durable Jobs & Receipts
Use durable jobs when generation should survive beyond a single HTTP request. This is the main path for image, audio, and similar work.
Submit
POST /v1/capabilities/{key}/jobs
Authorization: Bearer <HYDRACEPT_API_KEY>
Content-Type: application/json
Include:
context— product, project, environmentinput— capability-specific payloadexecution— preferences such asexecutionPreferenceidempotencyKey— stable key for safe retries
Example for image.generate.v1:
curl -sS -X POST \
-H "Authorization: Bearer $HYDRACEPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"context": {
"productId": "my-product",
"projectId": "cpr_...",
"environment": "development"
},
"input": { "prompt": "cute slime icon" },
"execution": { "executionPreference": "automatic" },
"idempotencyKey": "demo-1"
}' \
https://api.hydracept.com/v1/capabilities/image.generate.v1/jobs
Poll
GET /v1/jobs/{jobId}
Authorization: Bearer <HYDRACEPT_API_KEY>
Jobs move through queued and running before reaching a terminal status: succeeded, failed, or canceled. A job can also be awaiting_approval, canceling, or needs_attention; handle those states according to your workflow.
Jobs may include a variantSet when the capability accepts variantCount in input (image and audio generation). Each variant is a separate artifact with variantIndex on the job payload. variantSet reports requestedCount, completedCount, failedCount, and selectedArtifactId.
Select a variant
When a job produced multiple variants, pick the one your pipeline should treat as the primary output:
POST /v1/jobs/{jobId}/variants/select
Authorization: Bearer <HYDRACEPT_API_KEY>
Content-Type: application/json
{ "artifactId": "art_..." }
The job’s selectedArtifactId and artifact selected flags update immediately. Download the chosen artifact with GET /v1/jobs/{jobId}/artifacts/{artifactId}.
Example for audio.sfx.generate.v1 with two variants:
curl -sS -X POST \
-H "Authorization: Bearer $HYDRACEPT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"context": {
"productId": "my-product",
"projectId": "cpr_...",
"environment": "development"
},
"input": {
"prompt": "metal button click",
"durationMs": 500,
"variantCount": 2
},
"execution": { "executionPreference": "automatic" },
"idempotencyKey": "sfx-variants-1"
}' \
https://api.hydracept.com/v1/capabilities/audio.sfx.generate.v1/jobs
Optional control routes (when enabled for your plan):
POST /v1/jobs/{jobId}/cancelPOST /v1/jobs/{jobId}/approvePOST /v1/jobs/{jobId}/reject
Artifact / output
Succeeded jobs expose outputs and artifacts on the job resource. Download individual artifacts with:
GET /v1/jobs/{jobId}/artifacts/{artifactId}
Authorization: Bearer <HYDRACEPT_API_KEY>
Receipt
GET /v1/jobs/{jobId}/receipt
Authorization: Bearer <HYDRACEPT_API_KEY>
Receipts include provenance and execution evidence for audits, debugging, and pipeline bookkeeping.
Sheet & Slice (image.generate.v1)
For cohesive asset packs (sprite cycles, icon families, pose sheets), submit a job with the sheet input. See Image production for the full contract and a 4×4 sword-swing example.