Catalog/gen-partition-groups

Generators

Seeded group partition API

Shuffles items by seed then deals them round-robin into N balanced groups, returning the groups and their sizes. The value-add: reproducible fair team/bucket assignment. Answers 'How do I split items into N random balanced groups?', 'Deterministically partition this list.'.

Price$0.01per request
MethodPOST
Route/v1/generate/partition-groups
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
partitiongroupsteamssplitdeterministicseedbalancedgenerate
API URLhttps://x402.hexl.dev/v1/generate/partition-groups
Integration docs
Example request
{
  "items": [
    1,
    2,
    3,
    4,
    5,
    6
  ],
  "groups": 3,
  "seed": "abc"
}
Example response
{
  "groups": [
    [
      5,
      1
    ],
    [
      2,
      6
    ],
    [
      3,
      4
    ]
  ],
  "groupCount": 3,
  "sizes": [
    2,
    2,
    2
  ],
  "seed": "abc",
  "deterministic": true,
  "interpretation": "Items shuffled then dealt round-robin into 3 balanced groups."
}
Input schema
{
  "type": "object",
  "required": [
    "items",
    "groups",
    "seed"
  ],
  "properties": {
    "items": {
      "type": "array",
      "examples": [
        [
          1,
          2,
          3,
          4,
          5,
          6
        ]
      ]
    },
    "groups": {
      "type": "integer",
      "minimum": 1,
      "examples": [
        3
      ]
    },
    "seed": {
      "type": [
        "string",
        "number"
      ],
      "examples": [
        "abc"
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}