Add AI request blocks to your notebook
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:
- Open your notebook or create a new one.
- Place your cursor where you want to add the AI request block. Then, enter a forward slash (”/”). Postman displays a block menu.
- Choose
AI Request.
- Name your AI request block.
- Choose a model provider and model, and (optional) add an MCP server.
- Add your API key.
- Enter your user prompt.
- (Optional) Click
Settings, enter your system prompt, and adjust your settings.
- Click
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:
-
Open your notebook or create a new one.
-
Get your AI request block’s name.
-
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
$aiRequestBlockNameor$aiRequestBlockName.path.to.data.
- To reference your AI request block in text, an input block, a request block, or another AI request block, use the syntax