Skip to main content
POST
/
v1
/
graphs
/
parse
Parse graph
curl --request POST \
  --url https://api.supermodeltools.com/v1/graphs/parse \
  --header 'Content-Type: multipart/form-data' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Api-Key: <api-key>' \
  --form file='@example-file'
{
  "generatedAt": "2025-02-05T15:42:10.000Z",
  "message": "Parse graph generated successfully",
  "stats": {
    "filesProcessed": 1,
    "classes": 0,
    "functions": 1,
    "types": 0,
    "processingTimeMs": 12
  },
  "graph": {
    "nodes": [
      {
        "id": "ast:src/index.ts:1:0",
        "labels": [
          "Program"
        ],
        "properties": {
          "kind": "Program"
        }
      },
      {
        "id": "ast:src/index.ts:3:2",
        "labels": [
          "FunctionDeclaration"
        ],
        "properties": {
          "name": "init"
        }
      }
    ],
    "relationships": [
      {
        "id": "ast:src/index.ts:1:0_contains_ast:src/index.ts:3:2",
        "type": "contains",
        "startNode": "ast:src/index.ts:1:0",
        "endNode": "ast:src/index.ts:3:2",
        "properties": {
          "order": 1
        }
      }
    ]
  }
}

Authorizations

X-Api-Key
string
header
required

API key issued by the control plane for accessing data plane resources.

Headers

Idempotency-Key
string
required

Unique identifier for this request for idempotency and tracing.

Body

multipart/form-data
file
file
required

Zipped repository archive containing the code to analyze.

Response

Parse graph

graph
object
required
generatedAt
string<date-time>
message
string
stats
object