curl and raw HTTP

No SDK? No problem. HiWay speaks standard chat-completions.

HiWay implements the OpenAI chat-completions protocol byte-for-byte. Any HTTP client can talk to it. Here's the minimum viable request.

bash
curl https://www.hiway2llm.com/v1/chat/completions \
  -H "Authorization: Bearer hwy_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "messages": [{"role": "user", "content": "Hello"}],
    "max_tokens": 200
  }' \
  -i

The -i flag dumps the response headers, so you'll see X-HiWay-Model, X-HiWay-Tier, and X-HiWay-Cost-USD inline with the JSON body.

Streaming with curl

bash
curl -N https://www.hiway2llm.com/v1/chat/completions \
  -H "Authorization: Bearer hwy_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[...],"stream":true}'

-N disables curl's output buffering so you see tokens as they arrive. Each SSE event is a JSON chunk followed by a blank line.