← Back to W30D1

Live API Playground

Send real requests. See real responses.

Choose an API

not checked
Hosted demo points at the class server. It always works — no setup needed. Use this to see the shape of successful requests.

Try the Endpoints

GET /health
Is the service alive? Load balancers call this every few seconds.
Click "Send request" to see the response.
GET /metadata
What version of the API and model are we talking to right now?
Click "Send request" to see the response.
POST /v1/predict
Send some text, get a sentiment label back. This is the inference endpoint.
Click "Send request" to see the response.
POST /v1/predict  (bad input)
Good APIs reject bad input with a clear, typed error. Try this.
Click "Send request" to see the response.

Running Your Own

Once the hosted demo clicks for you, switch the mode toggle to "My local server" and hit your own FastAPI. Steps:

  1. In your terminal, cd into your week30_product_lab directory
  2. python3 -m venv venv && source venv/bin/activate
  3. pip install -r api/requirements.txt
  4. uvicorn api.main:app --reload
  5. Come back here, toggle mode, click "Check now" — should go green
If local mode shows red: your browser may be blocking mixed content (HTTPS page fetching HTTP localhost). In Chrome, click the lock icon in the URL bar → Site settings → allow "Insecure content" for class.wize73.com. Or just open http://localhost:8000/docs in a new tab and use FastAPI's built-in Swagger UI.

What to Notice

Response shape is stable

Every successful /v1/predict returns the same fields. Clients can parse without defensive code.

Errors are structured

The 422 isn't plain text — it's JSON with a detail array telling you exactly what failed and where.

Latency is visible

Response panel shows elapsed ms. Watch how /v1/predict compares to /health.

Status codes match meaning

2xx = success. 4xx = your fault. 5xx = server's fault. Never return 200 with an error body.