API and integrations
Technical docs

API and integrations

This page takes "My AI" mode all the way: it's your AI, with your key, that builds the menu, and an agent of yours that does the back-and-forth for you. Two HTTP routes are all it takes, and Popotam has no key and no cost in the picture.

Just want to stop thinking about it?
Then this page isn't for you, and that's good news: there's nothing to install or code. Popotam plans your week by itself, all it takes is one toggle in the Data tab. Only stick around if you want your AI to do the work.
8 min read Advanced Updated June 12, 2026

The idea: you plug in your own scheduler (a Claude Code task, a GitHub Action, n8n, a simple cron + curl…). In this mode, Popotam stores no AI key and pays for none: any key stays with you, in your tool.

Always 100% free

Whatever the method, it's your AI key (often free) doing the work. Popotam never sees your key and doesn't charge a thing.

How it works, in 3 steps

a

Turn on automation

In the app, "Data" tab › "Weekly automation (advanced)". Popotam gives you a secret token and two URLs.

b

Set up a trigger

On your side (on Monday, say, so you've got the whole week ahead): it grabs the prompt, gives it to your AI, then sends the answer back to Popotam.

c

Dinner's served

Next week's meal plan shows up in your meal plan by itself. Nothing left to paste.

The two endpoints

Everything goes through two addresses, personalized with your token. The first gives you the prompt to run; the second receives the result.

1. Grab the prompt

GET https://popotam.fr/api/auto/<YOUR_TOKEN>/prompt

JSON response:

response.jsonjson
{
  "prompt": "...",
  "semaine_du": "YYYY-MM-DD"
}

The prompt already includes your preferences (restrictions, budget, servings) and your recent history, to avoid repeats. Your AI doesn't need to know any rules: it just runs the prompt as is.

2. Send back the week

POST https://popotam.fr/api/auto/<YOUR_TOKEN>/week

Request body = your AI's raw answer (text or JSON, doesn't matter). Popotam pulls out the JSON by itself, exactly like when you paste it by hand.

response.jsonjson
{
  "ok": true,
  "semaine_du": "YYYY-MM-DD",
  "repas": 14
}
Good to know

The server only merges next week (the following meal plan): your preferences and history are never touched.

Security (important)

The token is a limited capability: it can only grab the prompt and submit a week. It cannot read your data, delete your meal plan or change your preferences.

  • Keep it secret anyway. You can regenerate or turn it off anytime: a new token instantly kills the old one.
  • Never put this token in plain text in a public repo.
  • Keep it in your tool's secrets: GitHub Actions secrets, environment variables, n8n's vault, and so on.
Never commit a secret

Your Popotam token and AI key live in environment variables or secrets, never hardcoded in a versioned file.

Ready-to-use recipes

Three ways to do it, from the most generic to the most "zero budget". For each one, remember: it's 100% on your side, Popotam never sees your AI key.

Recipe A · cron + curl (generic)

A bash script your cron runs once a week. Your Popotam token and your AI's key live in environment variables, never hardcoded in the file.

popotam-hebdo.shbash
#!/usr/bin/env bash
set -euo pipefail

# Environment variables (set them in your cron or your shell):
#   POPOTAM_TOKEN : your Popotam token (<YOUR_TOKEN>)
#   AI_API_KEY    : YOUR AI's key (yours, never Popotam's)

BASE="https://popotam.fr/api/auto/${POPOTAM_TOKEN}"

# 1. Grab the ready-made prompt (preferences + history included)
PROMPT=$(curl -fsS "${BASE}/prompt" | jq -r '.prompt')

# 2. Give this prompt to YOUR AI.
#    Example with the Anthropic Messages API (the AI_API_KEY is YOURS):
REPONSE=$(curl -fsS https://api.anthropic.com/v1/messages \
  -H "x-api-key: ${AI_API_KEY}" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d "$(jq -n --arg p "$PROMPT" '{
        model: "claude-sonnet-4-5",
        max_tokens: 4096,
        messages: [ { role: "user", content: $p } ]
      }')" \
  | jq -r '.content[0].text')

# 3. Send the raw answer back to Popotam (it pulls out the JSON by itself)
curl -fsS -X POST "${BASE}/week" \
  -H "content-type: text/plain" \
  --data-raw "$REPONSE"

Recipe B · scheduled Claude Code task

If you use Claude Code, you can hand it a weekly scheduled task (on Monday). No need to manage an API key yourself: Claude Code runs the prompt. The instruction fits in one sentence.

weekly-task.txtprompt
Every Monday at 9am:
grab the prompt from GET https://popotam.fr/api/auto/<YOUR_TOKEN>/prompt,
generate the week's meal plan following this prompt exactly,
then POST the JSON result to https://popotam.fr/api/auto/<YOUR_TOKEN>/week.
Zero keys to manage

Here too, Popotam sees no key: it's your Claude Code session, on your side, doing all the work.

Recipe C · free GitHub Action + free Gemini key

The cheapest combo: a (free) GitHub Action that calls the Gemini API with a free key from Google AI Studio. Put POPOTAM_TOKEN and GEMINI_API_KEY in the GitHub secrets of your repo.

.github/workflows/popotam.ymlyaml
name: Popotam · weekly meal plan

on:
  schedule:
    # Every Monday at 07:00 UTC (cron runs in UTC); tweak to taste
    - cron: "0 7 * * 1"
  workflow_dispatch: {}   # also lets you run it by hand

jobs:
  generer:
    runs-on: ubuntu-latest
    steps:
      - name: Grab the prompt, call Gemini, send back the week
        env:
          POPOTAM_TOKEN: ${{ secrets.POPOTAM_TOKEN }}
          GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
        run: |
          set -euo pipefail
          BASE="https://popotam.fr/api/auto/${POPOTAM_TOKEN}"

          # 1. Prompt ready on Popotam's side
          PROMPT=$(curl -fsS "${BASE}/prompt" | jq -r '.prompt')

          # 2. Call Gemini with YOUR free key
          REPONSE=$(curl -fsS \
            "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${GEMINI_API_KEY}" \
            -H "content-type: application/json" \
            -d "$(jq -n --arg p "$PROMPT" '{ contents: [ { parts: [ { text: $p } ] } ] }')" \
            | jq -r '.candidates[0].content.parts[0].text')

          # 3. Send back to Popotam (JSON pulled out automatically)
          curl -fsS -X POST "${BASE}/week" \
            -H "content-type: text/plain" \
            --data-raw "$REPONSE"
The key stays with you

The Gemini key lives in your repo's GitHub secrets. Popotam never receives it and doesn't need it.

Honest limits

To automate, you need a trigger that can run an AI (a cron, a GitHub Action, a Claude Code task…). A web chat AI, open in your browser, can't start itself every week: that's exactly why this page is marked "advanced".

Don't feel like automating?

No worries: the weekly calendar reminder, already built into the app, is still the simplest option. You get your reminder, you paste, done.

Frequently asked questions

No, never. The AI key stays only in your tool (cron, GitHub, Claude Code). Popotam only receives the final result, the meal plan, exactly as if you'd pasted it by hand.

Very little: just grab your prompt and submit a week. The token gives no access to your data, preferences or history. If in doubt, regenerate it from the panel: the old one is invalidated instantly.

GitHub Action + Gemini if you want the lowest cost and a "set it and forget it" setup. Claude Code if you already use it: no key to manage. cron + curl if you've got a server or a Raspberry Pi running all the time.

No. You can POST the raw answer (text or JSON, with or without chatter around it). Popotam pulls out the JSON automatically, like when you paste it by hand.

Totally fine. The weekly reminder built into the app gives you a heads-up; you open your AI, paste the prompt, paste the answer. Thirty seconds, zero setup.