Get your API credentials
Before you can trade on Bayse Markets programmatically, you need an API key pair.This quickstart assumes you already have a Bayse Markets account. If not, sign up at link.bayse.markets.
Step 1: Create an API key
Create an API key in the Bayse web app at app.bayse.markets/settings/api-keys. Or in the web app, via More > Account Settings > API Keys in the Developer Tool section. If you prefer to manage API keys programmatically, see Manage API keys programmatically.Step 2: Make a read request
Try a simple read request to list prediction market events:Response example
Response example
Step 3: Make a signed write request
For write operations (like placing orders), you need to sign your request with HMAC-SHA256. The signing payload format is{timestamp}.{METHOD}.{path}.{bodyHash}:
Response example
Response example
Manage API keys programmatically
Use this flow if you want to create, rotate, revoke, or list API keys through the API.Log in
Authenticate with your Bayse account to get a session token:Response example
Response example
token and deviceId for API key management requests.
Create an API key with the API
Use your session token and device ID to create an API key:Each API key must have a unique name. If you already have a key called
"My API Key", choose a different name.Response example
Response example
Next steps
Authentication guide
Learn about API key authentication and HMAC signing in detail.
API reference
Explore all available endpoints and parameters.
Prediction markets
Understand how prediction markets work on Bayse.
Error handling
Learn how to handle API errors gracefully.