Module: Reapi

Defined in:
lib/reapi.rb,
lib/reapi/version.rb

Overview

OpenAI-compatible Ruby client for the reAPI gateway (reapi.ai).

Defined Under Namespace

Classes: Client

Constant Summary collapse

BASE_URL =

Public base URL of the reAPI gateway.

"https://api.reapi.ai/v1"
VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.client(api_key: nil) ⇒ Object

Create a client. Reads ENV when api_key is nil.

client = Reapi.client
client.models                       # discover models at runtime
client.chat_completions(
  model: "<model-id>",
  messages: [{ role: "user", content: "Hello from reAPI" }],
)


22
23
24
# File 'lib/reapi.rb', line 22

def self.client(api_key: nil)
  Client.new(api_key: api_key)
end