NUWAY API

Legacy endpoint

Integrations built on NUWAY's earlier chatbot API keep working. New integrations should use POST /chat, which returns more information.

Legacy chat

POST /api/v1/conversation

Billed and rate-limited like POST /chat. Send the key in the X-API-KEY header.

Request body

NameDescription
query string requiredThe customer's message.
sessionId stringContinues an existing conversation.

Example request

curl -X POST "https://ai.nuway.co/api/v1/conversation" \
  -H "X-API-KEY: $NUWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"What are your opening hours?"}'
// Node.js 18+. Uses top-level await: save as .mjs (or set "type": "module").
const res = await fetch("https://ai.nuway.co/api/v1/conversation", {
  method: "POST",
  headers: {
    "X-API-KEY": process.env.NUWAY_API_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "query": "What are your opening hours?"
  })
});
const data = await res.json();
import os
import requests
r = requests.post(
    "https://ai.nuway.co/api/v1/conversation",
    headers={"X-API-KEY": os.environ["NUWAY_API_KEY"]},
    json={
      "query": "What are your opening hours?"
    },
    timeout=30,
)
r.raise_for_status()
data = r.json()

Response

{ "executionTime": 2284, "sessionId": "api_50427a536ec64561828be57eca23e196", "response": "We're open 9am to 5pm, Monday to Friday." }