Game Theory
Shapley value API
Computes exact Shapley values (fair marginal-contribution payouts) for a small cooperative game given the value of every coalition, and verifies efficiency. Answers 'How should a coalition's payoff be split fairly?', 'What is each player's Shapley value?'.
Price$0.1per request
MethodPOST
Route/v1/gametheory/shapley-value
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
game-theoryshapley-valuecooperativecoalitionfair-divisionmarginal-contributionpayoffdecision
API URL
Integration docshttps://x402.hexl.dev/v1/gametheory/shapley-valueExample request
{
"players": [
"A",
"B",
"C"
],
"coalitionValues": {
"": 0,
"A": 0,
"B": 0,
"C": 0,
"A,B": 0,
"A,C": 0,
"B,C": 0,
"A,B,C": 1
}
}Example response
{
"players": [
"A",
"B",
"C"
],
"shapleyValues": {
"A": 0.33333333,
"B": 0.33333333,
"C": 0.33333333
},
"grandCoalitionValue": 1,
"sumOfShapley": 1,
"efficient": true,
"interpretation": "Shapley values (fair marginal-contribution shares) sum to the grand-coalition value 1: A=0.333, B=0.333, C=0.333."
}Input schema
{
"type": "object",
"required": [
"players",
"coalitionValues"
],
"properties": {
"players": {
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"A",
"B",
"C"
]
]
},
"coalitionValues": {
"type": "object",
"examples": [
{
"": 0,
"A": 0,
"B": 0,
"C": 0,
"A,B": 0,
"A,C": 0,
"B,C": 0,
"A,B,C": 1
}
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}