HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
openai-processing-ms: 612
x-request-id: req_8f2...
{ "id": "resp_67b7...", "object": "response", "status": "completed",
  "output": [{ "id": "msg_67b7...", "type": "message", "role": "assistant",
    "content": [{ "type": "output_text", "text": "...", "annotations": [] }] }],
  "usage": { "input_tokens": 36, "output_tokens": 87, "total_tokens": 123 } }
HTTP/1.1 200 OK
content-type: application/json
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
history.concat(second.output)
history << { role: :user, content: "..." }
history = [{ role: :user, content: "..." }]
history.concat(first.output)
history << { role: :user, content: "..." }
input: history, store: false
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
event: response.created
data: {"type":"response.created","response":{"id":"resp_67c9...","status":"in_progress"}}
event: response.output_item.added
event: response.content_part.added
event: response.output_text.delta
data: {"type":"response.output_text.delta","item_id":"msg_67c9...","delta":"Hi"}
curl https://api.openai.com/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "model": "gpt-5.6", "input": "Write a one-sentence bedtime story about a unicorn." }'​# the text is buried in the output array:# "output": [{ "type": "message", "role": "assistant",# "content": [{ "type": "output_text", "text": "..." }] }]# never assume output[0]; find the "message" item first
client = OpenAI::Client.newhistory = [{ role: :user, content: "Write a one-sentence bedtime story about a unicorn." }]​first = client.responses.create( model: "gpt-5.6", input: history, store: false)puts(first.output_text)​history.concat(first.output)history << { role: :user, content: "Tell me another." }​second = client.responses.create(model: "gpt-5.6", input: history, store: false)puts(second.output_text)
client = OpenAI::Client.newstream = client.responses.stream(input: "Write a haiku about Ruby.", model: "gpt-5.6")​streamed_text = String.newcompleted_response_id = ""stream.each do |event| case event when OpenAI::Streaming::ResponseTextDeltaEvent streamed_text << event.delta print(event.delta) when OpenAI::Streaming::ResponseTextDoneEvent puts("\n--------------------------") when OpenAI::Streaming::ResponseCompletedEvent completed_response_id = event.response.id endend
chat = RubyLLM.chatchat.ask "Write a one-sentence bedtime story about a unicorn."
chat.ask "Tell me another."
chat.ask "Write a haiku about Ruby." do |chunk| print chunk.contentend
"Write a haiku about Ruby."
Under a sky full of stars, a small unicorn learned that kindness shines brighter than any horn.
haiku.rb
$ ruby haiku.rb
localhost:3000/chats/1
Chat 1turbo stream
Write a haiku about Ruby.
class ChatStreamJob < ApplicationJob def perform(chat_id) chat = Chat.find(chat_id)​ chat.complete do |chunk| message = chat.messages.last message.broadcast_append_chunk(chunk.content) end endend
app/jobs/chat_stream_job.rb
chat.ask "Write a haiku about Ruby." do |chunk| print chunk.contentend
Blocks yield like spring rain, methods bloom in quiet red, joy compiles itself.
image.png report.pdf
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
  { type: :input_text, text: "..." },
  { type: :input_image, detail: :auto, image_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..." },
  { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK..." }
]
content: [
require "base64"image = Base64.strict_encode64(File.binread("image.png"))pdf_data = Base64.strict_encode64(File.binread("report.pdf"))​response = client.responses.create( model: "gpt-5.6", input: [{ role: :user, content: [ { type: :input_text, text: "What's in these files?" }, { type: :input_image, detail: :auto, image_url: "data:image/png;base64,#{image}" }, { type: :input_file, filename: "report.pdf", file_data: "data:application/pdf;base64,#{pdf_data}" } ] }])
chat.ask "What's in these files?", with: ["image.png", "report.pdf"]
chat.ask "What's in this image?", with: "image.png"
chat.ask "What's in this image?", with: "https://example.com/eiffel_tower.jpg"
chat.ask "Analyze these files", with: ["diagram.png", "demo.mp4", "notes.txt"]
a picture and a PDF image/png application/pdf
a local path image/png
a URL image/jpeg
several files, mixed image/png video/mp4 text/plain
"What's the weather in Berlin?"
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
  parameters: { type: :object, properties: { latitude: { type: :number } } },
  required: ["latitude", "longitude"], additionalProperties: false, strict: true }]
input.concat(response.output)
{ type: :function_call_output, call_id: call.call_id, output: JSON.generate(result) }
tools = [{ type: :function, name: "get_weather",
tools = [{ type: :function, name: "get_weather", description: "Get current weather for a location.", parameters: { type: :object, properties: { latitude: { type: :number }, longitude: { type: :number } }, required: ["latitude", "longitude"], additionalProperties: false }, strict: true}]first_response = client.responses.create(model: "gpt-5.6", input: "What's the weather in Berlin?", tools: tools)function_call = first_response.output.find do |item| item.is_a?(OpenAI::Models::Responses::ResponseFunctionToolCall) && item.name == "get_weather"endarguments = JSON.parse(function_call.arguments, symbolize_names: true)result = get_weather(**arguments)response = client.responses.create(model: "gpt-5.6", previous_response_id: first_response.id, input: [{ type: :function_call_output, call_id: function_call.call_id, output: JSON.generate(result) }], tools: tools)puts(response.output_text)
class Weather < RubyLLM::Tool description "Get current weather for a location"​ def execute(latitude:, longitude:) Forecast.current(latitude, longitude) endend​chat.with_tools(Weather).ask "What's the weather in Berlin?"
What's the weather in Berlin?
TOOL CALL
weather(latitude: 52.52,
longitude: 13.41)
{ temperature: 18, wind: 12 }
It's 18°C and breezy in Berlin.
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcp
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
{ "jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": { "_meta": { ... } } }
event: message
data: { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ ... ] } }
POST https://mcp.linear.app/mcpAuthorization: Bearer $LINEAR_API_KEYContent-Type: application/jsonAccept: application/json, text/event-streamMCP-Protocol-Version: 2026-07-28Mcp-Method: tools/callMcp-Name: list_issues​{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "list_issues", "arguments": { ... }, "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28", "io.modelcontextprotocol/clientInfo": { "name": "app", "version": "1.0.0" }, "io.modelcontextprotocol/clientCapabilities": {} } } }# plus: tools/list, map each inputSchema to your model's tool format,# parse JSON or SSE replies, fall back to initialize for older servers
class Linear < RubyLLM::MCP url "https://mcp.linear.app/mcp" bearer_token ENV.fetch("LINEAR_API_KEY")end​chat.with_mcp(Linear).ask "What's blocking the release?"
class GitHub < RubyLLM::MCP url "https://api.githubcopilot.com/mcp/" bearer_token ENV.fetch("GITHUB_TOKEN")end
class Notion < RubyLLM::MCP url "https://mcp.notion.com/mcp" oauthend
class Atlassian < RubyLLM::MCP url "https://mcp.atlassian.com/v2/mcp" bearer_token ENV.fetch("ATLASSIAN_API_KEY")end
class Sentry < RubyLLM::MCP url "https://mcp.sentry.dev/mcp" oauthend
What's blocking the release?
list_issues
get_issue
Two open issues block the release: a failing migration and a pending review.
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product = JSON.parse(response.output_text)
required: %w[name price features], additionalProperties: false
product_schema = { type: :object, properties: { name: { type: :string } } }
text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } }
product_schema = { type: :object, properties: { name: { type: :string }, price: { type: :number }, features: { type: :array, items: { type: :string } } }, required: %w[name price features], additionalProperties: false}response = client.responses.create( model: "gpt-5.6", input: [{ role: :user, content: "Analyze this product: #{text}" }], text: { format: { type: :json_schema, name: "product", strict: true, schema: product_schema } })product = JSON.parse(response.output_text)
class ProductSchema < Schematist::Schema string :name number :price array :features do string endend​response = chat.with_schema(ProductSchema) .ask "Analyze this product", with: "product.txt"response.parsed
{ "name" => "Ruby Mug", "price" => 18.0, "features" => [ "Ceramic", "12 oz", "Dishwasher safe" ]}
product.txt
hey!! so this is our ruby mug,
it's $18, ceramic & holds 12 oz
oh and its dishwasher safe :)
ships in 2-3 days, ask re: bulk
response.parsed
ruby mug
$18
ceramic
12 oz
dishwasher safe
class TicketTriage < RubyLLM::Judge model "jev-latest" probability :urgent, "Does this need attention today?" score :frustration, "How frustrated is the customer?", ["Calm", "Frustrated", "Angry"]end​judgment = TicketTriage.judge("Charged twice for my Ruby Mug. Refund me today!")judgment.urgent.probability
Charged twice for my Ruby Mug. Refund me today!
urgent.probability
0.97
frustration.probabilities
Calm
Frustrated
Angry
class IssueRefund < RubyLLM::Tool description "Issues a refund for an order" requires_approval​ def execute(order_id:) = Refunds.issue!(order_id)end​class SupportAgent < RubyLLM::Agent model "claude-sonnet-5" instructions "Resolve billing tickets." tools IssueRefundend
RubyLLM.workflow("Billing ticket") do |workflow| agent = SupportAgent.new workflow.step("Resolve") { agent.ask "Refund order 42" }​ agent.approve(agent.pending_approvals.first) agent.completeend
app/agents/support_agent.rb
app/jobs/billing_job.rb
APPROVAL NEEDED
APPROVED
SupportAgent wants to run
issue_refund(order_id: 42)
DenyApprove
Refund issued for order 42.
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
{"id":"msg_01...","type":"message","role":"assistant","content":[{"type":"text","text":"..."}],"stop_reason":"end_turn"}
x-api-key: ...    anthropic-version: 2023-06-01    max_tokens is required
curl https://api.anthropic.com/v1/messages \ -H "content-type: application/json" \ -H "x-api-key: $ANTHROPIC_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "claude-opus-5-5", "max_tokens": 1000, "messages": [ {"role": "user", "content": "Hello, Claude"} ] }'# text is at .content[0].text
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
{ "candidates": [ { "content": { "parts": [ { "text": "..." } ], "role": "model" } } ] }
x-goog-api-key: ...   :generateContent   v1beta
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.8-flash:generateContent" \ -H "x-goog-api-key: $GEMINI_API_KEY" \ -H 'Content-Type: application/json' \ -X POST \ -d '{ "contents": [ { "parts": [ { "text": "Explain how AI works in a few words" } ] } ] }'# text is at .candidates[0].content.parts[0].text
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}
boto3.client("bedrock-runtime", region_name="us-east-1")
response["output"]["message"]["content"][0]["text"]
import boto3from botocore.exceptions import ClientError​client = boto3.client("bedrock-runtime", region_name="us-east-1")model_id = "anthropic.claude-sonnet-5"conversation = [ {"role": "user", "content": [{"text": "Describe 'hello world' in one line."}]}]try: response = client.converse( modelId=model_id, messages=conversation, inferenceConfig={"maxTokens": 512, "temperature": 0.5, "topP": 0.9}, ) print(response["output"]["message"]["content"][0]["text"])except (ClientError, Exception) as e: print(f"ERROR: Can't invoke '{model_id}'. Reason: {e}"); exit(1)
RubyLLM.chat(model: "claude-opus-5-5")
RESPONSE: TEXT IN HERE
{ "content": [ { "type": "text", "text": "Hi!" } ], "stop_reason": "end_turn"}
RubyLLM.chat(model: "gemini-3.8-flash")
RESPONSE: TEXT IN HERE
{ "candidates": [ { "content": { "parts": [ { "text": "Hi!" } ] } } ]}
RubyLLM.chat(model: "claude-sonnet-5", provider: :bedrock)
RESPONSE: TEXT IN HERE
{ "output": { "message": { "content": [ { "text": "Hi!" } ] } }}
RubyLLM.chat(model: "claude-opus-5-5")
RubyLLM.chat(model: "gemini-3.8-flash")
RubyLLM.chat(model: "claude-sonnet-5", provider: :bedrock)
19 providers. One Ruby API.
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl https://api.openai.com/v1/audio/speech \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o-mini-tts", "input": "Welcome to the show!", "voice": "coral" }' \ --output speech.mp3
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl --request POST \ --url https://api.openai.com/v1/audio/transcriptions \ --header "Authorization: Bearer $OPENAI_API_KEY" \ --header 'Content-Type: multipart/form-data' \ --form file=@speech.mp3 \ --form model=gpt-transcribe# {"text": "..."}
RubyLLM.speak("Welcome to the show!").save("speech.mp3")
RubyLLM.transcribe("speech.mp3").text
0:02
speech.mp3
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl -X POST "https://api.openai.com/v1/images/generations" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "Content-type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "A red panda writing Ruby" }' | jq -r '.data[0].b64_json' | base64 --decode > panda.png
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl -X POST https://api.x.ai/v1/videos/generations \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $XAI_API_KEY" \ -d '{"model": "grok-imagine-video-1.5", "prompt": "A red panda writing Ruby"}'# {"request_id": "d97415a1-..."}# poll until status is "done" (pending | done | expired | failed)curl -X GET "https://api.x.ai/v1/videos/$REQUEST_ID" \ -H "Authorization: Bearer $XAI_API_KEY"# download .video.url promptly: it is temporarycurl -o panda.mp4 "$VIDEO_URL"
RubyLLM.paint("A red panda writing Ruby").save("panda.png")
RubyLLM.animate("A red panda writing Ruby").save("panda.mp4")
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl https://api.openai.com/v1/embeddings \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -d '{ "input": "Ruby is elegant and expressive", "model": "text-embedding-3-small" }'# .data[0].embedding
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl --request POST \ --url https://api.cohere.com/v2/rerank \ --header 'content-type: application/json' \ --header "Authorization: bearer $CO_API_KEY" \ --data '{ "model": "rerank-v3.5", "query": "How do I reset my password?", "documents": ["Reset your password in Settings.", "Invoices arrive by email."], "top_n": 2 }'# {"results":[{"index":0,"relevance_score":0.98}, ...]}
RubyLLM.embed("Ruby is elegant and expressive").vectors
RubyLLM.rerank("How do I reset my password?", documents, model: "rerank-v3.5")
VECTORS
[ 0.0182, -0.0417, 0.1093, 0.0521, -0.0764, 0.0338, -0.0129, 0.0906, -0.0453, 0.0287, -0.0612, 0.0775, … ]
RANKED.RESULTS
4Invoices arrive by email.0.04
1Reset your password in Settings.0.98
5Our office is closed on Sundays.0.01
2Use "Forgot password" to get a reset link.0.91
3Two-factor codes expire after 30 seconds.0.12
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl https://api.mistral.ai/v1/ocr \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${MISTRAL_API_KEY}" \ -d '{ "model": "mistral-ocr-latest", "document": { "type": "document_url", "document_url": "data:application/pdf;base64,<base64_pdf>" } }' -o ocr_output.json# text is at .pages[i].markdown
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
curl ... -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json"
moderation = client.moderations.create( model: OpenAI::Models::ModerationModel::OMNI_MODERATION_LATEST, input: "Some user-generated content")puts(moderation.results.fetch(0).flagged)
RubyLLM.ocr("contract.pdf").markdown
RubyLLM.moderate("Some user-generated content").flagged?
contract.pdf1 / 3
SERVICE AGREEMENT
1. Term
This agreement starts on the effective date and continues for twelve months.
2. Fees
Fees are invoiced monthly.
# Service Agreement ## 1. Term This agreement starts on the effective date and continues for twelve months. ## 2. Fees
flagged? false
You don't need Python or JavaScript for AI.
Use Ruby.
The Ruby-native AI framework.
$ bundle add ruby_llmrubyllm.com
Another server is three lines away.
And everything else you'd build yourself.
Model fallbacks
claude-sonnet-5✕
claude-haiku-4-5✓
chat.with_fallbacks("claude-haiku-4-5")
Prompt caching
CACHE HIT
chat.with_caching(ttl: "1h")
Extended thinking
effort: high
chat.with_thinking(effort: :high)
Web search
latest Ruby release
Ruby ReleasesThe newest Ruby is out with faster YJIT1
1 ruby-lang.org
chat.with_provider_tools(:web_search)
Citations
Ruby was created by Yukihiro Matsumoto in 1993, as a language for programmer joy.
facts.txt, p. 5
response.citations
Cost tracking
$0.0042
chat.cost.total
Batches
chat 1
✓
chat 2
✓
chat 3
✓
RubyLLM.batch(chats)
Tool approval
issue_refund(order_id: 42)
DenyApprove
chat.approve(tool_call)
The agentic loop
think
act
observe
chat.step until chat.complete?
Compaction
summary of 48 turns
chat.with_compaction(at: 50_000)
Token counting
Ruby is elegant and expressive
012345 tokens
chat.count_tokens(text)
Model registry
claude-sonnet-5visionreasoningcitations
gemini-3.8-flashvisionvideocaching
RubyLLM.models.find("claude-sonnet-5")
RubyLLM
chat = RubyLLM.chat