Skip to main content

A Python wrapper for Chipp API

Project description

💳 Chipp.ai for Python

⚡ Building the pay-per-generation monetization platform for AI applications ⚡

PyPI version Downloads Documentation Status Twitter

Be sure to sign up for an account and complete Stripe onboarding at https://app.chipp.ai

Installation

pip install chippai

Dependencies

This package requires requests for making API calls. However, it will be automatically installed when you install the chippai package using pip.

Usage

from chippai import Chipp

chipp = Chipp(api_key="your-api-key-from-Chipp-dashboard")

# userId needs to come from your database or auth session
user = chipp.get_user(user_id="a-unique-identifier-for-user")

# If the user is None, the user does not exist in the Chipp system and needs to be created
if user is None:
    user = chipp.create_user(user_id="a-unique-identifier-for-user")

# Get the number of credits remaining for this user
num_chipps = user.get_credits()

# Deduct credits from this user
user.deduct_credits(1)

# Generate a payment URL where this user can choose their preferred packages of credits and buy more.
# Pass in a redirect URL to bring your user back to your app after the user payment succeeds
url = user.get_packages_url(return_to_url="https://your-app.com/wherever-user-was")

Further Documentation

For a more detailed guide and advanced usage patterns, refer to the official documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chippai-0.1.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chippai-0.1.2-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file chippai-0.1.2.tar.gz.

File metadata

  • Download URL: chippai-0.1.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for chippai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d845acb444b30d209f3150bf6a2a0c4773343597ddcc8bb6945a0a852b4e7a4e
MD5 4e0800c61ff9f3dd37a36cdd94d50801
BLAKE2b-256 6e1f7e8a3eb22c50d04f2949008a9e2500fa95358061acc2b7ea4d98eb15471b

See more details on using hashes here.

File details

Details for the file chippai-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: chippai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for chippai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f69be4aae9ad8f2ee49ba0fe5222c78d7eb6a5b67ed99aea715588eb2f0cd980
MD5 da99da7d3539841a0c7c5e5cbd67812c
BLAKE2b-256 e0741a0f35702bcf7a5878a29d7d7c995b92240d32cb96fe722ae2411c34868a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page