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

# Authenticate with the DeepPCB REST API Using API Keys

> Get your DeepPCB API key from the Integration page and pass it in the x-deeppcb-api-key header on every request.

The DeepPCB API authenticates requests using API keys. You pass your key in the `x-deeppcb-api-key` header on every request. Without a valid key, all endpoints return `401 Unauthorized`.

## Getting Your API Key

**1. Log in to DeepPCB**

Sign in to your DeepPCB account at [app.deeppcb.com](https://app.deeppcb.com).

**2. Navigate to the Integration page**

Go to [app.deeppcb.com/integration](https://app.deeppcb.com/integration) from the sidebar or account menu.

**3. Copy your API key**

Click the copy icon next to your API key to save it to your clipboard. It won't be displayed again after creation.

**4. Store it securely**

Treat your API key like a password. Store it in a secrets manager, CI/CD environment variable, or a `.env` file that is excluded from version control.

> [!WARNING]
>
> Never hard-code your API key in source code. Anyone holding it can submit jobs and spend the compute time on your account.

## Using Your API Key

Store the key as an environment variable and pass it in the `x-deeppcb-api-key` header:

```bash theme={null}
export DEEPPCB_API_KEY="your_api_key_here"
export DEEPPCB_API="<your base URL>"

curl "$DEEPPCB_API/boards/$BOARD_ID" \
  -H "x-deeppcb-api-key: $DEEPPCB_API_KEY"
```

> [!NOTE]
>
> Your base URL ends in `/api/v1`. Copy the exact host from the **Integration** page in the app — it differs for enterprise and self-hosted deployments.

## Checking Your Balance

DeepPCB bills compute time, not a credit unit. Your balance in hours and minutes is on the **Balance** page in the app, and credit and refund events are delivered to your webhook while a job runs. See [Balance & Hours](https://docs.deeppcb.com/account-setup/balance-and-hours.md) and [Pricing & Billing](https://docs.deeppcb.com/concepts/pricing-billing.md).

## Authentication Errors

| Error | Cause | Fix |
| - | - | - |
| 401 Unauthorized | Missing or invalid API key | Check that the `x-deeppcb-api-key` header is present and that your key value is correct |
| 400 Bad Request — `Board.Errors.InsufficientBalance` | Not enough compute time on your balance to start the run | Top up from the Balance page at [app.deeppcb.com](https://app.deeppcb.com) |

> [card] [API Quickstart](https://docs.deeppcb.com/quickstart/api.md)
>
> A complete job end to end — create the board, start the run, follow progress, download the result.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.