RelayHost

RelayHost for AI agents

RelayHost exposes everything an agent needs to publish files and static sites on a user's behalf: a versioned JSON API, machine-readable errors, exact expiration timestamps, and an installable skill.

Discovery endpoints

Install the skill

npx skills add relayhost/relayhost --skill relayhost -g

Or point your agent at /skill.md directly — it contains the complete publish, claim, subdomain and custom-domain workflows plus every error code.

Quick publish example

# 1. manifest
curl -X POST $BASE/api/v1/uploads -H "Authorization: Bearer rh_..." \
  -H "Content-Type: application/json" \
  -d '{"kind":"artifact","persistent":true,"files":[{"path":"report.pdf","size":12345}]}'
# 2. PUT the bytes to files[0].upload_url
# 3. finalize
curl -X POST $BASE/api/v1/uploads/$ID/finalize
# 4. read public_url + expires_at from the response

Rules your agent should follow

  • • Always report the exact expires_at for temporary uploads.
  • • On persistent_quota_exceeded, never silently fall back to temporary — ask first.
  • • Treat claim tokens and API keys as secrets; never place them in URLs or logs.
  • • Poll GET /api/v1/uploads/:id until published before sharing the URL.