Chat Completion
chat_completionSend prompts to OpenRouter's AI models to generate chat completions, with controls for model choice, fallbacks, and sampling parameters.
Instructions
Generate a chat completion using an OpenRouter model
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | The primary model to use (e.g., 'anthropic/claude-sonnet-4.6'). Defaults to 'openrouter/auto'. | openrouter/auto |
| models | No | An optional list of fallback models to try in order if the primary model fails. | |
| prompt | Yes | The prompt to send to the model | |
| max_tokens | No | Maximum tokens to generate | |
| temperature | No | Sampling temperature (0-2) | |
| system_prompt | No | Optional system prompt |