Skip to main content
Use this page when you want the smallest possible Node integration and you want to see every HTTP request clearly. Goal: Verify Phaseo health, model discovery, and one generation request using raw HTTP. Outcome: A dependency-light script you can keep as a deployment or integration smoke test.

Build a Node REST smoke app against Phaseo using raw HTTP.

Open in Cursor

Sample project

What this app does

  • calls GET /v1/health
  • calls GET /v1/models
  • exercises generation routes like POST /v1/responses
  • gives you a raw HTTP reference for smoke tests, scripts, and backend checks

When this sample is the right fit

Start here when:
  • you want to debug raw API calls directly
  • you do not want SDK abstractions yet
  • you are building a script, worker, or CLI rather than a web UI

Prerequisites

  • Node.js with built-in fetch support
  • a Phaseo API key

Run the sample

Set:
  • PHASEO_API_KEY
Then run either:
or:

Check your work

  • Smoke mode confirms that the API is reachable.
  • Model discovery returns at least one model.
  • The full run prints one successful generation response.
  • Authentication and non-200 responses produce clear terminal errors.

What to look at in the code

  • how the script loads .env.local
  • how the authorization header is attached
  • how each request is built explicitly
  • how non-200 responses are surfaced instead of swallowed

How to make it your own

  • trim the script to only the routes your service actually needs
  • move shared request code into one helper if multiple scripts will use it
  • upgrade to the TypeScript SDK later if the raw HTTP path becomes repetitive
Last modified on July 26, 2026