Skip to main content

Overview

API-mode is a lightweight deployment option for customers who want RecordEngine in the cloud without the cost of a GPU instance.

Prerequisites

  • AWS account with EC2 access
  • Cloudflare DNS access for recordengine.ai
  • SSH key: xr-platform-key.pem
  • Customer’s API key (OpenAI, Claude, Gemini, or Qwen)

Deploy a New Customer Instance

Step 1 — Launch EC2 from Golden AMI

In the AWS console:
  1. Go to EC2 → AMIs → find recordengine-api-v3
  2. Click Launch instance from AMI
  3. Instance type: t3a.xlarge (4 vCPU, 16 GB RAM)
  4. Storage: 100 GiB gp3
  5. Key pair: xr-platform-key
  6. Security group: allow ports 22, 80, 443 inbound
  7. Launch

Step 2 — SSH In

Step 3 — Pull Latest Code

Step 4 — Start Containers

Step 5 — DNS

In Cloudflare, create an A record:
  • Name: clientname
  • Target: new instance IP
  • Proxy: DNS only (grey cloud — NOT orange)

Step 6 — SSL

Step 7 — Customer Setup

Share the URL with the customer. On first login they will:
  1. Create their admin account
  2. Go to Settings → AI Backend → select provider → enter API key → Save
  3. Go to Settings → General → 🔗 Server URL → enter their URL → Save

Managing the Instance

All management uses the xr CLI. The CLI automatically detects API mode via /opt/xr/.deploy_mode.
xr update on the API instance will never start the Ollama container — it reads .deploy_mode and uses docker-compose.api.yml automatically.

Seed Scripts

After the first xr update, run the seed scripts to populate extraction profiles and default rules:
These are idempotent — safe to re-run at any time.

Architecture

The API-mode compose file (cloud/docker-compose.api.yml) runs three services: The Ollama and ollama-warmup services are absent. All AI calls route through ai_router.py to the customer’s configured API provider.

Golden AMI

The recordengine-api-v3 AMI contains:
  • Ubuntu 24.04 LTS
  • Docker + Docker Compose installed
  • RecordEngine repo cloned at /opt/xr
  • Pre-built Docker images (no build step required)
  • Nginx configured
  • xr CLI installed at /usr/local/bin/xr
  • .deploy_mode set to api
  • Correct file ownership (ubuntu:ubuntu)
  • git safe.directory configured
Update the AMI after major releases by spinning up the current API instance, running xr update, and creating a new AMI snapshot (e.g. recordengine-api-v4).

Troubleshooting

Browser hangs on skeleton screen The config.toml is missing required settings. Verify:
It must contain:
xr update tries to start Ollama The .deploy_mode file is missing or incorrect:
Git pull fails with permission error