Skip to main content

A blazing fast API caching SDK powered by Rust

Project description

CheapAPI Python SDK

A blazing fast API caching SDK powered by Rust. Transparently intercepts requests and httpx calls, caches responses in MongoDB, and returns identical results instantly — saving you money on repeated LLM/API calls.

Installation

pip install cheap-api

Quick Start

import cheap_api

cheap_api.init(
    mongo_uri="mongodb://localhost:27017",
    db="cheap_api",
    collection="cache"
)

# All requests/httpx calls are now cached automatically
import requests
response = requests.get("https://api.openai.com/v1/models", headers={"Authorization": "Bearer sk-..."})

Environment Variables

Variable Description
CHEAP_API_MONGO_URI MongoDB connection string
CHEAP_API_DB Database name
CHEAP_API_COLLECTION Collection name
CHEAP_API_CACHE_ERRORS Cache error responses (true/false)

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

cheap_api-0.1.4.tar.gz (32.0 kB view details)

Uploaded Source

Built Distributions

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

cheap_api-0.1.4-cp311-cp311-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.11Windows x86-64

cheap_api-0.1.4-cp311-cp311-manylinux_2_38_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.38+ x86-64

cheap_api-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

cheap_api-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

File details

Details for the file cheap_api-0.1.4.tar.gz.

File metadata

  • Download URL: cheap_api-0.1.4.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cheap_api-0.1.4.tar.gz
Algorithm Hash digest
SHA256 95b043a8f6e109a9de9745aa1710cf7962da40db8fa2001c45be6a8d7e54f459
MD5 d1a5a0d6a9520b0b0ed5bf36933923fa
BLAKE2b-256 8fb33c75a40d7b5fcf97442bcfd367b50fcc2308141607f3cb472fbd1d595a37

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheap_api-0.1.4.tar.gz:

Publisher: python-publish.yml on felixjonus07/cheap-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cheap_api-0.1.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cheap_api-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cheap_api-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d6ea77519cc43e1c96a0ede87177f05e87248648a6fdbc9e1ea5d5e7883bdae7
MD5 acfe560cb693b59f70973a8afda9047c
BLAKE2b-256 a49dc9134b6bdf0c66c5ad2d546094194480c9c0068a8914acf7798a100bf6ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheap_api-0.1.4-cp311-cp311-win_amd64.whl:

Publisher: python-publish.yml on felixjonus07/cheap-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cheap_api-0.1.4-cp311-cp311-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for cheap_api-0.1.4-cp311-cp311-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 8c9f8b409e40f76524b594829b44866f68cb8ab0bf73d41ebef7579b32d53d87
MD5 0b75c03307b8ea597a05813a6948ef5e
BLAKE2b-256 33d7fba7a2b56195bb239e1bfbf0619664fce6dd7de9df594be0d45081a6211e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheap_api-0.1.4-cp311-cp311-manylinux_2_38_x86_64.whl:

Publisher: python-publish.yml on felixjonus07/cheap-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cheap_api-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cheap_api-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 782119ed2ca062d06cb37c7d69b900bd2a1eb3211018d695df3d2712b57bfc6d
MD5 c0f4a2d87f0e8e5dabab3b3ee9fa1b12
BLAKE2b-256 762e3f560115619fce390d82944a9fa58f0ac1828d5ac95bec5ebc3a190d6120

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheap_api-0.1.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on felixjonus07/cheap-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cheap_api-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cheap_api-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7072fd2c35511d674642e7bf59a1d7181d24169590b760fe253bb4cd8fe9eaa6
MD5 829524c8e8bb32563b5177a00488a8ad
BLAKE2b-256 4b6828f92d8315d558d78fb83bbc8603003bcbe9383bd90207331c92d1836d42

See more details on using hashes here.

Provenance

The following attestation bundles were made for cheap_api-0.1.4-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on felixjonus07/cheap-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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