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

# Quickstart: API Keys

> Use bearer API keys and pre-purchased credits to retrieve robust article summaries.

Use API keys when your agent, backend job, or research pipeline wants a
traditional bearer token instead of wallet-based x402 or MPP payments.

An API key authorizes paid article reads with
`Authorization: Bearer pk_drip_...` and spends your pre-purchased credits.
Search and publication discovery routes are free.

Each successful paid request returns a robust synthesized summary of a
publisher's article. Access is not permanent, and every request spends credits.

For production usage, follow [Errors & Retries](/concepts/errors-retries).

<Steps>
  <Step title="Create an API key and add credits">
    Sign in to Drip, then create a key from the
    [API Keys dashboard](https://dripstack.xyz/dashboard/api-keys). Copy the key
    when it is shown; raw keys are not displayed again.

    Add balance from the
    [Credits dashboard](https://dripstack.xyz/dashboard/credits?section=topup).
  </Step>

  <Step title="Search across supported sources">
    Search across all supported financial newsletters and blogs for posts
    relevant to your research question.

    ```bash theme={null}
    curl "https://dripstack.xyz/api/v1/search?q=DeFi%20security&limit=20"
    ```

    ```jsonc theme={null}
    {
      "mode": "hybrid",
      "query": "DeFi security",
      "matchConfidence": "strong",
      "count": 20,
      "items": [
        {
          "publicationSlug": "unchainedcrypto.beehiiv.com",
          "slug": "defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit",
          "title": "DeFi United Unveils Plan to Restore rsETH After $292M Kelp DAO Exploit",
          "publishedAt": "2026-04-28T11:00:00.000Z"
        },
        {
          "publicationSlug": "unchainedcrypto.beehiiv.com",
          "slug": "the-kelp-dao-exploit-bill-is-coming-due",
          "title": "The Kelp DAO Exploit Bill Is Coming Due",
          "publishedAt": "2026-04-21T11:00:56.000Z"
        }
        // ...18 more results
      ]
    }
    ```

    Each result includes `publicationSlug` and `slug`. Use those two values to
    build the paid article URL. Search results are candidates, not paid article
    summaries.
  </Step>

  <Step title="Query a specific publication">
    If you already know which source you care about, find the publication slug
    and list its ready posts.

    ```bash theme={null}
    curl "https://dripstack.xyz/api/v1/publications/search?q=Unchained%20Daily%20Newsletter"
    ```

    ```bash theme={null}
    curl "https://dripstack.xyz/api/v1/publications/unchainedcrypto.beehiiv.com?limit=20"
    ```

    ```jsonc theme={null}
    {
      "slug": "unchainedcrypto.beehiiv.com",
      "title": "Unchained Daily Newsletter",
      "posts": [
        {
          "slug": "defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit",
          "title": "DeFi United Unveils Plan to Restore rsETH After $292M Kelp DAO Exploit",
          "publishedAt": "2026-04-28T11:00:00.000Z",
          "priceCents": null
        },
        {
          "slug": "fork-in-the-road",
          "title": "Fork in the Road",
          "publishedAt": "2026-04-27T11:30:00.000Z",
          "priceCents": null
        }
        // ...18 more posts
      ]
    }
    ```

    The publication response includes recent posts with `slug`, `title`,
    `publishedAt`, and `priceCents`. If `priceCents` is `null`, the charged `200`
    response provides the current price in `paymentInfo.amountUsd`.
  </Step>

  <Step title="Retrieve an article summary with your API key">
    Use the `publicationSlug` and `slug` from search or publication lookup to
    call the paid article route. A successful response returns `200` with
    article metadata and `synthesizedSummary`. The request debits purchased
    credits each time it is made.
  </Step>
</Steps>

## Request examples

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    export DRIP_API_KEY="pk_drip_YOUR_KEY"
    export PUBLICATION_SLUG="unchainedcrypto.beehiiv.com"
    export POST_SLUG="defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit"

    curl -s \
      "https://dripstack.xyz/api/v1/publications/$PUBLICATION_SLUG/$POST_SLUG" \
      -H "Authorization: Bearer $DRIP_API_KEY"
    ```
  </Tab>

  <Tab title="JavaScript">
    ```typescript theme={null}
    const baseUrl = "https://dripstack.xyz";
    const publicationSlug = "unchainedcrypto.beehiiv.com";
    const postSlug =
      "defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit";

    const response = await fetch(
      `${baseUrl}/api/v1/publications/${publicationSlug}/${postSlug}`,
      {
        headers: {
          Authorization: `Bearer ${process.env.DRIP_API_KEY}`,
        },
      },
    );

    if (response.status === 403) {
      throw new Error("Insufficient purchased credits. Top up before retrying.");
    }

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

    const post = await response.json();
    console.log(post.title);
    console.log(post.synthesizedSummary);
    ```
  </Tab>

  <Tab title="Python">
    ```bash theme={null}
    pip install requests
    ```

    ```python theme={null}
    import os

    import requests

    base_url = "https://dripstack.xyz"
    publication_slug = "unchainedcrypto.beehiiv.com"
    post_slug = (
        "defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit"
    )

    response = requests.get(
        f"{base_url}/api/v1/publications/{publication_slug}/{post_slug}",
        headers={"Authorization": f"Bearer {os.environ['DRIP_API_KEY']}"},
        timeout=30,
    )

    if response.status_code == 403:
        raise RuntimeError("Insufficient purchased credits. Top up before retrying.")

    response.raise_for_status()

    post = response.json()
    print(post["title"])
    print(post["synthesizedSummary"])
    ```
  </Tab>
</Tabs>

## Example response

```json theme={null}
{
  "publicationSlug": "unchainedcrypto.beehiiv.com",
  "slug": "defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit",
  "title": "DeFi United Unveils Plan to Restore rsETH After $292M Kelp DAO Exploit",
  "author": "Unchained Daily",
  "publishedAt": "2026-04-28T11:00:00.000Z",
  "url": "https://unchainedcrypto.beehiiv.com/p/defi-united-unveils-plan-to-restore-rseth-after-292m-kelp-dao-exploit",
  "synthesizedSummary": "The article explains DeFi United's recovery proposal following the Kelp DAO exploit, including how affected rsETH holders may be made whole...",
  "paymentInfo": {
    "amountUsd": "0.50",
    "protocol": "credits",
    "spendSource": "purchased"
  }
}
```

The response contains a robust synthesized summary and source metadata.
Repeating the request spends credits again.

## Common responses

| Status | Meaning                      | Action                                  |
| ------ | ---------------------------- | --------------------------------------- |
| `200`  | Summary returned and charged | Use `synthesizedSummary` in research    |
| `401`  | Invalid API key              | Check the bearer token                  |
| `403`  | Insufficient credits         | Top up purchased credits                |
| `404`  | Post or publication missing  | Verify `publicationSlug` and `postSlug` |
| `503`  | Summary is not ready         | Retry later; no credits were charged    |

<Warning>
  Keep API keys server-side. Do not ship `pk_drip_...` keys in browser code, public repositories, or
  agent traces.
</Warning>

## Error response examples

An invalid or revoked API key returns:

```json theme={null}
{
  "error": "Invalid API key."
}
```

If the summary has not finished processing, no credits are charged:

```json theme={null}
{
  "error": "Post summary is not ready yet.",
  "code": "summary_not_ready"
}
```
