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

# Quickstart

> Get started with Dcycle in minutes - choose API, CLI, or MCP

# Quickstart

Get up and running with Dcycle quickly. Choose the approach that fits your use case:

<CardGroup cols={3}>
  <Card title="API Quickstart" icon="code" href="#api-quickstart">
    Build custom integrations
  </Card>

  <Card title="CLI Quickstart" icon="terminal" href="#cli-quickstart">
    Automate with scripts
  </Card>

  <Card title="MCP Quickstart" icon="robot" href="#mcp-quickstart">
    AI-assisted analysis
  </Card>
</CardGroup>

***

## Prerequisites

For all integration methods, you'll need:

* An account at [app.dcycle.io](https://app.dcycle.io)
* API access enabled for your organization

***

## API Quickstart

Build custom integrations with full programmatic control.

### Step 1: Get your API Key

<Steps>
  <Step title="Log in to Dcycle">
    Go to [app.dcycle.io](https://app.dcycle.io) and log in to your account.
  </Step>

  <Step title="Navigate to API settings">
    Go to **Settings → API Keys**
  </Step>

  <Step title="Generate a new API Key">
    Click **"Generate API Key"**

    <Warning>
      The API Key is only shown once. Save it in a secure place.
    </Warning>
  </Step>

  <Step title="Note your Organization ID">
    Copy your Organization ID from the same page.
  </Step>
</Steps>

### Step 2: Make your first API call

Calculate the emissions of a shipment:

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST "https://api.dcycle.io/v1/logistics/requests" \
    -H "x-api-key: YOUR_API_KEY" \
    -H "x-organization-id: YOUR_ORG_ID" \
    -H "Content-Type: application/json" \
    -d '{
      "origin": "Madrid, Spain",
      "destination": "Barcelona, Spain",
      "load": 1000,
      "load_unit": "kg"
    }'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

  response = requests.post(
      "https://api.dcycle.io/v1/logistics/requests",
      headers={
          "x-api-key": "YOUR_API_KEY",
          "x-organization-id": "YOUR_ORG_ID",
      },
      json={
          "origin": "Madrid, Spain",
          "destination": "Barcelona, Spain",
          "load": 1000,
          "load_unit": "kg"
      }
  )

  print(response.json())
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch('https://api.dcycle.io/v1/logistics/requests', {
    method: 'POST',
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'x-organization-id': 'YOUR_ORG_ID',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      origin: 'Madrid, Spain',
      destination: 'Barcelona, Spain',
      load: 1000,
      load_unit: 'kg'
    })
  });

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

### Expected Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "id": "req-123",
  "co2e": 245.5,
  "distance_km": 620.0,
  "origin": "Madrid, Spain",
  "destination": "Barcelona, Spain",
  "methodology": "ISO 14083"
}
```

<Check>
  **Success!** You've calculated your first emissions with the Dcycle API.
</Check>

[Explore the full API Reference →](/api-reference/introduction)

***

## CLI Quickstart

Automate data uploads and manage your operational data from the terminal.

<Note>
  **Early Access** - The CLI is currently available for enterprise customers.
  [Contact us](/docs/support) to learn more.
</Note>

### Step 1: Install the CLI

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
pip install dcycle-cli
```

### Step 2: Authenticate

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dc auth login
```

This opens an interactive prompt for your email and password.

### Step 3: Set your organization

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# List available organizations
dc org list

# Set your active organization
dc org set YOUR_ORG_ID
```

### Step 4: Explore your data

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# List facilities
dc facility list

# List vehicles
dc vehicle list

# Export as JSON
dc vehicle list --format json > vehicles.json
```

### Step 5: Upload data

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Generate a template
dc logistics upload --type requests --template

# Upload your data
dc logistics upload viajes.csv --type requests
```

<Check>
  **Success!** You're now managing operational data via CLI.
</Check>

[Explore CLI Examples →](/cli/examples)

***

## MCP Quickstart

Use AI assistants like Claude to query your operational data with natural language.

<Info>
  **Coming Soon** - The MCP Server is in private beta.
  [Contact us](/docs/support) for early access.
</Info>

### Step 1: Install the MCP Server

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Install with pip
pip install dcycle-mcp

# Or run directly with uvx (no install needed)
uvx dcycle-mcp
```

### Step 2: Configure Claude

Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "mcpServers": {
    "dcycle": {
      "command": "uvx",
      "args": ["dcycle-mcp"],
      "env": {
        "DCYCLE_API_KEY": "your_api_key"
      }
    }
  }
}
```

### Step 3: Ask questions

Once configured, ask Claude about your emissions:

```
"What are our total emissions for 2024?"

"Compare our Scope 1 vs Scope 2 emissions"

"Which facilities have the highest energy consumption?"

"How do our emissions this year compare to last year?"
```

<Check>
  **Success!** You're now using AI-assisted operational data analysis.
</Check>

[Explore MCP Tools →](/mcp/organizations)

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication Deep Dive" icon="key" href="/docs/authentication">
    Learn about API keys, JWT tokens, and security best practices
  </Card>

  <Card title="Core Concepts" icon="lightbulb" href="/docs/core-concepts">
    Understand scopes, emission factors, and calculation methods
  </Card>

  <Card title="Emission Guides" icon="leaf" href="/guides/emissions/overview">
    Step-by-step tutorials for different emission types
  </Card>

  <Card title="Automation Patterns" icon="gears" href="/guides/automation/overview">
    CI/CD pipelines and multi-organization workflows
  </Card>
</CardGroup>

## Troubleshooting

### Error 401: Unauthorized

* Verify your API key is correct and not expired
* Check the header format matches your API version
* Ensure your organization has API access enabled

### Error 403: Forbidden

* Verify your Organization ID is correct
* Check you have permissions for the requested resource

### Need more help?

Check our [Support & Resources](/docs/support) page for detailed troubleshooting and contact information.
