Idempotency Keys in the Computer Use API: Never Double Charge
Idempotency keys prevent duplicate payments and retries from costing you twice. In the Coasty Computer Use API, an idempotency key only protects the 18 documented reserve-and-replay operations when it is present on the original request. It cannot be added retroactively. This ensures you only pay once per unique intent, keeping your prepaid USD wallet usage predictable.
How it works
When you make a reserve-and-replay operation, include the Idempotency-Key header with a unique value. The server stores the response associated with that key for a short retention window. If you resend the same request with the same key, the server returns the cached response instead of processing a new action. This protects you from accidental duplicate submissions that could lead to duplicate charges. The key is case-sensitive and must be the same on the original and retry requests.
curl -X POST https://coasty.ai/v1/runs \ -H "Authorization: Bearer $COASTY_API_KEY" \ -H "Idempotency-Key: 6f09c2f6-4c7a-4f8a-9b3d-8e2c1a5b3d6f" \ -H "Content-Type: application/json" \ -d '{"machine_id": "vm-123", "task": "Install Python and create a file", "cua_version": "v3"}'Billing and scope
- ●You are billed from a prepaid USD wallet where 1 credit equals $0.01.
- ●Idempotency keys protect the 18 reserve-and-replay operations only when present on the original request.
- ●Idempotency keys cannot be added retroactively after the request has been processed.
- ●Keys are case-sensitive and must match exactly between the original and retry requests to trigger idempotency.
- ●Scopes gate key access more granularly, but idempotency works within the scope of the key.
Include Idempotency-Key on the original reserve-and-replay request to prevent duplicate billing and ensure replay safety.
Where this beats brittle automation
Traditional automation tools rely on fragile selectors that break when a UI element moves or changes. The Coasty Computer Use API drives real desktops, browsers, and terminals by seeing the screen and acting like a human. Idempotency keys let you retry failed runs, handle network glitches, or pause and resume tasks without worrying about double charges. You can focus on writing robust workflows and agents instead of debugging duplicate payment errors.
Use idempotency keys on your reserve-and-replay operations to build reliable computer use agents that only bill once per intent. Ready to start? Get a key at https://coasty.ai/developers and build safer, more predictable automation.