For the complete documentation index, see llms.txt. This page is also available as Markdown.

Perfect Pizza Production

This tutorial walks you through the complete PizzaStack pipeline: from acquiring tomatoes to baking and tasting a finished pizza. By the end, you will have a full working Python script.

Prerequisites

Before starting, make sure you have:

  • A PizzaStack API key (sign up at tomatopy.pizza)

  • Python with the requests library installed (pip install requests)

  • Understanding of the basic concepts

Setup

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())
}

def api_post(endpoint, payload):
    """Helper to make API calls and check for errors."""
    response = requests.post(f"{API_BASE}{endpoint}", headers=HEADERS, json=payload)
    response.raise_for_status()
    return response.json()

Step 1: Acquire Tomatoes

Step 2: Slice the Tomatoes

Slicing is essential. Raw tomato IDs passed directly to /cook/simmer will silently produce low-quality sauce.

Step 3: Simmer Into Sauce

Step 4: Create the Pizza Base

Step 5: Assemble the Pizza

Assembly is required before baking. The /pizza/bake endpoint only accepts pizza_id values from /pizza/assemble -- passing a base_id directly will return a 400 error.

Step 6: Bake the Pizza

Step 7: Taste Test

Complete Working Script

Troubleshooting

Common Issues

  1. Low Quality Score

    Check that you sliced tomatoes before simmering. Raw tomato IDs silently degrade sauce quality, which cascades to the final pizza score.

  2. 400 Error on /pizza/bake

    You must call /pizza/assemble first. The bake endpoint requires a pizza_id from assembly, not a base_id.

  3. Objects Not Found

    Make sure all requests use the same X-Session-ID. Objects from one session cannot be referenced in another.

Best Practices

  1. Always Follow the Pipeline Order

    acquire -> slice -> simmer -> base -> assemble -> bake

  2. Check Quality at Each Step

  3. Use a Helper Function

    The api_post helper shown above reduces boilerplate and ensures errors are caught early.

Next Steps

Last updated

Was this helpful?