Skip to content

Authentication

All cloud API requests require authentication via your API key.

There are two ways to pass your API key:

The SDK handles authentication automatically:

from rayobrowse import Rayobrowse
client = Rayobrowse(
endpoint="wss://cloud.rayobrowse.com",
api_key="your-api-key",
)
import { Rayobrowse } from 'rayobrowse';
const client = new Rayobrowse({
endpoint: 'wss://cloud.rayobrowse.com',
apiKey: 'your-api-key',
});

The SDK sends the key as:

  • x-api-key HTTP header on API calls
  • token query parameter on /connect requests

If calling the API directly without the SDK:

Terminal window
curl https://cloud.rayobrowse.com/health \
-H "x-api-key: your-api-key"
StatusErrorMeaning
401UnauthorizedInvalid or missing API key
429Rate limitedToo many requests — see limits

The SDKs throw typed errors for these cases:

  • AuthError (401)
  • RateLimitError (429)
  • ConcurrencyLimitError (429 with concurrency details)
  • Keep your API key secret — do not commit it to version control
  • Use environment variables to store your key
  • Each API key is scoped to your account