> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supermodeltools.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Generate your first code graph in minutes

This guide will walk you through generating a **Dependency Graph** from a local repository.

## Prerequisites

1. **API Key**: You'll need a Supermodel API key. Get one from the [Dashboard](https://dashboard.supermodeltools.com/).
2. **Codebase**: A local folder containing the code you want to analyze.
3. **Tools**: `zip` and `curl` installed on your machine.

## Step 1: Prepare your code

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.

```bash theme={null}
# Zip your current directory, excluding hidden files and node_modules
zip -r repo.zip . -x ".*" -x "**/.*" -x "node_modules/*"
```

## Step 2: Submit a graph generation job

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.

```bash theme={null}
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:

```json theme={null}
{
  "status": "pending",
  "jobId": "550e8400-e29b-41d4-a716-446655440000",
  "retryAfter": 10
}
```

<Tip>
  The `$(uuidgen)` command generates a unique ID automatically on macOS and Linux. On Windows, you can use `[guid]::NewGuid()` in PowerShell.
</Tip>

## Step 3: Poll for results

Graph generation is asynchronous. Poll by re-submitting the same request with the **same Idempotency-Key** until the job completes:

```bash theme={null}
# 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:

```json theme={null}
{
  "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"
        }
      ]
    }
  }
}
```

<Info>
  **Using the SDK?** The `@supermodeltools/sdk` package handles polling automatically. See the [Async Polling](/async-polling) guide for details.
</Info>

## Next Steps

Explore other graph types to get different insights into your code:

<CardGroup cols={2}>
  <Card title="Call Graph" icon="diagram-project" href="/api-reference/data-plane/call-graph">
    Map function-level calls and execution flow.
  </Card>

  <Card title="Domain Graph" icon="sitemap" href="/api-reference/data-plane/domain-graph">
    Identify high-level business domains and boundaries.
  </Card>
</CardGroup>
