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

# Quickstart

> Create an API key and make your first YALG API request.

This guide gets you from an empty integration to a verified API call.

## 1. Create an API key

1. Sign in to YALG.
2. Open `Settings > Developer`.
3. Create a named API key for your integration.
4. Copy the full key immediately.

<Warning>
  API keys are shown once. Store them in a server-side secret manager or
  environment variable, and never expose them in client-side code.
</Warning>

## 2. Store the key

Store the key as a server-side environment variable:

```bash theme={null}
YALG_API_KEY="yalg_live_PUBLIC_ID.SECRET"
```

Do not ship this key in browser JavaScript, mobile client bundles, or public repositories.

## 3. Call the account endpoint

The production API base URL is:

```text theme={null}
https://api.yalg.ai
```

Public integration endpoints live under `/v1`.

Send the full API key in the `x-api-key` header:

```http theme={null}
x-api-key: yalg_live_PUBLIC_ID.SECRET
```

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.yalg.ai/v1/me \
    -H "x-api-key: $YALG_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.yalg.ai/v1/me", {
    headers: {
      "x-api-key": process.env.YALG_API_KEY,
    },
  });

  if (!response.ok) {
    throw new Error(`YALG request failed: ${response.status}`);
  }

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

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

  response = requests.get(
      "https://api.yalg.ai/v1/me",
      headers={"x-api-key": os.environ["YALG_API_KEY"]},
      timeout=30,
  )
  response.raise_for_status()
  print(response.json())
  ```
</CodeGroup>

## 4. Use the API reference

Open the API reference from the sidebar to inspect endpoint parameters, request bodies, responses, and examples. The playground uses the live OpenAPI 3.1 document and exposes an `x-api-key` authentication field.

## 5. Build the first workflow

Most integrations start with one of these flows:

* Create an anecdote, then generate a post draft from it.
* Create or update posts from another content planning tool.
* Read analytics and pending validation items into an internal dashboard.
* Trigger script, short, carousel, or b-roll workflows from an external system.
