> For the complete documentation index, see [llms.txt](https://tomatopy.pizza/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tomatopy.pizza/docs/readme-1/installation.md).

# Getting Started

<<<<<<< HEAD

## Getting Started

\=======

## Installation Guide

> > > > > > > 048be57787cae533a398402c6cd4191351feef8d

This guide will help you start using the PizzaStack HTTP API. There is nothing to install -- PizzaStack is a REST API you call over HTTP from any language or tool.

### Prerequisites

* An HTTP client (Python `requests`, `curl`, or any language with HTTP support)
* A PizzaStack API key (sign up at [tomatopy.pizza](https://tomatopy.pizza))

### Step 1: Get Your API Key

Sign up at [tomatopy.pizza](https://tomatopy.pizza) to receive your API key. You will use this key in the `X-API-Key` header on every request.

### Step 2: Choose Your HTTP Client

PizzaStack works with any HTTP client. Here are common options:

* **Python**: `requests` library (`pip install requests`)
* **JavaScript**: `fetch` or `axios`
* **Command line**: `curl`

### Step 3: Set Up a Session ID

Every request to PizzaStack requires an `X-Session-ID` header. A session groups related objects together (tomatoes, sauces, pizzas). Generate any unique string as your session ID -- a UUID works well.

```python
import uuid

session_id = str(uuid.uuid4())
```

### Your First Request

Here is a complete example that acquires a tomato using Python:

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

# Acquire a tomato
response = requests.post(f"{API_BASE}/tomato/acquire", headers=HEADERS, json={
    "variety": "San Marzano",
    "ripeness": 0.8,
    "weight": 150
})

print(response.status_code)  # 200
print(response.json())       # {"id": "tom_abc123", "variety": "San Marzano", ...}
```

Or using `curl`:

```bash
curl -X POST https://api.tomatopy.pizza/v1/tomato/acquire \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key" \
  -H "X-Session-ID: your-session-id" \
  -d '{"variety": "San Marzano", "ripeness": 0.8, "weight": 150}'
```

### Verification

To verify your API key is working, make a request and check for a `200` status code:

```python
response = requests.post(f"{API_BASE}/tomato/acquire", headers=HEADERS, json={
    "variety": "Roma",
    "ripeness": 0.7,
    "weight": 100
})

if response.status_code == 200:
    print("API key is valid!")
else:
    print(f"Error: {response.status_code} - {response.json()}")
```

### Troubleshooting

#### Common Issues

1. **401 Unauthorized**
   * Verify your `X-API-Key` header is set correctly
   * Check that your API key has not expired
2. **400 Bad Request**
   * Ensure your JSON body includes all required fields
   * Check that `Content-Type: application/json` is set
3. **Missing X-Session-ID**
   * Every request requires the `X-Session-ID` header
   * Use a consistent session ID for related operations

#### Getting Help

If you encounter any issues:

* Check our [API documentation](https://tomatopy.pizza/docs)
* Join our [Discord Community](https://discord.gg/tomatopy)
* Visit our [Stack Overflow Tag](https://stackoverflow.com/questions/tagged/tomatopy)

### Next Steps

* [Quick Start Guide](/docs/readme.md)
* [Basic Concepts](/docs/readme-1/basic-concepts.md)
* [Core API Endpoints](/docs/core-modules.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://tomatopy.pizza/docs/readme-1/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
