Skip to content

How can I retry an AI agent tool call without paying twice?

Handle agent tool errors with existing run IDs and idempotency.

By Agentik · Updated

Before retrying a tool call, determine whether the original operation was rejected, is still pending or may already have consumed provider usage. Agentik exposes run state and documented error handling so the agent can follow the existing execution. A network failure alone does not establish that a paid operation never started.

On this page

Classify the failure before deciding to retry

An input validation failure calls for correcting the input. An authorization failure calls for checking workspace authority or account consent. A rate limit calls for the returned retry guidance. These should not all enter a generic “try again” loop.

If a request was dispatched but its response is lost, the outcome is uncertain. Preserve the original request identity and inspect the run. Report what is known instead of claiming failure, success or no charge from a client-side exception.

Keep one identity for one intended execution

Use the same idempotency key for the same intended operation according to the documented contract. Persist that identity before dispatch so a process restart does not create an unrelated replacement. A genuinely changed task needs its own reviewed execution plan.

Do not imply that idempotency prevents every possible upstream duplicate in every failure mode. Follow the documented retention and conflict behavior, check the existing run and preserve any provider identifiers returned by the tool.

Report partial work and its cost honestly

A provider can consume resources before a later step fails. Review the receipt and any retained reservation alongside the output. A billing question and an unusable deliverable are related but distinct issues to investigate.

If an alternative provider is needed, inspect its schema, output and price before continuing. Keep earlier useful evidence, state the missing step and obtain any additional authority required. Do not silently turn recovery into a larger paid workflow.

What you pay for

Supported paid tools use Agentik's prepaid workspace balance. Inspect the selected tool's pricing units and maximum before approving a run; a reservation can differ from its settled charge. Funding fees, taxes and your model's usage are separate. Current terms are on the Pricing and Billing pages linked below.

Recover from a lost generation response

A video submission times out at the client. The correct first action depends on the original operation’s state, not the timeout label alone.

Recover from a lost generation response
Observed conditionNext action
Validation rejected before executionCorrect the documented input and review scope.
Run ID knownRetrieve that run and follow its state.
Response lost after dispatchUse the original idempotency identity and documented recovery.
Partial output or chargeReview existing evidence and receipt before proposing more work.

A prompt to try

Connect your agent, then use this prompt with your connected assistant. Keep credentials in the authorized connection.

Give this to your agent

Help recover [failed or uncertain Agentik operation]. Use the original run ID, input and idempotency key that I provide. Consult the error and idempotency contracts; ask for missing evidence. Classify validation, authorization, rate-limit, pending and uncertain outcomes. Retrieve the existing run before proposing another paid submission. Report completed output, consumed usage, retained reservations and the exact next step without inventing a refund or success.

Your agent should inspect the tools and ask for missing inputs before proposing any paid work.

AI video adsAt most $3.57

Hooks from your niche’s longest-running video ads, objections from YouTube reviews, then frames, clips, a voiceover and music.

10 video ads studied and 5 transcripts read, 3 YouTube reviews, one product page, 3 frames and 3 clips of 8 seconds, a 60-word voiceover and 24 seconds of music.

This catalog-based reservation maximum belongs to the playbook’s inputs, separately from this guide’s worked example. It is not an executed charge. Optional calls, funding fees, taxes and model usage are excluded.

View every step, input and tool in the playbook

Questions

Does a timeout mean the provider did not run?

No. Retrieve the existing execution and follow the documented idempotency and retry behavior.

Are all failed tool calls free?

No. Consumed provider usage can be billable even when the client receives an error or only partial output.

Sources and next steps

Agentik publishes this guide. References below describe the product, its billing and the alternatives discussed. This page was updated on ; provider terms and tool availability can change.

Connect your agent to 2,400+ tools for free

Sign in with Google or GitHub. No card required.