---
title: Getting started with the API
sidebar_label: Getting started
sidebar_position: 2
description: "Get an ElectroSwap API key in about five minutes: connect a wallet, sign in, create a key, make your first call, and top up credits with DYNO."
keywords: [api key, getting started, api quickstart, dyno credits, developer portal]
---

# Getting started

You need three things: an Electroneum wallet, some DYNO, and about five minutes.

## 1. Sign in

Open [the developer page](https://app.electroswap.io/developer) and connect your
wallet. You will be asked to sign a short message.

**That signature does not authorise a transaction and never will.** It proves
you control the address, and the address *is* your account — there is no
password, no email to confirm, and nothing to reset. If you lose access to the
wallet you lose access to the account, which is the honest trade for not having
a password to steal.

## 2. Create a key

Give it a label you will recognise in six months (`ci`, `dashboard`,
`nightly-report`) and click create.

**The key is shown once.** We store only its SHA-256 hash, so we could not show
it to you again if we wanted to. Put it in your secrets store before you close
the dialog. If you lose it, rotate it — that is what rotation is for.

Keys look like this:

```
esk_live_1a2b3c4d_9xKp2mQ7vR4tY8wA1sD5fG3hJ6kL0nB4cX7zM9qE2rT
```

Everything after `esk_live_` up to the second underscore is the *prefix*. It is
derived from the key itself, so we can show it in a dashboard and in a log
without showing anything usable — and a mistyped key is rejected by arithmetic
before it reaches a database.

## 3. Call the API

```bash
curl -s "https://electroswap.io/public-api/v1/prices/etn" \
  -H "Authorization: Bearer $ELECTROSWAP_API_KEY"
```

Every metered response tells you what it cost and what you have left:

```
X-Credits-Cost: 25
X-Credits-Remaining: 49999975
```

## 4. Add credits

A new account has **zero** credits. There is no free tier.

Two ways to get them:

- **Buy them.** [Top up](https://app.electroswap.io/developer) with DYNO.
  $50 of DYNO is 50,000,000 credits. See [credits and pricing](./credits-and-pricing).
- **Hold DYNO.** Holders accrue free credits every hour they hold. See
  [holder tiers](./credits-and-pricing.md#holder-tiers).

## Before you build

Read the [cost table](./reference.mdx#cost-table) once. It is short, and two things
in it will change how you write your client:

- **Batching is always cheaper than looping.** Twenty prices in one call cost
  300 credits; twenty single calls cost 1,000.
- **A rejected request costs nothing.** A bad `limit`, a malformed address, or
  any failure of ours is free. You do not need to be defensive about exploring.
