Skip to main content
POST
Add tasks to a batch
Add up to 100 task inputs to an existing batch in open or processing state. Keep a mapping between each submitted task and the record in your application that needs the result. The mode price for every task in the request is held against your balance in one step. If the balance can’t cover all of them, the request returns 402 and no tasks are added. A 503 means billing couldn’t be checked and nothing was added; retry with backoff. A task that waits in the queue for more than 48 hours needs balance again when it starts; if the balance no longer covers it, the task fails and is not charged. After submission, use List batch tasks to inspect individual outcomes. A batch may contain successful and failed tasks; handle them separately.

Authorizations

X-API-Key
string
header
required

API key for authentication. Get yours at platform.valyu.ai.

Path Parameters

id
string
required

Batch ID.

Body

application/json

Add tasks to an existing batch.

tasks
object[]
required

Tasks to add. Max 100 per request.

Required array length: 1 - 100 elements

Response

Tasks added and queued.

batch_id
string
required

ID of the batch.

Example:

"batch_a1b2c3d4-e5f6-7890-abcd-ef1234567890"

added
integer
required

Number of tasks added.

Example:

5

tasks
object[]
required

Created tasks with their assigned IDs.

counts
object
required

Task count breakdown for a batch.