Liking cljdoc? Tell your friends :D

litellm.providers.openrouter

OpenRouter provider implementation for LiteLLM

OpenRouter provider implementation for LiteLLM
raw docstring

default-cost-mapclj

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
sourceraw docstring

get-cost-per-token-implclj

(get-cost-per-token-impl provider-name model)

OpenRouter-specific get-cost-per-token implementation

OpenRouter-specific get-cost-per-token implementation
sourceraw docstring

get-rate-limits-implclj

(get-rate-limits-impl provider-name)

OpenRouter-specific get-rate-limits implementation

OpenRouter-specific get-rate-limits implementation
sourceraw docstring

handle-error-responseclj

(handle-error-response provider response)

Handle OpenRouter API error responses

Handle OpenRouter API error responses
sourceraw docstring

health-check-implclj

(health-check-impl provider-name thread-pool config)

OpenRouter-specific health-check implementation

OpenRouter-specific health-check implementation
sourceraw docstring

list-modelsclj

(list-models provider)

List available OpenRouter models

List available OpenRouter models
sourceraw docstring

make-request-implclj

(make-request-impl provider-name
                   transformed-request
                   thread-pool
                   telemetry
                   config)

OpenRouter-specific make-request implementation

OpenRouter-specific make-request implementation
sourceraw docstring

make-streaming-request-implclj

(make-streaming-request-impl provider-name
                             transformed-request
                             thread-pool
                             config)

OpenRouter-specific make-streaming-request implementation

OpenRouter-specific make-streaming-request implementation
sourceraw docstring

parse-sse-lineclj

(parse-sse-line line)

Parse a Server-Sent Events line

Parse a Server-Sent Events line
sourceraw docstring

supports-function-calling-implclj

(supports-function-calling-impl provider-name)

OpenRouter-specific supports-function-calling? implementation

OpenRouter-specific supports-function-calling? implementation
sourceraw docstring

supports-streaming-implclj

(supports-streaming-impl provider-name)

OpenRouter-specific supports-streaming? implementation

OpenRouter-specific supports-streaming? implementation
sourceraw docstring

test-openrouter-connectionclj

(test-openrouter-connection provider thread-pool telemetry)

Test OpenRouter connection with a simple request

Test OpenRouter connection with a simple request
sourceraw docstring

transform-choiceclj

(transform-choice choice)

Transform OpenRouter choice to standard format (same as OpenAI)

Transform OpenRouter choice to standard format (same as OpenAI)
sourceraw docstring

transform-messageclj

(transform-message message)

Transform OpenRouter message to standard format (same as OpenAI)

Transform OpenRouter message to standard format (same as OpenAI)
sourceraw docstring

transform-messagesclj

(transform-messages messages)

Transform messages to OpenRouter format (same as OpenAI)

Transform messages to OpenRouter format (same as OpenAI)
sourceraw docstring

transform-request-implclj

(transform-request-impl provider-name request config)

OpenRouter-specific transform-request implementation

OpenRouter-specific transform-request implementation
sourceraw docstring

transform-response-implclj

(transform-response-impl provider-name response)

OpenRouter-specific transform-response implementation

OpenRouter-specific transform-response implementation
sourceraw docstring

transform-streaming-chunkclj

(transform-streaming-chunk chunk)

Transform OpenRouter streaming chunk to standard format

Transform OpenRouter streaming chunk to standard format
sourceraw docstring

transform-streaming-chunk-implclj

(transform-streaming-chunk-impl provider-name chunk)

OpenRouter-specific transform-streaming-chunk implementation

OpenRouter-specific transform-streaming-chunk implementation
sourceraw docstring

transform-tool-callsclj

(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)
sourceraw docstring

transform-tool-choiceclj

(transform-tool-choice tool-choice)

Transform tool choice to OpenRouter format (same as OpenAI)

Transform tool choice to OpenRouter format (same as OpenAI)
sourceraw docstring

transform-toolsclj

(transform-tools tools)

Transform tools to OpenRouter format (same as OpenAI)

Transform tools to OpenRouter format (same as OpenAI)
sourceraw docstring

transform-usageclj

(transform-usage usage)

Transform OpenRouter usage to standard format (same as OpenAI)

Transform OpenRouter usage to standard format (same as OpenAI)
sourceraw docstring

validate-api-keyclj

(validate-api-key api-key)

Validate OpenRouter API key

Validate OpenRouter API key
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close