API Reference

The Riseon AI Gateway is an OpenAI-compatible HTTP API for chat, persistent memory, saved sessions, and web search. If you can call OpenAI, you can call Riseon — just change the base URL and use your Riseon key.

Overview

Every request is authenticated with an API key and scoped to that key: your conversations, memories, and sessions are isolated and never shared across keys. All responses are JSON (chat can also stream as Server-Sent Events).

Authentication

Send your key as a Bearer token in the Authorization header on every request (except /health). Keys look like rsk-….

Authorization: Bearer rsk-YOUR_API_KEY

Keep your key secret. Treat it like a password — send requests from your server, not from untrusted client code, and rotate it if it leaks. A key grants full access to its own chat history and memories.

Need a key? Ask your workspace operator, or get in touch. Some deployments also allow guest chat in the web app without a key.

Base URL

https://api.riseon.risewithcode.site

All paths below are relative to this base. Always use HTTPS.

Errors

Errors use standard HTTP status codes with a JSON body of the form { "detail": "message" }.

StatusMeaning
400Bad request — a required field is missing or malformed.
401 / 403Missing, invalid, or disabled API key.
404Resource not found.
429Too many requests — slow down and retry.
503A backend model or service is temporarily unavailable.

Chat completions

POST/v1/chat/completionsAPI key

Send a list of messages and receive a model reply. The request and response bodies follow the OpenAI Chat Completions shape.

Body

FieldTypeDescription
modelstringModel name (see /models). May be ignored if your workspace enforces a fixed model.
messagesarrayList of { "role": "system|user|assistant", "content": "…" }.
streambooleanOptional. When true, replies stream as SSE.

Example

# curl
curl https://api.riseon.risewithcode.site/v1/chat/completions \
  -H "Authorization: Bearer rsk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Riseon-Session: project-alpha" \
  -d '{
    "model": "llama3.2:1b",
    "messages": [{"role": "user", "content": "Hello Riseon AI"}]
  }'
# Python — reuse the OpenAI SDK
from openai import OpenAI

client = OpenAI(
    base_url="https://api.riseon.risewithcode.site/v1",
    api_key="rsk-YOUR_API_KEY",
)
resp = client.chat.completions.create(
    model="llama3.2:1b",
    messages=[{"role": "user", "content": "Hello Riseon AI"}],
    extra_headers={"X-Riseon-Session": "project-alpha"},
)
print(resp.choices[0].message.content)

Response

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "choices": [{
    "index": 0,
    "message": {"role": "assistant", "content": "Hi! How can I help?"},
    "finish_reason": "stop"
  }]
}

Session & memory headers

Two optional headers control persistent memory on the chat endpoint:

HeaderEffect
X-Riseon-SessionAn ID you choose (e.g. project-alpha). Messages in the same session are stored and recalled on later calls, so the assistant keeps context across requests.
X-Riseon-MemorySet to off to skip memory injection for a single request. Omit it to keep memory on.

When a session is active, recent messages from that session plus the most relevant older notes are automatically added to the prompt — you don't resend the whole history yourself.

Streaming

Add "stream": true to the chat body to receive Server-Sent Events. Each event is a data: line containing a JSON delta; the stream ends with data: [DONE]. This matches the OpenAI streaming format.

data: {"choices":[{"delta":{"content":"Hi"}}]}
data: {"choices":[{"delta":{"content":"!"}}]}
data: [DONE]

Models

GET/modelsAPI key

List the models available to your key.

[
  {"name": "llama3.2:1b", "size": 4900000000, "family": "llama"},
  {"name": "llama3.1", "size": 4700000000, "family": "llama"}
]

Memory

Store and retrieve durable facts for your key, independent of any single chat session.

POST/memoryAPI key

Save a fact. Body: { "content": "…" }{ "stored": true }.

GET/memoryAPI key

List your stored memories as [{ "id", "content", "ts" }].

GET/memory/search?q=…API key

Semantic search over your memories. Returns [{ "score", "source", "content" }] ranked by relevance.

DELETE/memory/{id}API key

Delete one memory by ID → { "deleted": "{id}" }.

Sessions

GET/sessionsAPI key

List your sessions with message counts: [{ "session_id", "n", "last" }].

GET/sessions/{id}API key

Full message history for a session: [{ "role", "content", "ts" }].

DELETE/sessions/{id}API key

Delete a session and its stored messages → { "deleted": "{id}" }.

GET/search?q=…API key

Run a privacy-preserving web search and get structured JSON results back — useful for grounding answers with current information.

curl "https://api.riseon.risewithcode.site/search?q=latest+llm+news" \
  -H "Authorization: Bearer rsk-YOUR_API_KEY"

Health

GET/health

Liveness check. No authentication required. Returns { "ok": true }.

Administrative operations. Key issuance and other operator tasks are handled through separate, credential-protected endpoints reserved for workspace administrators. They are intentionally not documented here. If you need a key or a change to your workspace, contact your operator.