Midio docs
  • Getting Started
    • Welcome
    • Quick Start Guide
  • Your First Midio App
  • Guides
    • HTTP
      • Making HTTP Requests
      • Responding to HTTP Requests
      • How to reach your own endpoints
      • CORS
      • Server-Sent Events (SSE)
    • Branching
    • Loops
    • Map, filter, reduce
    • Working with Data
    • Expressions
    • Building Agents
      • Streaming Agent API (experimental)
    • Debugging
    • Secrets and Environment variables
    • Convert JSON to data nodes
    • Writing tests
    • Cleaning up your flows
  • Package Manager
  • Integrating with third party services
  • Troubleshooting
  • Tutorials
    • Connecting LLMs to MCP-servers using the MCP-client package
    • Making Your Own MCP Server in Midio
    • A Fast Path to Functional RAG Agents
    • How to build a streaming agent using Server-Sent Events (SSE)
  • Reference
    • The Midio Editor
      • The Node Editor
      • User Traces
      • Traces (execution)
      • Processes
      • Log
      • Services
      • Problems
      • Function Signature
      • Data
      • Settings
    • The Midio Language
      • Nodes and execution
      • Functions and Events
        • Anonymous functions
      • Modules
      • Contexts
      • Data type
      • Local variables
      • Portals
      • Waypoint node
      • Partial function application
  • The Midio Engine
  • Built in Nodes
    • Core (std)
    • HTTP
    • LLM
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub

Your First Midio App

PreviousQuick Start GuideNextHTTP

Last updated 20 days ago

Was this helpful?

In this guide you will learn how to set up a basic web API in Midio using several nodes from the Http package. , and let’s begin.

  1. Create our API endpoint

    1. Add a new endpoint by searching for Http Endpoint in the .

    1. Configure it to handle requests to /poem with a query param named query using the following path value: /poem?query . Leave the other parameters at their default values.

    2. Your Endpoint node should look like this:

  2. Responding to requests

    1. Add an Http Respond to HTTP Request node and hook it up to the endpoint node we added previously, in order to respond to requests. You can also add some dummy data to the body input if you want.

  3. Test our endpoint using Http.Fetch

    1. The easiest way to test out our endpoint is to click “Go to app” button in the project header, and modify that url to target our new endpoint, which will be something like:

      https://<your-project-name>.midio.dev:<port>/poem?query=testing

  4. Add LLM Chat Complete

    1. Add the open-ai package using the .

    2. Add an instance of OpenAI Chat Complete.

    3. Give it a system message like: “Write a short haiku style poem based on the users request.”

  5. Provide an API key (if you received free OpenAI credits when you signed up for Midio, you can skip straight to step 5.c)

    1. Add it to Midio as a secret

    2. Add an instance of Get Environment Variable , select our key from the dropdown menu, and connect it to the api key input in our Chat Complete node.

  6. Connect the Chat Complete node to our endpoint.

Congratulations! You've made your first AI-driven application in Midio. You can easily experiment with it directly from Midio using the Http Fetch node, like so (pick text for the response type you you're not returning an object):

Further reading

Check our our for recipes and examples of how common tasks, like , and looping is done in Midio.

The is a good place to look for definitive information about every aspect of Midio.

The section contains a comprehensive overview of all nodes available out of the box in Midio.

various guides
HTTP
working with data
reference section
available nodes
package manager
Set up an OpenAI API key
Create a new project
Node Palette
open the package manager
search for open-ai and install it
Open the secrets editor
Add a new secret
Give the secret a name