A FastAPI service that gives client applications a common generation API across Gemini, OpenAI, and Anthropic, with authentication, rate limiting, retries, and delivery records.
- Client API keys stored as hashes.
- Redis sliding-window rate limiting with configurable failure policy.
- Provider adapters and normalized generation responses.
- Bounded retries for transient upstream failures.
- HMAC-signed webhook delivery and persisted delivery records.
- Structured logging with correlation IDs.
- SQLite development storage and PostgreSQL support.
Requires Python 3.12 or newer. Redis is required for distributed rate limiting; a live provider key is required for generation.
git clone https://github.com/Jemade/API-WRAPPER.git
cd API-WRAPPER
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
alembic upgrade head
PYTHONPATH=. python scripts/create_api_key.py --name local-client
uvicorn app.main:app --reload --port 8080Open http://localhost:8080/docs. Save the generated client key; only its hash is retained.
Defaults use SQLite. Configure provider keys, REDIS_URL, WEBHOOK_SECRET, and DATABASE_URL through environment variables or .env. The example file selects PostgreSQL, so adjust it to match your local database before loading it.
docker compose up --build
pytest -qThis is a generation gateway, not a transparent implementation of every provider endpoint. Webhook records are persisted, but delivery runs in process rather than through a separate durable outbox worker. The Redis failure policy determines whether traffic is allowed or rejected during a Redis outage.
See CONTRIBUTING.md for development checks, regression tests and review expectations. Use the issue templates for reproducible bugs or concrete feature proposals.
Read the engineering notes for implementation boundaries and verification commands, the review checklist for evidence still required, and CONTRIBUTING.md to propose changes. Report vulnerabilities through SECURITY.md.