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

# Overview

> Cuprice API reference

## Base URL

```
https://cuprice.io
```

## Two API types

Cuprice has two types of API endpoints:

**Public Endpoints** — No authentication needed. Used by the embed widget.

**API v1** — Requires an [API key](/api-reference/authentication). Full CRUD for projects, features, and plans.

## Authentication

| Endpoint             | Auth                                 |
| -------------------- | ------------------------------------ |
| Share API            | None (public)                        |
| Receipt API          | None (public, uses project's Stripe) |
| Checkout API         | None (public, uses project's Stripe) |
| API v1 (`/api/v1/*`) | `Authorization: Bearer cpk_...`      |

## Public Endpoints

<CardGroup cols={2}>
  <Card title="GET /api/share/{shareId}" href="/api-reference/share">
    Get project data (plans, features, theme)
  </Card>

  <Card title="GET /api/stripe/receipt" href="/api-reference/receipt">
    Get purchase details from a Stripe session
  </Card>

  <Card title="POST /api/stripe/checkout" href="/api-reference/checkout">
    Create checkout session for a regular plan
  </Card>

  <Card title="POST /api/stripe/checkout/custom" href="/api-reference/custom-checkout">
    Create checkout session for a custom plan
  </Card>
</CardGroup>

## API v1 — Projects, Features, Plans

<CardGroup cols={2}>
  <Card title="Projects" icon="folder" href="/api-reference/v1/list-projects">
    List, create, update, delete projects. Update theme and custom CSS.
  </Card>

  <Card title="Features" icon="puzzle-piece" href="/api-reference/v1/list-features">
    Manage feature backlog — standard, limits, and usage-based features.
  </Card>

  <Card title="Plans" icon="list" href="/api-reference/v1/list-plans">
    Create, update, delete, and duplicate pricing plans.
  </Card>

  <Card title="Plan Features" icon="link" href="/api-reference/v1/list-plan-features">
    Assign features to plans, set multipliers, remove features.
  </Card>
</CardGroup>

## Quick Example

```bash theme={null}
# List your projects
curl https://cuprice.io/api/v1/projects \
  -H "Authorization: Bearer cpk_your_key_here"

# Create a feature
curl https://cuprice.io/api/v1/projects/my-saas/features \
  -X POST \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "AI Chat", "basePrice": 10}'

# Update theme with custom CSS
curl https://cuprice.io/api/v1/projects/my-saas \
  -X PUT \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"theme": {"primaryColor": "#7C3AED", "customCSS": ".cuprice-pricing-card { border-radius: 24px !important; }"}}'
```
