Skip to main content
POST
/
v1
/
graphs
/
parse
cURL
curl -X POST 'https://api.supermodeltools.com/v1/graphs/parse' \
  -H 'Idempotency-Key: <idempotency-key>' \
  -H 'X-Api-Key: <api-key>' \
  -F 'file=@/path/to/your/repo-snapshot.zip;type=application/zip'
{
  "status": "completed",
  "jobId": "abc-123-def",
  "result": {
    "generatedAt": "2025-02-05 15:42:10.000000000 Z",
    "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 (job completed)

Async response envelope for code graph operations.

status
enum<string>
required

Current status of the job.

Available options:
pending,
processing,
completed,
failed
jobId
string
required

Unique identifier for the job.

retryAfter
integer<int32>

Recommended seconds to wait before polling again.

error
string

Error message (present when status is failed).

result
object

The result (present when status is completed).