query_llm
Send prompts to multiple LLM providers (Gemini, OpenAI, Anthropic) and retrieve model responses. Supports chat history, system prompts, and response formatting.
Instructions
Query a supported LLM provider (Gemini, OpenAI, Anthropic, Cohere, Groq, Mistral, OpenRouter) with a prompt and retrieve the model response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Optional specific model ID (e.g., gpt-4o-mini, gemini-1.5-flash). Defaults to a recommended model if omitted. | |
| apiKey | No | Optional API Key for authentication. If omitted, falls back to environment variables (e.g. GEMINI_API_KEY, OPENAI_API_KEY). | |
| prompt | Yes | The user prompt or instruction message. | |
| provider | Yes | The LLM API provider to call. | |
| maxTokens | No | Optional maximum number of output tokens to generate. | |
| chatHistory | No | Optional array of message history objects for context. | |
| temperature | No | Optional sampling temperature (0.0 to 2.0). | |
| systemPrompt | No | Optional system instructions to direct behavior/formatting. | |
| responseFormat | No | Optional response structure: "text" (default raw response), "json_object" (forces valid JSON outputs), or "detailed" (returns markdown detailed report including token usage). |