This guide explains how to configure a chat completion flow with any of the available GPT models in OpenRouter.

1. Configuring OpenRouter Block

  1. Open an account with OpenRouter
  2. Navigate to the API Keys section and click on create a new API key
  3. Copy the API key and paste it in the OpenRouter block

Steps:

  1. Select Model: For example you can use a free model like Google Gemma 3.
  2. Provide Messages:
    • Create a variable for storing chat history (e.g., Chat history).
    • Append user and assistant messages sequentially to ensure conversational context.
Release0.com - Agent image blocks

Example Chat Flow:

  • User Input: {{User Message}} (Captured via a “user input text” block).
  • Assistant Reply: {{Assistant Message}} (Generated by the OpenRouter block).

Set Variables:

  • Define the variable for appending the assistant response (Append {{Assistant Message}} in Chat history).