Back to Nova

Nova API

Use Nova from your own code. Send what you want built or answered, and Nova replies, writing the code like it does in the app.

1. Get a key and credits

In Nova, open Settings → API. Buy credits (from $10) and create a key. The API uses its own prepaid balance, separate from your plan. Requests stop when the balance runs out, so you’re never billed more than you added.

2. Send a request

POST https://vxera.ai/api/nova/chat with your key in the x-api-key header (or Authorization: Bearer nk_…).

cURL
curl https://vxera.ai/api/nova/chat \
  -H "x-api-key: nk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Build a landing page for a bakery in Toronto"}]}'

# → {"ok":true,"threadId":"…","reply":"…Nova's answer and code…","usage":{"inputTokens":…,"outputTokens":…}}
TypeScript (streaming)
const res = await fetch("https://vxera.ai/api/nova/chat", {
  method: "POST",
  headers: { "x-api-key": process.env.NOVA_API_KEY!, "Content-Type": "application/json" },
  body: JSON.stringify({ messages: [{ role: "user", content: "Build a landing page for a bakery in Toronto" }], stream: true }),
})
if (!res.ok) throw new Error(await res.text())
const threadId = res.headers.get("x-nova-thread-id") // send back as threadId to keep building

let reply = ""
const reader = res.body!.getReader()
const decoder = new TextDecoder()
let buf = ""
for (;;) {
  const { value, done } = await reader.read()
  if (done) break
  buf += decoder.decode(value, { stream: true })
  const lines = buf.split("\n")
  buf = lines.pop() ?? ""
  for (const line of lines) {
    if (!line.startsWith("data: ")) continue
    const event = JSON.parse(line.slice(6))
    if (typeof event.content === "string") reply += event.content
    if (event.done) console.log("finished")
  }
}
console.log(reply)
Python
import json, os, requests

res = requests.post(
    "https://vxera.ai/api/nova/chat",
    headers={"x-api-key": os.environ["NOVA_API_KEY"]},
    json={"messages": [{"role": "user", "content": "Build a landing page for a bakery in Toronto"}]},
)
res.raise_for_status()
data = res.json()
print(data["reply"])          # Nova's answer, including the code it wrote
thread_id = data["threadId"]  # send back as "threadId" to keep building

Request body

  • messages (required): the conversation so far, as a list of { role: "user" | "assistant", content: string }.
  • threadId (optional): continue an earlier conversation and its project. Every response returns one in the x-nova-thread-id header.
  • stream (optional): true to receive the reply as it’s written (see below). Default: one JSON answer when Nova is done.
  • locale (optional): reply language, for example "fr".

The reply

By default you get one JSON object: { ok, threadId, reply, usage }. With stream: true the reply streams as server-sent events: lines starting with data: followed by JSON. Join every content to get Nova’s full answer. Code files arrive inside it as fenced blocks that start with a // file: path line. The last event has "done": true.

Pricing

Each request is charged for the work Nova does on it, at least $0.01. A quick question costs about a cent, and a full website build usually costs a few dollars. A request needs at least $0.25 of credit to start. Your balance, spend and every request’s cost are in Settings → API.

Limits and errors

Each key allows 60 requests a minute and 10,000 a day.

401The key is missing, wrong, revoked or expired.
402Not enough API credits (insufficient_api_credits). Add credits in Settings → API.
403The key isn't allowed for this endpoint or IP address.
429Too many requests for this key. Wait and try again.
5xxSomething went wrong on our side. You're only charged for work that was done.

Questions? Email support@vxera.ai.