Inspiration
Splitting a bill with friends is never as simple as "divide by N". Someone orders a cocktail, someone skips the activity, tax and tip need sharing, and then everyone has to be chased for money. We wanted to turn that whole mess into one step: describe what happened in plain English, get a correct split, and let each person pay their exact share.
What it does
SplitAI is a smart bill splitter with PayPal checkout.
- Paste a natural-language description or a receipt, for example: "Rahul, Priya, and I went for dinner. Total bill was $120. Priya ordered a $24 cocktail just for herself. Split the rest equally."
- Groq-hosted AI works out each person's share and explains the math step by step (Priya = $32 shared + $24 cocktail = $56).
- Each person gets their own Pay with PayPal button for their exact amount, in USD or INR.
- After approval the payment is captured and the button turns into a Paid by badge with the transaction ID.
How we built it
- Python + Streamlit in a single
app.py. - Groq API (chat completions, JSON mode). The app lists the available models at runtime, skips speech, guard and embedding models, and falls back to the next model if one is rejected, so a deprecated model name never breaks it.
- Verified math: LLMs can misread arithmetic, so the model's JSON (
name,amount,reason) is re-checked in Python withDecimal. Cent-level rounding is fixed automatically, and larger mismatches trigger a self-correction round with the model. - PayPal JavaScript SDK (Sandbox): one button per person, embedded with
streamlit.components.v1.html. Each order is created with the exact share and currency, then captured on approval. - The AI prompt, the PayPal SDK
currencyparameter and every order'scurrency_codeall use the same currency chosen in the sidebar.
Challenges we ran into
- Currency errors: PayPal returns
UNSUPPORTED_PAYEE_CURRENCYwhen the merchant account cannot receive the currency. We keep the SDK and order currencies identical, and show a clear hint in the app because INR needs an INR-capable sandbox business account. - Changing model names: model lists change over time, so we pick an active text model dynamically instead of hard-coding one.
- Trusting AI with money: we added a validation layer so shares always add up to the bill total before anyone is asked to pay.
Accomplishments that we're proud of
- A full flow from plain-English text to a captured PayPal Sandbox payment, tested end to end.
- AI output that is checked by code before it touches a payment.
What we learned
How to combine an LLM with strict validation for money-related tasks, and how PayPal's SDK, order currency and merchant account capabilities fit together.
What's next for SplitAI
- Create and capture orders on a backend and verify with PayPal webhooks, instead of client-side only.
- Save payment status so the app always knows who has paid.
- Receipt photo upload, more currencies, and shareable payment links for each person.
Note: this is a hackathon demo running on PayPal Sandbox, so no real money moves.
Built With
- groq
- javascript
- paypal
- paypal-sandbox
- python
- streamlit
