Basic configuration
Configure your OpenCloud API key once at startup:The API key is automatically applied as an
x-api-key header only for OpenCloud endpoints (URLs containing /cloud/).Using OpenCloud APIs
Once configured, OpenCloud requests work seamlessly:OpenCloud endpoints
RoZod includes 95+ OpenCloud endpoints covering:- Universe management: Get and update universe information
- DataStores: Read and write to DataStores
- Place publishing: Upload and publish places
- Group management: Manage group members and roles
- Messaging: Send messages to players in-game
- Ordered DataStores: Access ordered DataStore data
- Assets: Upload and manage assets
Example: DataStore access
Combined authentication
You can configure both cookie-based and OpenCloud authentication together:- OpenCloud endpoints (
apis.roblox.com/cloud/*): Usex-api-keyheader - Classic endpoints (all other
*.roblox.com): Use cookie authentication
Some endpoints on
apis.roblox.com still use cookie-based authentication. RoZod correctly applies cookies to these non-OpenCloud endpoints.Getting an API key
To create an OpenCloud API key:- Go to Roblox Creator Dashboard
- Navigate to Open Cloud → API Keys
- Click Create API Key
- Configure permissions and scopes for your key
- Copy the generated API key
API key scopes
OpenCloud API keys use scope-based permissions. RoZod includes scope information in endpoint metadata:Ensure your API key has the required scopes for the endpoints you’re calling. Missing scopes will result in 403 Forbidden errors.
Manual API key headers
You can also pass the API key per-request:Manual headers take precedence over
configureServer() defaults. This is useful for testing or per-request customization.Rate limiting
OpenCloud APIs have different rate limits than classic APIs:- Most endpoints: 60 requests per minute per API key
- DataStore operations: Higher limits based on universe size
- Some endpoints have stricter limits
Error handling
Handle OpenCloud-specific errors:OpenCloud APIs use BEDEV2 error format. RoZod automatically parses these errors into the standard
AnyError format.Security best practices
Store keys securely
Never commit API keys to version control:Use minimal scopes
Create separate API keys for different purposes with only required scopes:Rotate keys regularly
Periodically rotate API keys:- Create a new API key in Creator Dashboard
- Update your environment variables
- Deploy updated configuration
- Revoke old API key after verifying new one works
OpenCloud vs classic APIs
When to use OpenCloud APIs
When to use OpenCloud APIs
- Need server-to-server authentication
- Want fine-grained permission control
- Building production services
- Accessing DataStores from external servers
- Need stable, versioned API contracts
When to use classic APIs
When to use classic APIs
- Need access to web-only features (groups, avatars, etc.)
- Building browser extensions or user-facing apps
- Need features not yet available in OpenCloud
- Working with the Roblox website ecosystem
OpenCloud API versions
RoZod supports both OpenCloud API versions:- V2 (recommended)
- V1
V2 is the recommended version for new projects. It provides better consistency and follows modern API design patterns.
Troubleshooting
Invalid API key
If you get authentication errors:- Verify the API key in Creator Dashboard
- Check that the key hasn’t been revoked
- Ensure the key has required scopes
- Verify the environment variable is set correctly
Missing scopes
If you get permission denied errors:- Check the endpoint’s required scopes
- Update the API key in Creator Dashboard to include missing scopes
- Use a different API key with appropriate permissions
Rate limiting
If you hit rate limits:- Implement backoff and retry logic
- Cache responses when possible
- Batch operations to reduce request count
- Consider upgrading your universe tier for higher limits
Next steps
Server authentication
Learn about cookie-based authentication
Security features
Understand automatic security mechanisms
Error handling
Handle API errors gracefully
OpenCloud endpoints
Browse available OpenCloud endpoints