← Back to Blog

How to Run an AI REST API Agent with OE Runtime

Call any REST API with natural language. OE Runtime connects to external APIs via HTTP, makes GET and POST requests, processes the JSON responses, and returns structured summaries — no Postman, no custom scripts, just a YAML file.

🔌
Step 1
Probe API
Make GET requests to /users and /posts, noting status codes, response times, and data structure.
Step 2
Fetch Detail & Create Record
Fetch a user detail and create a test post via POST with a confirmed response ID.
Step 3
Report
Summarise all endpoints called, status codes, data shapes, and creation confirmation.

The Agent YAML

Create a file called agent.yaml inside a rest-api/ directory:

name: API Caller
description: Make HTTP requests to a REST API and summarize responses
instructions: |
  You are an API integration agent. Make GET, POST, PUT, or DELETE requests
  to external APIs and process the responses. Return structured summaries.
  Complete all steps fully before writing your report.
steps:
  - name: Probe API
    content: |
      Make a GET request to /users to fetch a list of user records.
      Also make a GET request to /posts to fetch a list of posts.
      Note the HTTP status code, response time, and top-level structure of each response.
  - name: Fetch Detail and Create Record
    content: |
      Fetch the detail for user ID 1 via GET /users/1.
      Then create a test post via POST /posts with body:
        { "title": "API Test Post", "body": "Created by OE Runtime agent.", "userId": 1 }
      Note the response status and the ID assigned to the new post.
  - name: Report
    content: |
      Summarize API activity:
      - Endpoints called and HTTP status codes
      - Users endpoint: record count and field schema
      - Posts endpoint: record count and field schema
      - Detail fetch: user name and email for ID 1
      - Created post: ID returned, confirmation of success
connectors:
  - connection_name: Target API
    connection_type: http

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "Target API",
      "connection_type": "http",
      "baseUrl": "https://api.example.com",
      "headers": {
        "Authorization": "Bearer YOUR_API_TOKEN",
        "Content-Type": "application/json"
      }
    }
  ]
}

Replace the baseUrl with your target API and set the Authorization header with your API token. The agent supports any REST API that accepts JSON — Stripe, HubSpot, Salesforce, your own internal APIs, and more.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

Windows

# Run the agent
oe-runtime-win.exe rest-api/agent.yaml --config rest-api/oe-config.json

macOS

# Make executable (first time only)
chmod +x oe-runtime-macos

# Run the agent
oe-runtime-macos rest-api/agent.yaml --config rest-api/oe-config.json

Linux

# Make executable (first time only)
chmod +x oe-runtime-linux

# Run the agent
oe-runtime-linux rest-api/agent.yaml --config rest-api/oe-config.json

macOS Gatekeeper: On first run, macOS may block the binary. Go to System Settings → Privacy & Security → click "Allow Anyway" next to oe-runtime-macos.

Running as an API Server

Add --serve to start OE Runtime as an HTTP server on port 3333:

oe-runtime-win.exe --serve --config rest-api/oe-config.json

Then send a request:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -d '{"yaml": "rest-api/agent.yaml", "params": {}}'

Or import the Postman collection (download above) to test all endpoints visually.

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →