Back to Blog
Engineering

James Liu6 min
Pg Up

A computer use API gives you full control over a real desktop environment, but you need to lock down access and track spend. API keys define who you are, scopes gate which resources they can touch, and the prepaid USD wallet ensures you only pay for what you use. This post covers the details and shows you how to apply them to your computer use agent.

How it works

Authentication uses the X-API-Key header or the Authorization: Bearer header with a key read from the COASTY_API_KEY environment variable. Keys are scoped to specific resources such as runs, sessions, or machines. When you make a request, the server checks the key against its scopes and validates the prepaid wallet has enough credits. Billed operations use credits at a rate of $0.05 per agent step for a task run, $0.04 per predict for a session, and $0.10 for creating a session instance. The wallet starts empty; you add funds, then consume credits as your computer use agent performs actions. Rate limits (403 INSUFFICIENT_SCOPE, 429) kick in if you exceed usage allowances per key.

bash
export COASTY_API_KEY=sk_live_xxxxx

# Create a task run using the computer use API
# This will consume credits from the prepaid wallet
curl -X POST https://coasty.ai/v1/runs \
  -H "X-API-Key: $COASTY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "machine_id": "machine-123",
    "task": "launch Chrome and navigate to https://example.com",
    "cua_version": "v3",
    "max_steps": 20,
    "on_awaiting_human": "pause"
  }'

Key and scope details

  • Keys are created at https://coasty.ai/developers/keys
  • Scopes gate access to runs, sessions, machines, and workflows
  • A key with insufficient scope returns a 403 INSUFFICIENT_SCOPE error
  • Prepaid wallet credits are USD, 1 credit equals $0.01
  • You can use the prepaid wallet across all scoped resources
  • Rate limits are applied per key based on usage patterns

Read the API key from COASTY_API_KEY, pass it as X-API-Key, and let the prepaid wallet handle the billing.

Where this beats brittle automation

Traditional automation relies on brittle selectors, fixed API endpoints, and fragile selectors that break when UI elements change. A computer use agent sees the screen, understands context, and executes actions like a human, all while being governed by scoped keys and a prepaid wallet. This gives you fine-grained control over what the agent can do and ensures costs stay predictable. Scopes let you grant read-only access to some workflows while restricting write access to others, and the prepaid wallet lets you set budgets per project or per key.

You now understand how API keys, scopes, and the prepaid USD wallet work for your computer use agent. Use scoped keys to lock down access, monitor your wallet balance, and set limits before launching runs. To get started, visit https://coasty.ai/developers to create a key and add funds.

© 2026 Coasty

Backed byYCombinator