Call a tool
/v1/tools/{tool}/calls Needs an API keyCall a tool and return its output.
The call is served by the cheapest provider that supports your input, falling back to the next one if it fails. Set provider to use one provider only, and require to insist on optional outputs. You are charged when the call succeeds, as shown in cost.
Some providers take minutes. The request waits up to wait seconds (25 by default, 0 to 50) for the call to finish. A call still running then answers 202 with status: "pending" and a Location header: it goes on running, and you are charged only if it succeeds. Read it at GET /v1/calls/{call_id}?wait=50 until its status is succeeded or failed. A call is never cut short because your request ended.
A call that no provider could serve answers 502, or 504 when it ran out of time, or 429 with PROVIDER_RATE_LIMITED when every provider tried refused it for its rate limit: retry after the Retry-After header's seconds. All three carry a call_id: the call is recorded, was not charged, and can be read back from GET /v1/calls/{call_id}. One exception: a provider that fails a call and bills it ends the call there, with no fallback, and 502's detail says what you were charged: what that provider billed. The call's failure_reason is then billed_provider_failure. A request refused before any provider was contacted (unknown tool, invalid input, insufficient balance) records nothing.
A 503 with CALL_RESULT_DEFERRED means the call ran but Voxoria was too busy to return its result: it carries a call_id and a Location header. Read the call at GET /v1/calls/{call_id} rather than calling again, which would make, and charge, a new call.
To retry safely, send an Idempotency-Key header. If a call with that key already succeeded in the last 24 hours, you get that call back with the header Idempotent-Replayed: true: no provider is called and you are not charged again, so cost is what the first call cost. The key must come with the same tool and body each time; a different request answers 422 with IDEMPOTENCY_KEY_REUSED. While the first call is still running a retry waits for it as the first request did, and answers it, or 202 with it still running. A call that failed does not keep its key, so retrying it makes a new call. Without the header, every request is a new call.
To reuse a result you already paid for, set reuse_within in seconds. If your workspace has a succeeded call with the same tool, input, provider and require made within that window, the newest one is returned with reused: true: no provider is called, nothing is charged and no call is recorded, so id and cost are that earlier call's. A replay for an Idempotency-Key is checked first; a reused answer does not claim the key.
Set label to name the call, then find it with GET /v1/calls?label=... or change it with PATCH /v1/calls/{call_id}. A reused or replayed answer keeps its own label. Outputs are kept with no time limit.
Test keys cannot call tools yet and answer 403 with TEST_KEY_NOT_ALLOWED. Use a live key.
Path parameters
toolstringRequiredThe tool's ID, such as google.serp.organic.
Headers
Idempotency-KeystringA key of your choosing, 1 to 128 printable ASCII characters, that makes a retry safe. The same key with the same request within 24 hours returns the first call and is not charged again.
Request body
What to call a tool with.
inputobjectRequiredThe tool's input, as its input schema describes.
providerstringServe the call from this provider only. Omit to use the cheapest that can.
1 or more characters.
Can be null.
requirearray of stringOutputs the serving provider must return, by name. Only providers that return each optional one are used; a required one is always returned, so naming it changes nothing.
Each item: 1 or more characters.
Can be null.
reuse_withinintegerReuse a result instead of calling again: if your workspace has a succeeded call with the same tool, input, provider and require made within this many seconds (1 to 2592000, 30 days), the newest such call is returned with reused: true. No provider is called, nothing is charged and no call is recorded; id and cost are that earlier call's. Omit to always make a new call.
From 1 to 2592000.
Can be null.
labelstringA name of your choosing for the call, 1 to 100 characters, to find it again by. Not unique. Ignored when the answer is a reused or replayed call.
1 to 100 characters.
Can be null.
waitintegerSeconds to wait for the call to finish, 0 to 50. A call that finishes in time is answered with its result. One still running is answered with status: "pending": it goes on running, and reading the call again by its id returns its result. 0 answers at once.
From 0 to 50.
Response
The call, finished: succeeded, or an earlier call replayed or reused.
The body is a call: see the call response for every field, an example and the error bodies.
Idempotent-Replayed:truewhen the response is an earlier call returned for itsIdempotency-Key. Absent otherwise.
The call is still running after wait seconds: it has status: "pending" and no output or cost yet. It goes on running; read it at GET /v1/calls/{call_id}, with wait to wait for it.
The body is a call: see the call response for every field, an example and the error bodies.
Location: Where to read the call.Retry-After: Seconds to wait before reading it withoutwait.Idempotent-Replayed:truewhen the response is an earlier call returned for itsIdempotency-Key. Absent otherwise.
The request was refused.
The API key is missing, wrong or revoked.
Your available balance cannot cover the call.
The key's scope does not permit calls, the key is a test key, or a subscription is required.
No tool has this ID.
The tool cannot be called yet.
The request or the idempotency key is not valid (VALIDATION, with errors), no provider can serve the request (NO_ELIGIBLE_PROVIDER), or the idempotency key was already used with a different request (IDEMPOTENCY_KEY_REUSED).
Too many requests with this API key (RATE_LIMITED), or every provider that could serve the call is rate limiting requests (PROVIDER_RATE_LIMITED, with call_id; the call was not charged).
Retry-After: Seconds to wait before retrying.
No provider served the call. Not charged, unless its provider billed the failure.
The tool is not available right now, or the call could not be started: not charged, retry shortly. Or the call ran but its result could not be returned now (CALL_RESULT_DEFERRED, with call_id and a Location header): read it at GET /v1/calls/{call_id} instead of calling again.
Location: With CALL_RESULT_DEFERRED: where to read the call.
The call ran out of time. Not charged.