# Quickstart

> Make your first Eden API call in two minutes, first with the free test key, then with your own key.

Every call is a `GET` to `https://api.eden.so/v1` with your key in the `Authorization` header.
Start with the free test key `eden_test_demo`. It needs no account.

## 1. Call it with the test key

```bash
curl -G "https://api.eden.so/v1/transcripts" \
  --data-urlencode "url=https://www.youtube.com/watch?v=Xyz123AbC45" \
  -H "Authorization: Bearer eden_test_demo"
```

You get fixed sample data back, for free. Test answers also carry `"test": true`.

```json
{
  "ok": true,
  "url": "https://www.youtube.com/watch?v=Xyz123AbC45",
  "platform": "youtube",
  "post_id": "sample-post-0",
  "language": "en",
  "duration_seconds": 540,
  "transcript": {
    "text": "Most people think they need more time to write. You need a system. Here is mine. Step one, I keep every idea in one place...",
    "status": "available",
    "truncated": false,
    "source": "cache"
  },
  "on_screen_text": { "text": null, "status": "not-supported" },
  "slide_text": { "text": null, "status": "not-supported", "truncated": false },
  "test": true
}
```

## 2. Get your own key

[Get a free key](https://app.eden.so/?settings=api&from=developers)

Sign up or sign in, and Eden opens **Settings → API**. Click **Generate key** and copy it. Eden shows
it once. Every workspace starts with 50 free calls. See [Keys](https://eden.so/developers/keys/) for the details.

Save it as an environment variable so it never ends up in your code:

```bash
export EDEN_API_KEY="paste-your-key-here"
```

## 3. Make a real call

Swap the test key for yours and use a real link:

```bash
curl -G "https://api.eden.so/v1/transcripts" \
  --data-urlencode "url=https://www.instagram.com/reel/your-reel-id/" \
  -H "Authorization: Bearer $EDEN_API_KEY"
```

The same call with `fetch` (Node 18 or newer):

```js
const params = new URLSearchParams({ url: "https://www.instagram.com/reel/your-reel-id/" });
const res = await fetch(`https://api.eden.so/v1/transcripts?${params}`, {
  headers: { Authorization: `Bearer ${process.env.EDEN_API_KEY}` },
});
const data = await res.json();

if (res.status === 202) {
  // Eden is fetching this post for the first time. Wait, then call again.
  console.log(`Try again in ${data.retry_after_seconds} seconds.`);
} else if (!data.ok) {
  throw new Error(`${data.status}: ${data.message}`);
} else {
  console.log(data.transcript.text);
}
```

A link Eden has never seen can answer `202` while it fetches the post. Wait `retry_after_seconds`
and call again. Waiting answers are free.

## What every answer looks like

- A good answer is `{ "ok": true, ... }` with status `200`.
- A failed one is `{ "ok": false, "status": "...", "message": "..." }` with a matching HTTP code. See
  [Errors](https://eden.so/developers/errors/).
- Each successful call costs 0.1 credit. Failed calls and empty results are free. See
  [Credits and pricing](https://eden.so/developers/credits/).

> **Keep your key on the server**
>
> Anyone with your key can spend your credits. Call Eden from your server or a serverless function,
> never from code that runs in the browser or ships in an app.

## Next

- [Transcripts](https://eden.so/developers/transcripts/), [Posts](https://eden.so/developers/posts/), and [Creators](https://eden.so/developers/creators/) list every route.
- [Build with Claude](https://eden.so/developers/build-with-claude/) has a prompt that wires an app to Eden for you.
