> ## Documentation Index
> Fetch the complete documentation index at: https://levers9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Endpoint

> Demo: endpoint

Source: `demo/endpoint/app.py` in the repository.

A function you call over HTTP. The request body becomes keyword arguments; the return value is the response.

```bash theme={null}
cd demo/endpoint

# develop: a temporary URL with hot reload; edit app.py and the next request uses the new code
levers9 serve app.py:greet
# in another terminal, using the URL that `serve` prints, or the deployed one below

# deploy
levers9 deploy app.py:greet --name greet

# call it
TOKEN=$(awk -F' = ' '/^\[default\]/{f=1} f&&/^token/{print $2; exit}' ~/.levers9/config)
curl -s -X POST localhost:1994/endpoint/greet/v1 \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "Levers", "shout": true}'
# {"message":"HELLO, LEVERS","host":"...","at":...}

# smoke test: runs the handler locally in this process, no container
python app.py

# manage
levers9 deployment list
levers9 deployment stop `deployment id`
```

Notes

* `keep_warm_seconds` keeps a container alive after the last request so the next one is fast; set it to 0 to
  scale to zero immediately.
* `workers` runs several request handlers per container; `autoscaler` adds containers under load.
* Every deploy makes a new version: `/endpoint/greet/v1`, `/v2`, … and `/latest`.
* The dashboard's **Endpoints** page shows deployed endpoints with a ready-made request snippet.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.