Demonstrating Nevermined payments-py
functionality:
- Serve an ephemeral endpoint from a python function, using Modal
- Paywall the endpoint from one Nevermined account
- Purchase a subscription for the endpoint from another account, and use it
- Create two accounts on https://testing.nevermined.app/en (one to create a service, and the other to consume it)
- For both, create an API key in the user-settings page, and save in a
.env
file at the root of this repo, alongside the consumer's Nevermined wallet address:
CREATOR_API_KEY='...'
CONSUMER_API_KEY='...'
CONSUMER_ADDRESS='...'
- For the consumer, get some free USDC on Arbitrum Sepolia at https://faucet.circle.com/
- Install dependencies
python3.10 -m poetry install
python3.10 -m poetry shell
- Create a Modal account, and run setup locally
python -m modal setup
You should now have a ~/.modal.toml
file.
python main.py