Use the Riseon AI API on your site

Add Riseon AI to any website or app with a single API key. The API is OpenAI-compatible, so you can use existing SDKs — just change the base URL.

How it works

You send chat messages to the Riseon gateway with your API key; it runs them through the model and returns the reply. Because the endpoint mirrors the OpenAI Chat Completions API, most tools, libraries, and code samples work with only a base-URL change.

1
Get an API key for your workspace.
2
Call the endpoint from your server with the key in the Authorization header.
3
Show the reply in your site — optionally add a session header for memory.

Get an API key

Keys look like rsk-…. Ask your workspace operator, or if self-serve signup is enabled, create one in the web app. You can also contact us to request access.

Keep your key safe

Never put your API key in front-end / browser code. Anyone can read it there. Always call Riseon from your own server (or a serverless function) and let your website talk to that. The website + proxy example shows the recommended pattern.

Endpoint & auth

# Base URL (OpenAI-compatible)
https://api.riseon.risewithcode.site/v1

# Every request sends your key as a Bearer token
Authorization: Bearer rsk-YOUR_API_KEY

cURL

curl https://api.riseon.risewithcode.site/v1/chat/completions \
  -H "Authorization: Bearer rsk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.2:1b",
    "messages": [{"role": "user", "content": "Write a tagline for a coffee shop"}]
  }'

Node.js (server)

Using the official OpenAI SDK

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.riseon.risewithcode.site/v1",
  apiKey: process.env.RISEON_API_KEY,   // keep the key in an env var
});

const res = await client.chat.completions.create({
  model: "llama3.2:1b",
  messages: [{ role: "user", content: "Hello Riseon" }],
});
console.log(res.choices[0].message.content);

Plain fetch (no SDK)

const r = await fetch("https://api.riseon.risewithcode.site/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.RISEON_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ model: "llama3.2:1b", messages: [{ role: "user", content: "Hi" }] }),
});
const data = await r.json();

Python

from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.riseon.risewithcode.site/v1",
    api_key=os.environ["RISEON_API_KEY"],
)
resp = client.chat.completions.create(
    model="llama3.2:1b",
    messages=[{"role": "user", "content": "Summarize this page in one line"}],
)
print(resp.choices[0].message.content)

PHP

$ch = curl_init("https://api.riseon.risewithcode.site/v1/chat/completions");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer " . getenv("RISEON_API_KEY"),
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "model" => "llama3.2:1b",
    "messages" => [["role"=>"user", "content"=>"Hello"]],
  ]),
]);
$data = json_decode(curl_exec($ch), true);

Website + backend proxy (recommended)

Your browser talks to your own endpoint; your server adds the key and forwards to Riseon. This keeps the key secret. Minimal Node/Express proxy:

// server.js — your backend
app.post("/api/chat", async (req, res) => {
  const r = await fetch("https://api.riseon.risewithcode.site/v1/chat/completions", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.RISEON_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ model: "llama3.2:1b", messages: req.body.messages }),
  });
  res.json(await r.json());
});
// browser — safe: no key here
const r = await fetch("/api/chat", {
  method: "POST", headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ messages: [{ role: "user", content: input.value }] }),
});
const data = await r.json();
reply.textContent = data.choices[0].message.content;

React component

function Chat() {
  const [msg, setMsg] = React.useState("");
  const [out, setOut] = React.useState("");
  async function send() {
    const r = await fetch("/api/chat", {   // your proxy from above
      method: "POST", headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ messages: [{ role: "user", content: msg }] }),
    });
    const d = await r.json();
    setOut(d.choices[0].message.content);
  }
  return (
    <div>
      <input value={msg} onChange={e => setMsg(e.target.value)} />
      <button onClick={send}>Ask</button>
      <p>{out}</p>
    </div>
  );
}

Streaming responses

Add "stream": true to stream tokens as they generate (Server-Sent Events), matching the OpenAI streaming format. Each event is a data: line; the stream ends with data: [DONE].

const r = await fetch("https://api.riseon.risewithcode.site/v1/chat/completions", {
  method: "POST",
  headers: { "Authorization": `Bearer ${key}`, "Content-Type": "application/json" },
  body: JSON.stringify({ model: "llama3.2:1b", stream: true,
    messages: [{ role: "user", content: "Tell me a story" }] }),
});
const reader = r.body.getReader();
// read chunks, split on lines starting with "data: "

Add persistent memory

Send an X-Riseon-Session header with a session ID you choose. Riseon then stores and recalls that conversation automatically, so the assistant keeps context across requests — no need to resend the whole history.

"X-Riseon-Session": "customer-42"

Full reference

This page covers integration. For every endpoint — chat, models, memory, sessions, and web search — with request/response shapes and error codes, see the API Reference.

Need a key or higher limits? Get in touch, or open the web app to try it live first.