Skip to main content
POST
Prompt-based completion
The Prompt-Based Completion endpoint allows direct interaction with a language model by sending raw prompts or structured message sequences. It provides a simple interface for generating completions, summaries, or other free-form outputs without performing any retrieval or grounding from the document corpus. This endpoint is ideal for open-ended generation tasks such as text drafting, classification, rewriting, summarization, and chat-like conversations that do not require knowledge integration from R2R’s retrieval pipeline.

Request Body

The request must include a messages list representing the conversational context and an optional generation_config object to control model behavior.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json
messages
object

The input prompt

generation_config
object

Model to use (e.g., gpt-4)

Response

200

The response is of type object.