Integration guide
Ruby on Rails OpenAI-compatible API guide (Ruby)
Ruby on Rails Ruby guide for OpenAI-compatible APIs: set the base URL to https://api.abliteration.ai/v1, call /v1/chat/completions, and keep the same request schema.
Updated 2026-01-06
Ruby on Rails works with OpenAI-compatible APIs by switching the base URL, API key, and model id.
This guide shows a Ruby example plus a test vector you can run to validate responses.
require "net/http"
require "json"
uri = URI("https://api.abliteration.ai/v1/chat/completions")
payload = {
model: "abliterated-model",
messages: [{ role: "user", content: "Respond with: Ruby on Rails Ruby ready." }],
temperature: 0.2,
}
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer #{ENV['ABLIT_KEY']}"
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
puts response.bodyConfigure Ruby on Rails
Follow this checklist to point your integration at the OpenAI-compatible endpoint.
OpenAI-compatible payload
Use this request body as a known-good payload before customizing parameters.
{
"model": "abliterated-model",
"messages": [
{ "role": "user", "content": "Respond with: Ruby on Rails Ruby ready." }
],
"temperature": 0.2
}Streaming and tool calling readiness
If you stream responses or send tool definitions, keep the OpenAI-compatible schema and validate against the OpenAPI spec.