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

# Quick Start

> Get up and running with the DealMachine API in 5 minutes

Get your first API response in under 5 minutes. Choose your path:

<CardGroup cols={2}>
  <Card title="CLI (Fastest)" icon="terminal" href="#option-1-dealmachine-cli">
    One command to authenticate, instant access
  </Card>

  <Card title="API Key" icon="key" href="#option-2-api-key">
    Create a key in the dashboard, call the API directly
  </Card>
</CardGroup>

***

## Option 1: DealMachine CLI

### Step 1: Login

```bash theme={null}
npm install -g dealmachine
dm login
```

Your browser opens. Sign in and approve the device. That's it.

### Step 2: Check Your Account

```bash theme={null}
dm account
```

```
Account
----------------------------------------
Organization:  My Company
Org ID:        1
Created:       Jan 1, 2024
Auth Type:     api_key
```

### Step 3: Use the API Key Programmatically

The CLI stores your API key at `~/.dealmachine/config.json`. Use it in your code:

```typescript theme={null}
import { readFileSync } from 'fs';
import { join } from 'path';
import { homedir } from 'os';

const config = JSON.parse(readFileSync(join(homedir(), '.dealmachine', 'config.json'), 'utf-8'));

const response = await fetch('https://api.v2.dealmachine.com/v1/account', {
  headers: { Authorization: `Bearer ${config.apiKey}` },
});

const { data } = await response.json();
console.log(data.organization.name);
```

***

## Option 2: API Key

### Step 1: Create an API Key

1. Go to [Developer Settings](https://dm-next.dealmachine.com/settings/developer)
2. Click **Create API Key**
3. Copy the key (starts with `dm_sk_live_`)

<Warning>Copy the key now. It won't be shown again.</Warning>

### Step 2: Make Your First Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.v2.dealmachine.com/v1/account \
    -H "Authorization: Bearer dm_sk_live_YOUR_KEY_HERE"
  ```

  ```typescript Node.js theme={null}
  const response = await fetch('https://api.v2.dealmachine.com/v1/account', {
    headers: {
      Authorization: 'Bearer dm_sk_live_YOUR_KEY_HERE',
    },
  });

  const account = await response.json();
  console.log(account);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.v2.dealmachine.com/v1/account',
      headers={'Authorization': 'Bearer dm_sk_live_YOUR_KEY_HERE'}
  )

  print(response.json())
  ```
</CodeGroup>

### Step 3: See the Response

```json theme={null}
{
  "data": {
    "organization": {
      "id": 1,
      "name": "My Company",
      "createdAt": "2024-01-01T00:00:00.000Z"
    },
    "user": {
      "id": null,
      "authType": "api_key"
    },
    "plan": {
      "name": "Basic",
      "enrichment_credit_cap": 10000,
      "is_paid": true,
      "billing_cycle_start": "2024-01-01T00:00:00.000Z",
      "billing_cycle_end": "2024-02-01T00:00:00.000Z"
    }
  }
}
```

You're authenticated and ready to go.

***

## What's Next

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference">
    Browse all available endpoints
  </Card>

  <Card title="CLI Commands" icon="terminal" href="/cli/commands">
    Full CLI command reference
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Deep dive into auth options
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/errors">
    Understand error responses
  </Card>
</CardGroup>
