GuidesGet started
FAQs
Short answers to common questions about Predict's APIs and SDKs.
Join our Discord server to report any issue.
Where do I get an API key?
In the developer console. Mainnet needs a key for every request. Testnet works without one.
Which networks are supported?
BNB Mainnet (https://api.predict.fun) and BNB Testnet (https://api-testnet.predict.fun). See Environments for the WebSocket URL and chain IDs.
Where are your servers?
In AWS ap-northeast-1 (Tokyo). It is also the closest region that is not geo-restricted.
What are the rate limits?
Keys from the developer console allow 500 requests per minute on trading routes and 250 per minute on most other routes. Order placement and removal also have a per-second cap. On testnet without a key, the limits are 500 and 240 per minute for each IP address. See Rate limits for every limit and the response headers.
Is there an SDK?
Yes, for TypeScript (npm, GitHub) and Python (PyPI, GitHub). Both sign orders, set approvals and manage positions.
Is there an SDK for Rust, Go or another language?
No. In another language, generate a client from the specs of the two APIs:
- REST:
https://dev.predict.fun/openapi/rest.json, an OpenAPI document. - WebSocket:
https://dev.predict.fun/asyncapi/websocket.json, an AsyncAPI document.
Logging in and placing orders also need signatures. With a regular wallet, you log in by signing a personal message (EIP-191), and you sign each order as EIP-712 typed data for the market's exchange contract. With a Predict account, your Privy wallet signs in the smart wallet's own format. Order signing describes both, with a test vector to check your code against.
Is there a GraphQL API?
No public one. The web app uses a GraphQL API of its own, which is internal and can change at any time. Use the REST and WebSocket APIs.
Can an AI assistant help me with the API?
Yes. These docs are available as /llms.txt and /llms-full.txt, and our SDKs and docs are on Context7. See Docs for AI tools.
How do I authenticate my requests?
Send your API key in the x-api-key header. Requests for your own wallet, such as placing orders, also need a JWT. See Authentication.
How do I create orders?
See Place orders. Before your first order, set your approvals.
Why was my order rejected?
The response's error field names the reason. Errors lists every code with its fix.
Is the order book priced in Yes or No?
In Yes. The No prices are the complement of the Yes prices. See Prices and order book.
How do I redeem a winning position?
See Manage positions.
Can I use my Predict account through the API or SDK?
Yes. Predict works with a regular wallet (an externally owned account, or EOA) and with a smart wallet called a Predict account. If you use the web app, a Predict account is created for you. Wallets in the product docs explains how Predict accounts work.
To use your Predict account programmatically, you need:
- The Predict account's address, from your portfolio page.
- The private key of its Privy wallet, which signs for the Predict account. You can export it from your account settings.
Fund the Privy wallet with some BNB to pay the gas of on-chain actions, such as setting approvals and cancelling orders on-chain.
Authentication and Place orders cover both kinds of wallet.
You can also use another account abstraction SDK, such as the ZeroDev SDK. That takes more effort and technical knowledge, and we can offer little support for third-party SDKs.
What is my proxy address?
On Predict, your proxy address is your Predict account's address. You can find it on your portfolio page. If you have more than one, use the one you trade from. Don't use the Smart Routing Address, called the Global Deposit Address in the help articles, which is a separate address for deposits from other chains.
If you trade from a regular wallet, there is no proxy. Use the wallet's own address.