OpenRouter::Client
Client for the OpenRouter API
Constants
Constructors
Initialize a new OpenRouter::Client
The api_key is generally required to use the API (though an invalid key seems to allow querying for models.) app_name and app_url are optional and tell OpenRouter about your application. connect_timeout and read_timeout are timeout values in seconds (default: 60.0).
Instance methods
It tells OpenRouter which app is using the API see #app_url
Together with #app_name it tells OpenRouter which app is using the API
Send a completion request for a text prompt using the specified model
Send a completion request using the specified CompletionRequest object
Send an embedding request for a single string or array of strings using the specified model
Send an embedding request using the specified EmbeddingRequest object
Get a specific endpoint
This is a low-level method that is available for edge cases.
Returns an array of Model structs representing the available models currently supported by OpenRouter
Post to a specific endpoint
This is a low-level method that is available for edge cases.