You want to automate browsers, terminals, and local apps without brittle selectors. You need to control who can run what and stay within your budget. The Coasty Computer Use API handles this with API keys, scopes, and a prepaid USD wallet. When you hit an endpoint, the server checks your key, verifies its scope, and deducts from your wallet. If you run out of credits, requests return 402 INSUFFICIENT_CREDITS. This guide shows how keys, scopes, and the wallet work together.
API keys and the authentication header
Every request to the Coasty Computer Use API must carry an authentication header. Use your key from the COASTY_API_KEY environment variable. Set the header either as X-API-Key: <key> or as Authorization: Bearer <key>. This header is required for all endpoints including /v1/predict, /v1/sessions, /v1/runs, /v1/workflows, and /v1/machines. If the key is missing or invalid you get a 401 error. Keys are scoped, so each key can be limited to specific operations. Scopes are checked on every request, and a 403 INSUFFICIENT_SCOPE error is returned if the operation is not allowed for that key.
curl -X POST https://coasty.ai/v1/runs \
-H "X-API-Key: $COASTY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"machine_id": "your_machine_id",
"task": "open https://example.com",
"cua_version": "v4",
"max_steps": 100,
"deadline_seconds": 300,
"on_awaiting_human": "pause"
}'Scopes gate what a key can do
- Each API key has a set of allowed operations controlled by scopes.
- If a request uses a key whose scope does not include the operation, the server returns 403 INSUFFICIENT_SCOPE.
- Common scope checks include access to /v1/runs, /v1/workflows, /v1/machines, and vision endpoints such as /v1/predict.
- You can create separate keys for development, staging, and production, each with its own scope configuration.
Always read the key from COASTY_API_KEY and set the header before any request.
The prepaid USD wallet and billing
Coasty uses a prepaid USD wallet where 1 credit equals $0.01. Every API call that performs work is billed to your wallet. For example, a task run step costs $0.05 per agent step. Vision calls to /v1/predict cost $0.05 per request. Stateful sessions with /v1/sessions/{id}/predict cost $0.04 per request. Grounding a screenshot to coordinates with /v1/ground costs $0.03. The free /v1/parse endpoint does not deduct credits. When you make a request, the server checks your available balance. If credits are insufficient you receive a 402 INSUFFICIENT_CREDITS error. You can monitor your balance and add funds through the dashboard. The wallet ensures predictable costs and prevents surprise charges.
Where this beats brittle automation
Traditional automation relies on brittle selectors and fixed API calls. If a UI changes, your script breaks. With the Coasty Computer Use API, the agent sees the screen, understands instructions, and clicks, types, and navigates like a human. This makes your agents resilient to layout changes and UI evolution. The prepaid wallet gives you per-step pricing and budget limits, so you know exactly how much each task costs. Scopes let you isolate different environments and restrict access to sensitive operations. This combination lets you build robust, cost‑controlled automation at scale.
Start building safe, cost‑controlled agents with the Coasty Computer Use API. Get your key at https://coasty.ai/developers, configure scopes, and fund your prepaid USD wallet. Then run tasks, workflows, or full machine sessions with confidence.
Want to see this in action?
View Case Studies