Skip to main content
POST
Estimate a batch
Send the same body as Start a batch. Every input is checked, and a bad one answers 422 with each problem named by its position, as a start would. The answer: What batches are and their limits: Run one skill over many inputs. Needs skills:invoke.

Authorizations

Authorization
string
header
required

API key with the vd_sk_ prefix, as Authorization: Bearer vd_sk_.... Create keys in Settings → API Keys.

Headers

Idempotency-Key
string

Any unique string (such as your order id). Resending the same request with the same key within 24 hours returns the first answer (with Idempotent-Replayed: true) and does nothing twice; the same key with a different request is a 422 idempotency_key_reused.

Required string length: 1 - 255

Path Parameters

slug
string
required

Body

application/json

Body of POST /v1/skills/{slug}/batches (and of its /estimate).

inputs
any[]
required

The list: one object of the skill's inputs per run, e.g. [{"query": "shoes"}, {"query": "hats"}]. 1 to 10,000. Every one is checked before anything starts.

Required array length: 1 - 10000 elements
max_results_per_input
integer | null

At most this many rows from each input's run. Omit for the skill's saved default.

Required range: 1 <= x <= 500
concurrency
integer | null

How many inputs run at once. Capped at your account's limit for this skill; default half of it, so your other runs are not kept waiting.

Required range: 1 <= x <= 100
webhook_url
string | null

https URL that receives the finished batch as a signed POST (X-Valendata-Signature), the same object GET /v1/batches/{batch_id} returns.

label
string | null

A short name for the list.

Maximum string length: 200
allow_partial
boolean
default:false

Start even when your balance covers under half the estimate: inputs run until the credits run out, then the rest are not_started.

Response

Successful Response

inputs
integer
required

How many inputs the list has.

credits_per_input
number
required

Credits one input's run usually costs (the skill's typical recent run, else its base price).

estimated_credits
number
required

credits_per_input × inputs. Real runs can cost more or less.

basis
enum<string>
required

Where credits_per_input comes from.

Available options:
typical_of_recent_runs,
base_price
balance
number
required

The credits of whoever pays for this skill's runs, now.

affordable_inputs
integer
required

About how many inputs the balance covers.

affordable
boolean
required

The balance covers the whole estimate.

concurrency
integer
required

How many inputs would run at once.

max_concurrency
integer
required

The most this skill may run at once on your account.