Openrouter

Learn how to use Openrouter with Composio

Overview

SLUG

OPENROUTER

Description

OpenRouter is a platform that provides a unified API for accessing various large language models (LLMs) from different providers, allowing developers to integrate multiple AI models seamlessly.

Authentication Details

generic_api_key
stringRequired

Tools

SLUG: OPENROUTER_CREATE_CHAT_COMPLETION

Tool to generate a chat-style completion. use after assembling messages and selecting a model. supports streaming and function calls.

Action Parameters

frequency_penalty
number
function_call
string
functions
array
logit_bias
object
max_tokens
integer
messages
arrayRequired
model
stringRequired
n
integer
presence_penalty
number
stop
string
stream
boolean
temperature
number
top_p
number
user
string

Action Response

data
objectRequired
error
string
successful
booleanRequired

SLUG: OPENROUTER_CREATE_COMPLETION

Tool to generate a text completion for a given prompt or set of messages. use when you need a model-generated response from a specified model.

Action Parameters

max_tokens
integer
messages
array
model
stringRequired
prompt
string
stop
string
stream
boolean
temperature
number
top_k
integer
top_p
number

Action Response

data
objectRequired
error
string
successful
booleanRequired

SLUG: OPENROUTER_GET_CREDITS

Tool to get the current api credit balance for the authenticated user. use after authenticating to monitor remaining credits before making further api calls.

Action Parameters

Action Response

data
objectRequired
error
string
successful
booleanRequired

SLUG: OPENROUTER_GET_GENERATION

Tool to retrieve a generation result by its unique id. use after a generation completes to fetch metadata like token counts, cost, and latency.

Action Parameters

id
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

SLUG: OPENROUTER_LIST_AVAILABLE_MODELS

Tool to list available models via openrouter api. use after confirming authentication to fetch the model catalog.

Action Parameters

category
string
use_rss
boolean
use_rss_chat_links
boolean

Action Response

data
arrayRequired
error
string
successful
booleanRequired

SLUG: OPENROUTER_OPENROUTER_LIST_MODEL_ENDPOINTS

Tool to list endpoints for a specific model. use after specifying model author and slug to get endpoint details including pricing, context length, and supported parameters.

Action Parameters

author
stringRequired
slug
stringRequired

Action Response

data
objectRequired
error
string
successful
booleanRequired

SLUG: OPENROUTER_OPENROUTER_LIST_PROVIDERS

Tool to list all ai model providers available through the openrouter api. use after authentication to retrieve available provider options for routing configuration.

Action Parameters

Action Response

data
arrayRequired
error
string
successful
booleanRequired