| title | description | icon |
|---|---|---|
Quickstart |
Generate your first code graph in minutes |
bolt |
This guide will walk you through generating a Dependency Graph from a local repository.
- API Key: You'll need a Supermodel API key. Get one from the Dashboard.
- Codebase: A local folder containing the code you want to analyze.
- Tools:
zipandcurlinstalled on your machine.
The Supermodel API accepts code as a zipped archive. Navigate to your project folder and create a zip file, excluding hidden files like .git or node_modules to keep the upload size small.
# Zip your current directory, excluding hidden files and node_modules
zip -r repo.zip . -x ".*" -x "**/.*" -x "node_modules/*"Use the dependency endpoint to submit a graph generation job. Replace <your-api-key> with your actual key. The Idempotency-Key should be a unique value (like a UUID) for each request.
IDEMPOTENCY_KEY=$(uuidgen)
curl --request POST \
--url https://api.supermodeltools.com/v1/graphs/dependency \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--header 'X-Api-Key: <your-api-key>' \
--header 'Content-Type: multipart/form-data' \
--form file='@repo.zip'The API returns an HTTP 202 Accepted response with the job status:
{
"status": "pending",
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"retryAfter": 10
}Graph generation is asynchronous. Poll by re-submitting the same request with the same Idempotency-Key until the job completes:
# Re-submit the same request to check job status
curl --request POST \
--url https://api.supermodeltools.com/v1/graphs/dependency \
--header "Idempotency-Key: $IDEMPOTENCY_KEY" \
--header 'X-Api-Key: <your-api-key>' \
--header 'Content-Type: multipart/form-data' \
--form file='@repo.zip'When the job completes, you receive an HTTP 200 response with the graph inside the result field:
{
"status": "completed",
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"result": {
"graph": {
"nodes": [
{
"id": "src/main.ts",
"labels": ["File"],
"properties": { "name": "main.ts" }
},
{
"id": "src/utils.ts",
"labels": ["File"],
"properties": { "name": "utils.ts" }
}
],
"relationships": [
{
"type": "imports",
"startNode": "src/main.ts",
"endNode": "src/utils.ts"
}
]
}
}
}Explore other graph types to get different insights into your code:
Map function-level calls and execution flow. Identify high-level business domains and boundaries.