Build First Agent
Build and run your first AI agent in ByteChef: an OpenAI model with one tool, in a few minutes with a single API key.
In this guide you build the same workflow as the Build your first agent template: an AI Agent step with an OpenAI model and one tool, followed by a logger. The agent fetches a random quote through the tool and explains it in one sentence. The only thing to set up is an OpenAI connection.
You will learn:
- How to add an AI Agent step and attach a model to it
- How to create a connection for the model
- How to give an agent a tool and tell it when to use it
- How to try an agent in the playbook and read its tool calls
Before you start
- Finish Build First Workflow if you have not. This guide starts where it ends: signed in, with a project.
- Have an OpenAI API key ready.
Create a workflow
Expand your project's row on the Projects page, click + New Workflow on its Workflows tab, enter the label Build your first agent, and click Save. The editor opens with a Manual trigger in place.
Add the AI Agent
Click the + button below the trigger, search for AI Agent, select it, and choose the Chat action.

The agent appears on the canvas as a box with a slot for each thing you can attach to it: Model, Memory, RAG, Guardrails and Tools. It shows an error until it has a model; Model is the only required slot.

Attach the model and connect OpenAI
Click the + under Model, search for OpenAI, select it, and choose OpenAI Model.

Click the new OpenAI node to open its panel. On the Connection tab, click + next to Choose Connection.... In the Create Connection dialog, give the connection a name such as OpenAI, paste your API key into Token, and click Save. The connection is stored once and reused by every step that needs OpenAI.

Open the Properties tab and choose a model, for example gpt-5-mini. Leave the rest at its defaults.

Write the prompts
Click the AI Agent node and open its Properties tab.
In Prompt, enter the message the agent gets on each run:
Fetch a random quote and explain it.In System Prompt, enter the instructions the agent follows:
You are a friendly assistant. Always call the Get a random quote tool first. Then reply with the quote, its author, and one sentence explaining what the quote means. Do not invent quotes.
Give the agent a tool
Click the + under Tools, type HTTP in the filter, select HTTP Client, and choose its GET action.

Click the new tool node. On the Properties tab, set URI to:
https://dummyjson.com/quotes/randomLeave Response Format on JSON. No connection is needed: the API is public. Tool Name and Tool Description can stay empty: they default to the action's own.
On the Description tab, set Title to Get a random quote. The system prompt refers to the tool by this name.

Try it in the playbook
Click the ▶ Test agent button in the agent box's header. The Agent Playbook opens with your prompt already filled in. Send it. The agent reads the prompts, decides to call the tool, receives the quote, and writes its explanation. Expand the HTTP Client: GET entry above the reply to see why the agent called the tool, what it sent, and the JSON it got back.

Send the same message again and the agent explains a different quote. Close the playbook with the X when you are done.
Log the answer and test the workflow
Click the + button below the agent box, search for Logger, open the Helpers tab, choose the Info action, and enter this in the Text field:
${aiAgent_1}This logs the agent's reply.

Click Test at the top right of the editor. The execution panel opens below the canvas. Click the agent step to read its reply on the Output tab.

What you have built
Manual Trigger → AI Agent (OpenAI model + HTTP Client tool) → Logger- Model: the agent's reasoning. Any of the supported providers plugs into the same slot.
- Tools: every component action can be a tool. The agent decides when to call it and fills in its parameters. See AI Agent for tools whose parameters the model supplies at runtime.
- Connection: created once, reused everywhere, and never part of an exported workflow.
The same workflow is available as a template. To import it instead of building it, open the Build your first agent page, click Use template, select your OpenAI connection on the model, and click Test.
Next steps
- Star Repository on GitHub: a workflow with an OAuth connection
- Configure Workflow Trigger: a real trigger, a deployment and monitoring
- Add Memory or Guardrails to the agent through their slots on the agent box
How is this guide?
Last updated on