Copy
import requests
import uuid
API_BASE = "https://api.tomatopy.pizza/v1"
HEADERS = {
"Content-Type": "application/json",
"X-API-Key": "your-api-key",
"X-Session-ID": str(uuid.uuid4())
}
# Step 1: Acquire tomatoes
tomato = requests.post(f"{API_BASE}/tomato/acquire", headers=HEADERS, json={
"variety": "San Marzano",
"ripeness": 0.9,
"weight": 800
}).json()
print(f"1. Acquired {tomato['variety']} tomato (type: {tomato['type']})")
# Step 2: Slice the tomatoes
sliced = requests.post(f"{API_BASE}/tomato/slice", headers=HEADERS, json={
"tomato_ids": [tomato["id"]],
"method": "dice",
"size": "medium",
"consistency": "uniform"
}).json()
print(f"2. Sliced into {sliced['piece_count']} pieces")
# Step 3: Simmer into sauce
sauce = requests.post(f"{API_BASE}/cook/simmer", headers=HEADERS, json={
"ingredients": [
{"id": sliced["id"], "name": "tomato", "amount": 800, "unit": "g"}
],
"temperature": 100,
"duration": "45m"
}).json()
print(f"3. Sauce ready (sauce_quality: {sauce['sauce_quality']})")
# Step 4: Analyze
profile = requests.post(f"{API_BASE}/taste/analyze", headers=HEADERS, json={
"dish_id": sauce["id"],
"depth": "comprehensive",
"include_aroma": True,
"include_texture": True
}).json()
print(f"4. Flavor profile: sweetness={profile['sweetness']}, "
f"acidity={profile['acidity']}, umami={profile['umami']}")