chat_completion
Send messages to an OpenRouter model and retrieve responses. Supports system, user, assistant roles with optional model, temperature, and token limits.
Instructions
Send messages to an OpenRouter model and get a response
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"messages": "<messages>"
},
"name": "chat_completion"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model ID (optional, uses default) | |
| messages | Yes | ||
| max_tokens | No | ||
| temperature | No |