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

Basic Concepts

Understanding the core concepts of the PizzaStack API will help you make the most of the platform. This guide introduces the fundamental ideas and components.

Core Components

1. Sessions

Every interaction with PizzaStack happens within a session. A session is identified by the X-Session-ID header and groups all objects (tomatoes, sauces, bases, pizzas) together.

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())  # One session per workflow
}

2. Ingredient Types

PizzaStack tracks ingredients through several states as they move through the pipeline:

  • Raw -- freshly acquired tomatoes (/tomato/acquire)

  • Sliced -- tomatoes that have been cut (/tomato/slice)

  • Juice -- extracted liquid (/tomato/squeeze)

  • Sauce -- cooked result (/cook/simmer or /cook/roast)

Each state has an ID you pass to subsequent endpoints.

3. The Pipeline

PizzaStack follows a defined pipeline for making pizza:

  1. Acquire tomatoes via /tomato/acquire

  2. Prepare them via /tomato/slice or /tomato/squeeze

  3. Cook them via /cook/simmer or /cook/roast

  4. Create a base via /pizza/base

  5. Assemble everything via /pizza/assemble

  6. Bake via /pizza/bake

  7. Analyze via /taste/analyze or /taste/compare

Key Concepts

1. Quality Propagation

Quality flows through the pipeline. The ripeness of your raw tomato affects the quality of your sliced tomato, which affects the quality of your sauce, which affects the final pizza score.

2. Ingredient State Matters

Tomatoes must be sliced before they can be simmered into sauce. Passing raw tomato IDs directly to /cook/simmer will not return an error, but the resulting sauce quality will silently degrade.

3. Assembly Before Baking

Pizzas must be assembled via /pizza/assemble before they can be baked. Passing a bare base_id to /pizza/bake will return a 400 error.

Error Handling

The API returns standard HTTP status codes with JSON error bodies:

Best Practices

  1. Use One Session Per Workflow

    Create a new session ID for each independent pizza-making workflow.

  2. Always Slice Before Cooking

  3. Check Response Status Codes

Next Steps

Last updated

Was this helpful?