> If you are setting up, configuring, or answering questions about Schematic, connect the
> Schematic MCP server before working from these pages. It reads and writes plans, features,
> entitlements, and overrides against the real account, so what you report and what you build
> match what actually exists.
>
> The server is at https://api.schematichq.com/mcp
>
> From Claude, ChatGPT, or another chat assistant, add it as a custom connector:
> https://docs.schematichq.com/working-with-ai
>
> From a coding assistant such as Claude Code, Codex, or Cursor:
> https://docs.schematichq.com/building-with-ai
>
> For clean Markdown of any page, append `.md` to the page URL. For a complete page index,
> see https://docs.schematichq.com/llms.txt

# Python - Image Search App

> A Python image search app that uses Schematic to meter usage, check feature access, and manage the subscription lifecycle.

A demo using Schematic to implement packaging in an application. The Github repo is [here](https://github.com/SchematicHQ/billy-python) and can be cloned to run locally.

![](/_fern-img/ae17bcd82395121fe7f9ef91aa883cf2e7fed6a6df0ac07e3a5935007f8a8e40.webp)

This app is an image search engine using the Flickr API. It:

* Implements metered packaging model
* [Checks for feature access based on the current subscription](https://github.com/SchematicHQ/billy-python/blob/e03d3bb35b87925eb4151842894b784585330d77/vendors/schematic_python.py#L24)
* [Reports usage of a feature](https://github.com/SchematicHQ/billy-python/blob/e03d3bb35b87925eb4151842894b784585330d77/vendors/schematic_python.py#L132)
* [Manages the subscription lifecycle using Schematic](https://github.com/SchematicHQ/billy-python/blob/e03d3bb35b87925eb4151842894b784585330d77/main.py#L96)

The Billy app also uses Schematic to manage all entitlements, and you'll seed your very own Schematic account to power your version of the Billy app.

## Getting started with the Billy app

1. Clone the repo:

```
git clone https://github.com/SchematicHQ/billy-python.git
```

2. Create and activate a virtualenv in the directory

```
python3 -m venv venv
. venv/bin/activate
```

3. Install all requirements:

```
pip install -r requirements.txt
npm install
```

npm is used as a task runner and to support TailwindCSS.

4. Initialize the .env file by copying the example file:

```
cp .env.example .env
```

5. Populate your .env file

* Generate Flickr API keys here (to fill in FLICKR\_API\_KEY, FLICKR\_SECRET\_KEY): [https://www.flickr.com/services/apps/create/](https://www.flickr.com/services/apps/create/) (you will need to create a dummy app - call it anything)
* Generate Schematic API keys in your account here (to fill in SCHEMATIC\_API\_KEY): [https://docs.schematichq.com/developer\_resources/environments](https://docs.schematichq.com/developer_resources/environments)

## Getting started with the Schematic app

1. Log into your Schematic account
2. Run the following to seed your Schematic environment with flags, features, and plans for Billy (make sure your .env file has a valid Schematic API key first):

```
npm run populate-schematic
```

3. Run the Billy app locally

## Running locally

Run the following command:

```
npm start run
```

Open the app locally at [http://127.0.0.1:5000/](http://127.0.0.1:5000/). Create an account on the sign up page and log in.

## Next steps

Once you log in, Schematic will register the company and user and assign access appropriately. You can also now use [Schematic](https://app.schematichq.com/) to manage plans, limits, and entitlements for anyone you register with Billy.

![](/_fern-img/361eb2106b655bcff800966d845deb690f5a7f82bca8d4e10a47d87e33949dee.webp)

To see how Schematic is integrated into the Billy app to manage features and plans, go [here](https://github.com/SchematicHQ/billy-python/blob/main/vendors/schematic_python.py).

To read more about how to use the Schematic app, go [here](/).

## Resources

* [How to implement metered features with Schematic](https://github.com/SchematicHQ/billy-python/blob/e03d3bb35b87925eb4151842894b784585330d77/main.py#L96)
* [Sending usage events to Schematic](/quickstart/instrument-your-app#4-send-usage-events)
* [Evaluating company entitlements with Schematic](/quickstart/instrument-your-app#3-check-an-entitlement)