struct

OpenRouter::Response

Inherits JSON::Serializable < Struct < Value < Object

Represents a response from

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Class methods

from_request(request : CompletionRequest, response_json : JSON::Any)
Source

Instance methods

choices
Source
created
Source
model
Source
usage

Usage data is always returned for non-streaming. When streaming, you will get one usage object at the end accompanied by an empty choices array.

Source