rewardpilot-api / README.md
sammy786's picture
RewardPilot API backend
888111a
|
Raw
History Blame Contribute Delete
1.33 kB
---
title: RewardPilot API
emoji: πŸ’³
colorFrom: green
colorTo: indigo
sdk: docker
app_port: 7860
pinned: false
---
# RewardPilot API
FastAPI backend for the RewardPilot mobile app β€” the deterministic credit-card
scoring engine plus an OpenAI-powered, no-hallucination "why this card" narration.
## Endpoints
- `GET /health` β€” status + whether the LLM key is configured
- `GET /cards` β€” card catalogue
- `POST /recommend` β€” optimal card for a text/structured query (+ LLM narration)
- `POST /voice` β€” audio β†’ transcript β†’ recommendation (needs OpenAI key)
- `POST /statements/parse` β€” upload PDF/CSV β†’ normalized transactions
- `POST /transactions/analyze` β€” were optimal cards used? how much lost?
- `GET /discover/{card_id}` β€” apply-for details + extra benefits
## Configuration
Set **`OPENAI_API_KEY`** as a Space **secret** (Settings β†’ Variables and secrets).
The key is used only for the natural-language reasoning; the engine computes all
numbers and the ranking deterministically. Without the key the API still works
and returns the deterministic explanation.
The numbers and ranking are never produced by the LLM β€” the model is constrained
to rephrase the engine's facts, forbidden from stating figures or naming cards
not in the input, and any violating output is discarded server-side.