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).
- OpenAI-compatible chat endpoint — reuse existing SDKs by pointing them at Riseon.
- Persistent memory — opt in per request with a session header; recall is automatic.
- Your data, your key — data is partitioned per API key.
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" }.
| Status | Meaning |
|---|---|
| 400 | Bad request — a required field is missing or malformed. |
| 401 / 403 | Missing, invalid, or disabled API key. |
| 404 | Resource not found. |
| 429 | Too many requests — slow down and retry. |
| 503 | A backend model or service is temporarily unavailable. |
Chat completions
Send a list of messages and receive a model reply. The request and response bodies follow the OpenAI Chat Completions shape.
Body
| Field | Type | Description |
|---|---|---|
| model | string | Model name (see /models). May be ignored if your workspace enforces a fixed model. |
| messages | array | List of { "role": "system|user|assistant", "content": "…" }. |
| stream | boolean | Optional. 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:
| Header | Effect |
|---|---|
| X-Riseon-Session | An 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-Memory | Set 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
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.
Save a fact. Body: { "content": "…" } → { "stored": true }.
List your stored memories as [{ "id", "content", "ts" }].
Semantic search over your memories. Returns
[{ "score", "source", "content" }] ranked by relevance.
Delete one memory by ID → { "deleted": "{id}" }.
Sessions
List your sessions with message counts: [{ "session_id", "n", "last" }].
Full message history for a session: [{ "role", "content", "ts" }].
Delete a session and its stored messages → { "deleted": "{id}" }.
Web search
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
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.