Generators
Seeded graph/tree API
Generates a reproducible graph from a seed: a tree, a DAG (extra forward edges), or a random directed graph, returning nodes and edges. The value-add: stable graph/tree fixtures with guaranteed acyclicity for tree/dag modes and configurable edge density. Answers 'Generate a deterministic tree/DAG/graph', 'How do I make a reproducible graph fixture?'.
Price$0.02per request
MethodPOST
Route/v1/generate/graph
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
graphtreedagnodesedgesdeterministicseedgenerate
API URL
Integration docshttps://x402.hexl.dev/v1/generate/graphExample request
{
"nodes": 5,
"kind": "tree",
"seed": "abc"
}Example response
{
"nodes": [
"n0",
"n1",
"n2",
"n3",
"n4"
],
"edges": [
{
"from": "n0",
"to": "n1"
},
{
"from": "n1",
"to": "n2"
},
{
"from": "n0",
"to": "n3"
},
{
"from": "n3",
"to": "n4"
}
],
"nodeCount": 5,
"edgeCount": 4,
"kind": "tree",
"acyclic": true,
"seed": "abc",
"deterministic": true,
"interpretation": "Reproducible tree with 5 nodes and 4 edges; ideal as a stable graph fixture."
}Input schema
{
"type": "object",
"required": [
"nodes",
"seed"
],
"properties": {
"nodes": {
"type": "integer",
"minimum": 2,
"maximum": 1000,
"examples": [
5
]
},
"kind": {
"type": "string",
"enum": [
"tree",
"dag",
"random"
],
"examples": [
"tree"
]
},
"edgeFactor": {
"type": "number",
"minimum": 0,
"examples": [
2
]
},
"seed": {
"type": [
"string",
"number"
],
"examples": [
"abc"
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}