Add AI request blocks to your notebook

View as Markdown

Add an AI chat interface to your notebook to create an interactive experience. For example, you can add a request block and reference its response to analyze it with an AI model of your choice.

You can also reference an AI request block’s prompts and responses elsewhere in your notebook.

Add an AI request block

To add an AI request block, do the following:

  1. Open your notebook or create a new one.
  2. Place your cursor where you want to add the AI request block. Then, enter a forward slash (”/”). Postman displays a block menu.
  3. Choose Postbot icon AI Request.
  4. Name your AI request block.
  5. Choose a model provider and model, and (optional) add an MCP server.
  6. Add your API key.
  7. Enter your user prompt.
  8. (Optional) Click Setting icon Settings, enter your system prompt, and adjust your settings.
  9. Click Run icon Send message.

Postman adds your message and the model’s response to the conversation.

Reference your AI request block

Reference your AI request block by name. For example, if you name your AI request block “welcomeChatBot”, you can reference its interactions with the syntax {{welcomeChatBot}} in text, an input block, a request block, or another AI request block.

Or you can reference it with the syntax $welcomeChatBot in a script runner block.

Furthermore, you can use dot notation to reference data within the interactions. Each interaction is an object in an array, where each object represents a prompt or response. For example, in a request block, you can reference your first prompt with the syntax {{welcomeChatBot.0}}. Or in a script runner block, you can reference the same value with the syntax $welcomeChatBot[0].

To reference your AI request block, do the following:

  1. Open your notebook or create a new one.

  2. Get your AI request block’s name.

  3. Reference your AI request block:

    • To reference your AI request block in text, an input block, a request block, or another AI request block, use the syntax {{aiRequestBlockName}} or {{aiRequestBlockName.path.to.data}}.
    • To reference your AI request block in a script runner block, use the syntax $aiRequestBlockName or $aiRequestBlockName.path.to.data.