OpenAI Compatible FastAPI Endpoint API Reference

Full API reference for RAGWire's OpenAI-compatible FastAPI endpoints covering health checks, model listing, chat completions, and document ingestion.

Apr 12, 2026Updated Jun 12, 20264 min readFollow

Topics You Will Master

Health check and model listing endpoints
Chat completions with OpenAI-compatible Server-Sent Events streaming
Document ingestion via multipart form upload
Full request and response schemas for every endpoint

RAGWire exposes a set of REST endpoints that mirror the OpenAI API schema, making it a drop-in compatible server for any Chat UI or agent framework that targets the OpenAI API. The following sections document each available endpoint with sample requests and responses.


Health & Models

GET /health

Check if the server is running.

Response

JSON
{
  "status": "ok"
}

GET /v1/models

List available models.

Response

JSON
{
  "object": "list",
  "data": [
    {
      "id": "ragwire-agent",
      "object": "model",
      "created": 1776001225,
      "owned_by": "ragwire"
    }
  ]
}

GET /v1/models/{model_id}

Get a specific model by ID.

Response

JSON
{
  "id": "ragwire-agent",
  "object": "model",
  "created": 1776001225,
  "owned_by": "ragwire"
}

Chat Completions

POST /v1/chat/completions

Send a chat message and receive a streamed response in OpenAI SSE format.

Request

JSON
{
  "model": "ragwire-agent",
  "messages": [
    { "role": "user", "content": "what is apple revenue?" }
  ]
}

Streamed Response — Server-Sent Events

TEXT
data: {"id": "chatcmpl-abc123", "object": "chat.completion.chunk", "created": 1776001225, "model": "ragwire-agent", "choices": [{"index": 0, "delta": {"role": "assistant", "content": ""}, "finish_reason": null}]}

data: {"id": "chatcmpl-abc123", "object": "chat.completion.chunk", "created": 1776001225, "model": "ragwire-agent", "choices": [{"index": 0, "delta": {"content": "Apple's total net sales"}, "finish_reason": null}]}

data: {"id": "chatcmpl-abc123", "object": "chat.completion.chunk", "created": 1776001225, "model": "ragwire-agent", "choices": [{"index": 0, "delta": {}, "finish_reason": "stop"}]}

data: [DONE]

Document Ingestion

POST /upload

Upload one or more documents to ingest into the knowledge base.

Request — multipart/form-data

TEXT
files: report.pdf
files: earnings.pdf

Response

JSON
{
  "message": "Ingested 42 chunks from 2 file(s) (0 skipped).",
  "stats": {
    "total": 2,
    "processed": 2,
    "skipped": 0,
    "failed": 0,
    "chunks_created": 42,
    "errors": []
  }
}

Found this useful? Keep building with me.

New tutorials every week on YouTube — or go deeper with a full structured course.

Find this tutorial useful?

Subscribe to our YouTube channels for more practical production walk-throughs.

Discussion & Comments