Skip to main content
In Ragen, an assistant is a project — a named container with its own knowledge base, system instructions, and settings. The Assistants API is an OpenAI-compatible CRUD surface over your projects, which means you can use the openai Python or Node SDK with base_url pointed at your Ragen instance to create, list, update, and delete assistants without writing custom HTTP code.

Endpoints

Authentication:
Assistants are scoped to the API key. A key scoped to the knowledge base — the default — sees every assistant its organization owns, which is what an OpenAI client expects from client.assistants.list(). A key created for one assistant sees, and can change, that one only: any other is refused with 403, and such a key cannot create or delete an assistant at all. See Authentication.

OpenAI field mapping

Ragen maps OpenAI assistant fields to Ragen project concepts:

Create an assistant

POST /v1/assistants
string
required
The project title displayed in the dashboard.
string
Per-project system prompt. Merged on top of the organization’s default instructions. Pass an empty string to clear any existing instructions.
string
Accepted for OpenAI SDK compatibility; not yet persisted as a per-project override.
number
Accepted for OpenAI SDK compatibility; not yet persisted as a per-project override.
string
Accepted for OpenAI SDK compatibility; returned as-is.
object
Accepted for OpenAI SDK compatibility; returned as-is.

List, retrieve, and modify

GET /v1/assistants returns every assistant the key can reach — the whole organization for a knowledge-base key, or the single bound one. GET /v1/assistants/{id} retrieves a single assistant. Both POST /v1/assistants/{id} and PATCH /v1/assistants/{id} update an existing assistant — every field is optional, and they accept the same fields as create.

Delete an assistant

DELETE /v1/assistants/{id} — deletes the project and returns:
Self-delete protection: You cannot delete the assistant your API key is bound to — that would revoke the key’s own context. Attempting it returns a 400 error. A key scoped to one assistant therefore deletes nothing at all: its own is refused here, and every other one is refused as out of scope with 403.
This prevents accidentally breaking your own chat and files context. Issue or rotate to a different key first if you need to delete the bound project.

Examples

Rate limits