Request
input must be a JSON object. An array, a string or a number answers 400
with the path /input. Your input is validated against the tool’s schema
before anything is held or started, and schema defaults are filled in for you.
Responses
There are three of them, and which one you get depends on how fast the tool finished.200: finished
The tool completed inside the synchronous window, which is 25 seconds by default. The rows are inoutput, abridged to one row here.
cost_micro is what left your balance. quoted_cost_micro is what was
reserved while the run was in flight, and the difference between them was
released back to you.
202: still running
Past the synchronous window. You get a run id and poll it.status_url until status is terminal. See
Runs for what polling does and where the rows arrive.
502: the provider failed
The tool failed or timed out inside the synchronous window. The hold has already been released in full and you are not charged.status here is FAILED or TIMED_OUT. Retrying is safe and costs nothing
for the attempt that failed.
What a run costs
Two numbers, doing two different jobs. The hold is taken before the tool starts and is sized from what you asked for. Request three rows and a small amount is held; request three hundred and more is held. The hold is not a charge, and it never exceeds the tool’s ceiling. The charge is taken when the run settles, and how it is worked out depends on the tool’sprice.type:
cost_plus, which is most of the catalog: the markup applied to what the provider actually charged, floored atmin_microand capped at bothmax_microand the hold. Whatever is left of the hold is released. A run that returns zero rows and cost the provider nothing is billed nothing.per_call, the image tools:base_micro, every time. The quote and the charge are the same number, so nothing is released.metered, the voice tools: the published rate times the size of the input, measured after the fact. Speech to text bills the real duration of the audio, which is usually shorter than themax_duration_secondsthe hold was sized from, so the difference comes back.
On a
cost_plus run Goro waits for the provider’s own billing to settle
before charging, which is why cost_micro is authoritative and
quoted_cost_micro is not. Do not report the quote to a user as the price of
the call. On a per_call run the two are equal by construction.Timing
Errors
None of these charge you. A validation failure never reaches the provider and
never places a hold; a failure after the hold releases it in full.
Poll and manage runs
Fetch, list and stop runs.