Chat → Complete
AI-generatedSummary
Send a chat conversation to a specified AI model via AnyAPI and receive a generated completion response.
Inputs
- Model (required) — The ID of the AI model to use for the chat completion (e.g., openai/gpt-4o, anthropic/claude-sonnet-4-20250514, google/gemini-2.0-flash).
- Messages (required) — An array of messages forming the conversation, each with a role (system, user, or assistant) and content text to send to the model.
- Simplified Output — Boolean flag to return only the generated message content and metadata instead of the full API response.
- Options — Additional parameters to customize the completion, such as temperature, max tokens, top_p, streaming mode, JSON mode enforcement, web search grounding, assistant prefill text, function calling definitions, reasoning settings, prompt caching, tool choice, parallel function calling, trace ID for request tracking, and URL context to include.
Output shape
a list where each item is a JSON object containing the chat completion result from the model.
If Simplified Output is true (default), returns objects containing content, role, model ID, and usage info for the first choice. Otherwise returns the full raw API response object. Supports options like streaming (returns full response after completion). Errors can be returned in the output if 'Continue On Fail' is enabled.
Examples
Example 1: Complete a chat with the OpenAI GPT-4o model using user and system messages, returning just the text content.
Set Model to 'openai/gpt-4o', send messages with roles and text, leave Simplified Output enabled, and set optional parameters like temperature or max tokens as needed.