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

# Quickstart

> From API key to your first successful Crevio call in under five minutes — then create your first product the right way.

**Get an API key, make your first call, and create a real product — in three surfaces (cURL, SDK, MCP) and under five minutes.**

The Crevio API is a REST API. Every request is authenticated with a bearer token and hits `https://api.crevio.co/v1`. The official [`@crevio/sdk`](/developer/guides/sdk) wraps it with types and retries, and the same operations are exposed to AI agents over [MCP](/developer/mcp).

## Get your key and make a call

<Steps>
  <Step title="Create an API key">
    In your dashboard, go to **Settings → Developer** and click **New API token**. Give it a descriptive name. The token is shown **once** — copy it and store it in an environment variable.

    ```bash theme={null}
    export CREVIO_API_TOKEN="your_token_here"
    ```

    <Warning>
      Treat tokens like passwords. Never commit them or ship them in client-side code. A token acts on behalf of your account.
    </Warning>
  </Step>

  <Step title="Make your first call">
    The friendliest first call is `GET /status` — a lightweight health check that confirms your token works and tells you which account you're authenticated as.

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl https://api.crevio.co/v1/status \
          -H "Authorization: Bearer $CREVIO_API_TOKEN"
        ```
      </Tab>

      <Tab title="SDK (TypeScript)">
        ```typescript theme={null}
        import { Crevio } from "@crevio/sdk";

        const crevio = new Crevio({ apiKeyAuth: process.env.CREVIO_API_TOKEN });

        const status = await crevio.status.get();
        console.log(status.status, status.account.name);
        ```
      </Tab>

      <Tab title="MCP (agent)">
        With Crevio's MCP server connected, just ask:

        ```text theme={null}
        Check my Crevio status and tell me which account I'm connected to.
        ```
      </Tab>
    </Tabs>

    A successful response looks like:

    ```json theme={null}
    {
      "status": "operational",
      "api_version": "v1",
      "authenticated": true,
      "account": { "id": "acct_abc123", "name": "Acme Studio" },
      "documentation_url": "https://docs.crevio.co",
      "timestamp": "2026-06-21T10:30:00Z"
    }
    ```
  </Step>

  <Step title="List your products">
    Now hit a real resource. List endpoints return a `{ object: "list", data: [...] }` envelope.

    <Tabs>
      <Tab title="cURL">
        ```bash theme={null}
        curl "https://api.crevio.co/v1/products?limit=5" \
          -H "Authorization: Bearer $CREVIO_API_TOKEN"
        ```
      </Tab>

      <Tab title="SDK (TypeScript)">
        ```typescript theme={null}
        const products = await crevio.products.list({ limit: 5 });
        for (const product of products) {
          console.log(product.id, product.name);
        }
        ```
      </Tab>

      <Tab title="MCP (agent)">
        ```text theme={null}
        List my five most recent Crevio products.
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Create your first product the right way

Publishing a product takes **three calls in order**. A product can't go live without at least one price variant, so creating one with `status: "active"` in a single call fails with `422`. Do it like this:

<Steps>
  <Step title="Create the product as a draft">
    Parameters go at the **top level** (not wrapped in a `product` key).

    ```bash theme={null}
    curl https://api.crevio.co/v1/products \
      -H "Authorization: Bearer $CREVIO_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Intro to Watercolor",
        "status": "draft",
        "description": "A beginner-friendly painting course."
      }'
    ```

    The response includes the new id, e.g. `"id": "prod_abc123"`.
  </Step>

  <Step title="Add a price variant">
    Reference the product by its **bare association name** (`product`, not `product_id`) and its prefixed id. Money is in **integer cents** with a **lowercase** ISO currency.

    ```bash theme={null}
    curl https://api.crevio.co/v1/price_variants \
      -H "Authorization: Bearer $CREVIO_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "product": "prod_abc123",
        "name": "Full course",
        "amount_type": "fixed",
        "amount": 4900,
        "currency": "usd",
        "billing_type": "one_time"
      }'
    ```

    `amount: 4900` is \$49.00. The response id looks like `"id": "price_xyz789"`.
  </Step>

  <Step title="Publish the product">
    Now that a price exists, flip the product to `active` with a `PATCH`.

    ```bash theme={null}
    curl -X PATCH https://api.crevio.co/v1/products/prod_abc123 \
      -H "Authorization: Bearer $CREVIO_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "status": "active" }'
    ```
  </Step>
</Steps>

<Tip>
  Prefer to skip the choreography? Ask the agent over MCP: *"Create a one-time \$49 course called Intro to Watercolor and publish it."* It runs the same three steps for you.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Conventions" icon="list-check" href="/developer/guides/conventions">
    The full set of request and response rules — read before building.
  </Card>

  <Card title="Errors" icon="triangle-exclamation" href="/developer/guides/errors">
    Decode every status code and fix it fast.
  </Card>

  <Card title="TypeScript SDK" icon="npm" href="/developer/guides/sdk">
    Type-safe access with automatic retries.
  </Card>

  <Card title="Usage & billing" icon="credit-card" href="/developer/guides/usage-billing">
    How metered pay-per-call credits work.
  </Card>
</CardGroup>
