Customer API docs
Build with WaitTime Intelligence API.
Register a user, receive an API key, call protected endpoints with Bearer auth, and track quota usage. Swagger remains available at /docs for interactive exploration.
Quickstart
http://127.0.0.1:8000
dev_free_key
- Start the API with
python -m uvicorn app.main:app --reload --port 8000. - Call
POST /v1/registerto create a real customer key. - Use
Authorization: Bearer YOUR_API_KEYon protected endpoints. - Call
GET /v1/usageto inspect quota and per-endpoint usage.
Plans
Launch with a simple subscription ladder, then tune limits after real usage data arrives.
| Plan | Monthly price | Included quota | Feature access | Best fit | Upgrade |
|---|---|---|---|---|---|
| Free | $0 | 100 requests per day | Single predictions, places, usage, reports | Testing and prototypes | Register |
| Starter | $19 | 10,000 requests per month | Forecasts and nearby alternatives | Small apps and pilots | Subscribe |
| Pro | $79 | 100,000 requests per month | Batch predictions | Production apps | Subscribe |
| Business | Custom | Custom limits | Custom feature and data terms | Partners and high-volume teams | Contact |
Need help choosing a plan? Email support@termigpt.tech.
Billing
Register with the same email you use at checkout. During the first launch, paid access can be activated manually after payment or automatically through Stripe Checkout Session webhooks.
POST /v1/register.POST /v1/billing/checkout.GET /v1/usage to confirm your active plan and quota.curl -X POST http://127.0.0.1:8000/v1/billing/checkout \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"plan\":\"starter\"}"
Authentication
Protected endpoints accept a Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Account and keys
/v1/register
Create a user and receive an API key once.
curl -X POST http://127.0.0.1:8000/v1/register \
-H "Content-Type: application/json" \
-d "{\"email\":\"customer@example.com\",\"name\":\"Example Customer\",\"company\":\"Example AB\"}"
/v1/usage
Inspect current quota, remaining calls, period dates, and endpoint breakdown.
curl http://127.0.0.1:8000/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY"
/v1/api-key/recovery/request
Issue a forgotten-key recovery token. Local and test environments return the token in JSON.
curl -X POST http://127.0.0.1:8000/v1/api-key/recovery/request \
-H "Content-Type: application/json" \
-d "{\"email\":\"customer@example.com\"}"
/v1/api-key/recovery/confirm
Confirm recovery and receive a new API key. The previous key stops working.
curl -X POST http://127.0.0.1:8000/v1/api-key/recovery/confirm \
-H "Content-Type: application/json" \
-d "{\"email\":\"customer@example.com\",\"recovery_token\":\"YOUR_RECOVERY_TOKEN\"}"
/v1/api-key/regenerate
Rotate the current API key while keeping the same account and usage history.
curl -X POST http://127.0.0.1:8000/v1/api-key/regenerate \
-H "Authorization: Bearer YOUR_API_KEY"
/v1/api-key/revoke
Disable the current API key immediately.
curl -X POST http://127.0.0.1:8000/v1/api-key/revoke \
-H "Authorization: Bearer YOUR_API_KEY"
Predictions
You do not need a seeded catalog place ID to start. Send category,
latitude, longitude, and place_name for your own
location. Named customer locations return custom-location predictions. If no
place_name is supplied and a nearby known place exists, the API can use that
richer catalog record.
/v1/wait-time
Predict wait time by place ID or by customer-provided category coordinates.
curl "http://127.0.0.1:8000/v1/wait-time?category=restaurant&latitude=59.3293&longitude=18.0686&place_name=Demo%20Restaurant&timezone=Europe%2FStockholm" \
-H "Authorization: Bearer YOUR_API_KEY"
/v1/wait-time/batch
Request up to 25 predictions in one call.
curl -X POST http://127.0.0.1:8000/v1/wait-time/batch \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"requests\":[{\"place_id\":\"se-gbg-max-kungsportsavenyn\"},{\"category\":\"restaurant\",\"latitude\":59.3293,\"longitude\":18.0686,\"place_name\":\"Demo Restaurant\",\"timezone\":\"Europe/Stockholm\"}]}"
/v1/forecast
Generate a slot-based forecast for the next hours.
curl "http://127.0.0.1:8000/v1/forecast?category=restaurant&latitude=59.3293&longitude=18.0686&hours=6&interval_minutes=60&timezone=Europe%2FStockholm" \
-H "Authorization: Bearer YOUR_API_KEY"
/v1/alternatives
Find nearby places in the same category with shorter waits.
curl "http://127.0.0.1:8000/v1/alternatives?latitude=57.7009&longitude=11.9746&category=supermarket&radius_km=5" \
-H "Authorization: Bearer YOUR_API_KEY"
Catalog
Catalog endpoints are for demo places and known records. Predictions can also work for uncataloged customer locations by sending category and coordinates.
| Method | Path | Purpose |
|---|---|---|
| GET | /v1/places |
List seeded places, optionally filtered by category. |
| GET | /v1/places/{place_id} |
Fetch one place record. |
| GET | /v1/categories |
List categories with counts and typical waits. |
Operations
| Method | Path | Purpose |
|---|---|---|
| GET | /health |
Public service health check. |
| POST | /v1/report |
Submit a crowd-sourced wait observation. |
| GET | /v1/insights/summary |
View seeded product analytics summary. |