Back to Blog
Engineering

Sarah Chen5 min
⌘+K

Every successful computer use agent starts with a secure key and enough credits. The Coasty Computer Use API uses API keys for authentication, scopes to gate access to specific endpoints, and a prepaid USD wallet to bill usage. This post explains how these pieces fit together so your agent can run tasks reliably without hitting rate limits or permission errors.

API keys and authentication

You must provide your API key on every request. The API accepts either the header X-API-Key: <key> or Authorization: Bearer <key>. Read the key from the COASTY_API_KEY environment variable, never hardcode it in production. If the key is missing, invalid, or lacks the required scope, the API returns a 401 or 403 error.

bash
# Example: list runs using the X-API-Key header

API_KEY=$(cat $HOME/.coasty/key)

curl -s https://coasty.ai/v1/runs \
  -H "X-API-Key: $API_KEY" | jq .

Scope gates

Keys are scoped to specific operations. A key with insufficient scope returns a 403 INSUFFICIENT_SCOPE error. The API defines scopes that gate access to endpoints like /v1/runs, /v1/workflows, /v1/machines, and the billing endpoints. When you generate a key at https://coasty.ai/developers, select exactly the scopes your application needs. Do not grant broad permissions you do not use.

Prepaid USD wallet and billing

Coasty uses a prepaid USD wallet. One credit equals $0.01. You add funds to the wallet and pay per agent step, prediction, or session as listed. For example, a POST /v1/runs task run is $0.05 per agent step. If your wallet balance falls below the cost of a request, the API returns a 402 INSUFFICIENT_CREDITS error. Webhooks are HMAC signed using the header Coasty-Signature: t=unix,v1=hex for payload verification.

Check your wallet balance before starting long-running workflows. A low balance will cancel your runs mid-task.

Rate limiting and error handling

The API enforces rate limits and returns a 429 error when you exceed them. Each rate limit bucket resets after a configurable period. Handle 429 by backing off and retrying with an exponential backoff strategy. Always inspect the error response for the request_id field, which helps you debug and reconcile failed requests with your logs.

Where this beats brittle automation

Traditional automation relies on brittle selectors, hardcoded URLs, and vendor-specific APIs. Computer use agents see the screen and act like a human, making them resilient to UI changes and layout shifts. The computer use API focuses on real desktop interactions, not just API calls. With secure keys, scoped access, and a prepaid wallet, you can scale these agents reliably across many machines and tasks while keeping costs predictable.

Now you know how API keys, scopes, and the prepaid USD wallet keep your computer use agent secure and budget-aware. Combine these controls with the Coasty Computer Use API to build agents that drive browsers, terminals, and desktops with confidence. Get your key at https://coasty.ai/developers and start building.

© 2026 Coasty

Backed byYCombinator