OpenRouter provider implementation for LiteLLM
OpenRouter provider implementation for LiteLLM
Default cost per token for OpenRouter models (in USD) Note: These are approximate and may vary as OpenRouter pricing changes
Default cost per token for OpenRouter models (in USD) Note: These are approximate and may vary as OpenRouter pricing changes
(get-cost-per-token-impl provider-name model)OpenRouter-specific get-cost-per-token implementation
OpenRouter-specific get-cost-per-token implementation
(get-rate-limits-impl provider-name)OpenRouter-specific get-rate-limits implementation
OpenRouter-specific get-rate-limits implementation
(handle-error-response provider response)Handle OpenRouter API error responses
Handle OpenRouter API error responses
(health-check-impl provider-name thread-pool config)OpenRouter-specific health-check implementation
OpenRouter-specific health-check implementation
(list-models provider)List available OpenRouter models
List available OpenRouter models
(make-request-impl provider-name
                   transformed-request
                   thread-pool
                   telemetry
                   config)OpenRouter-specific make-request implementation
OpenRouter-specific make-request implementation
(make-streaming-request-impl provider-name
                             transformed-request
                             thread-pool
                             config)OpenRouter-specific make-streaming-request implementation
OpenRouter-specific make-streaming-request implementation
(parse-sse-line line)Parse a Server-Sent Events line
Parse a Server-Sent Events line
(supports-function-calling-impl provider-name)OpenRouter-specific supports-function-calling? implementation
OpenRouter-specific supports-function-calling? implementation
(supports-streaming-impl provider-name)OpenRouter-specific supports-streaming? implementation
OpenRouter-specific supports-streaming? implementation
(test-openrouter-connection provider thread-pool telemetry)Test OpenRouter connection with a simple request
Test OpenRouter connection with a simple request
(transform-choice choice)Transform OpenRouter choice to standard format (same as OpenAI)
Transform OpenRouter choice to standard format (same as OpenAI)
(transform-message message)Transform OpenRouter message to standard format (same as OpenAI)
Transform OpenRouter message to standard format (same as OpenAI)
(transform-messages messages)Transform messages to OpenRouter format (same as OpenAI)
Transform messages to OpenRouter format (same as OpenAI)
(transform-request-impl provider-name request config)OpenRouter-specific transform-request implementation
OpenRouter-specific transform-request implementation
(transform-response-impl provider-name response)OpenRouter-specific transform-response implementation
OpenRouter-specific transform-response implementation
(transform-streaming-chunk chunk)Transform OpenRouter streaming chunk to standard format
Transform OpenRouter streaming chunk to standard format
(transform-streaming-chunk-impl provider-name chunk)OpenRouter-specific transform-streaming-chunk implementation
OpenRouter-specific transform-streaming-chunk implementation
(transform-tool-calls tool-calls)Transform OpenRouter tool calls to standard format (same as OpenAI)
Transform OpenRouter tool calls to standard format (same as OpenAI)
(transform-tool-choice tool-choice)Transform tool choice to OpenRouter format (same as OpenAI)
Transform tool choice to OpenRouter format (same as OpenAI)
(transform-tools tools)Transform tools to OpenRouter format (same as OpenAI)
Transform tools to OpenRouter format (same as OpenAI)
(transform-usage usage)Transform OpenRouter usage to standard format (same as OpenAI)
Transform OpenRouter usage to standard format (same as OpenAI)
(validate-api-key api-key)Validate OpenRouter API key
Validate OpenRouter API key
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs | 
| ← | Move to previous article | 
| → | Move to next article | 
| Ctrl+/ | Jump to the search field |