API reference
Single-bet Kelly
The Kelly stake for each bet, sized on its own. No daily limit.
POST/v1/kelly
Each bet is sized alone: no per-bet cap, no limit on the total, and no allowance for bets that win or lose together. For bets you will place on the same day, optimize applies all three and usually allocates less.
Request
| Field | Type | Required | Meaning |
|---|---|---|---|
bets | array | yes | 1 to 100 bets. |
bets[].odds | integer | yes | American odds. |
bets[].probability | number | yes | Your win probability, 0.000001 to 0.999999. |
bets[].id | string | no | Your own label, echoed back. |
bankroll | number | no | USD. Send it to get stake in dollars. |
fraction | number | no | Kelly multiplier, above 0 and at most 1. Default 1; 0.5 is half Kelly. |
Example
An even-money bet you think wins 55% of the time, at half Kelly:
curl https://api.kellyiq.com/v1/kelly \
-H "Authorization: Bearer $KELLYIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"bets": [
{ "id": "a", "odds": 100, "probability": 0.55 }
],
"bankroll": 1000,
"fraction": 0.5
}'{
"fraction": 0.5,
"bankroll": 1000,
"results": [
{
"id": "a",
"odds": 100,
"probability": 0.55,
"decimalOdds": 2,
"breakEvenProbability": 0.5,
"expectedValue": 0.1,
"kellyFraction": 0.1,
"stakeFraction": 0.05,
"stake": 50
}
]
}Response
The request’s fraction and bankroll are echoed back, then one result per bet, in your order:
id,odds,probability: your input, echoed.decimalOdds: total return per 1 staked.breakEvenProbability: the win rate at which the bet makes nothing.expectedValue: expected profit per 1 staked.kellyFraction: full Kelly. Negative means no edge.stakeFraction: the share of the bankroll to stake: the larger of 0 andkellyFraction, timesfraction.stake: that in dollars;nullwhen no bankroll was sent.
Errors
Every problem in the request is reported at once:
{
"error": "VALIDATION_ERROR",
"message": "The request is invalid; see violations.",
"violations": [
"bets[0].odds: American odds: at most -100 or at least +100 (magnitude ≤ 100000)",
"bets[0].probability: required, between 0.000001 and 0.999999",
"bankroll: must be greater than 0 and at most 100000000"
],
"requestId": "req_24751790ee084a49a0ae4deb82000e53"
}Also 429 BURST_LIMIT_EXCEEDED above 60 calculator calls a minute. See Errors.