projects→clairvoyant-cat-an-ai-tarot-reader-built-on-the-chatgpt-api

Clairvoyant Cat / an AI Tarot Reader Built on the ChatGPT API

Built for fun (and for studying), used for insights

A tarot-reading cat built in early 2024 to learn the ChatGPT API: chained prompts, safety checks and bilingual readings, in plain PHP and JavaScript.

arcade cabinet
Status: live Type: LLM pipeline Stack:
  • JavaScript
  • Midjourney
  • OpenAI API
  • PHP

The idea

I built Clairvoyant Cat for fun, and to get my hands on the ChatGPT API in its early days. It went live in January 2024: a cat that reads tarot cards, in English and Italian, powered by GPT-3.5 Turbo. The card illustrations were made with Midjourney.

Behind the fun, it was a way to learn: how to talk to a language model through its API, write prompts that give consistent answers, and chain several requests into one experience. It also meant mixing plain code (PHP and JavaScript) with AI:

How a reading works

The visitor tells the cat three things: gender, age and the question. Then the show begins. The cat “types” its answers, the cards are drawn with an animation, and the reading appears, always in character.

Before any card is drawn, the first AI call checks the question on three points: is it understandable, is it offensive, can the tarot actually answer it? The first one that fails stops the reading, and the cat replies in character, asking to rephrase, to be kind, or to try a different question. A first offensive question gets a warning, and a repeat gets a ban notice with a link to contact me. For persistent abuse, I can block an IP on the server.

Under the hood

No framework: plain PHP and JavaScript. Each step is a separate call to the OpenAI API (GPT-3.5 Turbo), with its own prompt template. The templates hold placeholders for the question, age, gender and drawn cards, and every prompt exists in English and Italian. Italian needs extra work, because adjectives and articles change with gender, so the prompts carry the right forms for each case.

The safety check runs at temperature 0 and returns structured JSON, so the code can act on clear yes/no answers. The language is chosen by domain: clairvoyantcat.com in English, gattoveggente.it in Italian. Readings and logs are stored in simple JSON files, with no database.

What it taught me: read what the AI actually says

Having every reading land in my inbox showed me how the model behaved with real questions, not test ones. And real questions are hard to predict. Some people ask the cat for a carbonara recipe. Some share personal details they shouldn’t. Some ask, again and again, whether their lover will come back. No test case covers all that. You only find out by watching, and then adjusting the prompts.

We might think humans are predictable. Users aren’t. And neither are LLMs.

Before you ask the cat

A word of warning: the site is public, but I’ve only shared it with friends and contacts, always with this note. Every question and the cat’s reading land in my inbox, with the gender, age and IP address but no name. That was how I studied the AI’s answers in those early days. So please don’t include personal details in your questions.

Ask the cat → clairvoyantcat.com

contact

Let's talk.

Need help with something? Looking for a professional who's reliable and believes in karma*?

Tell me about it here, or send me an email. I reply within two working days.

* which means value and integrity come first; reward follows.