Submit multiple cutting optimization jobs
Enqueues an array of optimization requests as individual jobs and returns their IDs immediately. Poll or stream each job separately. Maximum 50 fast jobs or 10 thorough jobs per batch. Requires a tier with the `batch` feature.
Authorization
apiKey API key with sk_ prefix
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.sawvant.com/v1/optimize/batch" \ -H "Content-Type: application/json" \ -d '{ "jobs": [ { "parts": [ { "id": "string", "length": 0.1, "width": 0.1, "quantity": 1, "grain": "none" } ], "sheets": [ { "id": "string", "length": 0.1, "width": 0.1, "quantity": 0, "grain": "none" } ], "machine": { "blade_thickness": 0.1, "max_levels": 1, "cut_direction": "default" } } ] }'{
"batch_id": "4da22c97-b7d5-4e31-8c3a-03870ebc7b20",
"job_ids": [
"d3eba197-d45b-4b65-b864-1180cd7445a5"
],
"total": 0,
"created": 0,
"results": [
{
"index": 0,
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"error": "string"
}
]
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "rate limit exceeded",
"limit": 0,
"remaining": 0,
"strategy": "fast"
}Stream job progress via SSE
Server-Sent Events stream that emits `progress`, `completed`, or `failed` events. The stream closes automatically when the job reaches a terminal state. A `: heartbeat` comment is sent every 30 seconds to keep the connection alive through proxies and load balancers. SSE clients ignore these automatically.
Submit a cutting optimization job
Validates the request synchronously, then enqueues the job for async processing. Returns 202 with a job ID and URLs for polling/streaming.