host.anri.ai

Your agent can hand things in too.

The same counter, over HTTP. Four calls publish a file or a whole static website, every answer carries the exact minute it leaves, and every error comes back as a code your agent can read.

Give it one link

Most agents only need skill.md. Paste the link into the chat, or install it as a skill so it is there every time:

Shell: install as a Claude skill
curl -fsSL https://host.anri.ai/skill.zip -o skill.zip && unzip skill.zip -d ~/.claude/skills
Files for agents
FileWhat it is
/skill.mdThe publishing skill, in Markdown.
/skill.zipThe same skill, packaged for skill folders.
/openapi.jsonOpenAPI 3 description of every endpoint.
/llms.txt, /llms-full.txtShort and full overviews for language models.
/.well-known/agent.jsonAgent card: name, API base, auth, capabilities.

Four calls

No account needed: without a key, an upload is kept for 24 hours, up to 25.0 MB and 50 files. The base is https://host.anri.ai/api/v1.

  1. Ask what the counter takes

    File types per kind, limits, plans. Check instead of assuming.

    Request
    curl https://host.anri.ai/api/v1/capabilities
  2. Declare the files

    Paths, sizes in bytes, and the kind. The answer holds the upload id and the address it will get.

    Request
    curl -X POST https://host.anri.ai/api/v1/uploads \
      -H "Content-Type: application/json" \
      -d '{"kind":"site","files":[{"path":"index.html","size":1834,"mime":"text/html"}]}'
  3. Hand over the bytes

    One PUT per file. On this counter the answer to step 2 says "upload_mode": "proxy", so files go through the API. A file bigger than declared is refused before it is read.

    Request
    curl -X PUT https://host.anri.ai/api/v1/uploads/$UPLOAD_ID/files/index.html \
      --data-binary @index.html
  4. Publish

    Every file is checked by type, first bytes and size, then the link goes live.

    Request
    curl -X POST https://host.anri.ai/api/v1/uploads/$UPLOAD_ID/finalize
    Answer (fields)
    {
      "state": "published",
      "public_url": "<the link to share>",
      "expires_at": "<ISO-8601 UTC, or null when kept on an account>",
      "claim_url": "<one-time link, uploads without an account only>"
    }

Files or a website

There is one choice to make, kind:

"artifact"

Documents and images shared as they are.

txt md json csv png jpg jpeg webp gif pdf

"site"

Anything that should open as a web page. Needs an index.html at the root; keep folder paths as they are.

+ html htm css js mjs map ico woff woff2 ttf otf webmanifest xml

One HTML page is a site: name it index.html. HTML, CSS or JS sent as an artifact comes back as invalid_file_type.

Keeping things

Create an API key in the dashboard and send it on every call. With a key, "persistent": true keeps the upload inside the plan's storage.

Request
curl -X POST https://host.anri.ai/api/v1/uploads \
  -H "Authorization: Bearer $RELAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"artifact","persistent":true,"files":[{"path":"report.pdf","size":48213}]}'

Without enough storage the answer is persistent_quota_exceeded with available_bytes, required_bytes and the options. Ask the person before retrying as a 24-hour upload.

Something handed in without an account can be moved onto one later with its claim token, once:

Request
curl -X POST https://host.anri.ai/api/v1/uploads/claim \
  -H "Authorization: Bearer $RELAY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"token":"$CLAIM_TOKEN","persistent":true}'

Stable addresses

Every upload gets its own random address. For one that stays put while the content changes:

  • Subdomains, from the Pro plan: yourname.host.anri.ai. Check with GET /subdomains/:handle/availability, reserve with POST /subdomains, then point it at each new upload with PATCH /subdomains/:handle.
  • Your own domain, from the Business plan: POST /domains returns a DNS TXT record to add, POST /domains/:id/verify checks it, and PATCH /domains/:id maps an upload.

Updating a site means publishing a new upload and repointing the address. Nothing is edited in place.

Errors

Every error is JSON with error (a fixed code) and message (for people). Branch on the code, never on the message.

errorHTTPMeans
invalid_file_type400That type is not taken in this kind. HTML, CSS and JS need kind "site".
unsafe_path400A path tried to leave the upload (../, absolute paths, hidden files).
too_many_files400More files than the limit for this account or for no account.
upload_too_large413Over the per-upload limit, or a file bigger than its declared size.
persistent_quota_exceeded409Not enough storage left. The body says how much is missing and the options.
invalid_state409The upload is not in a state that allows this call (already finalized, for example).
claim_invalid400The claim token is wrong, used, or expired.
unauthorized401Missing or revoked API key.
forbidden403The key is valid but this upload or domain belongs to someone else.
not_found404No such upload, file in the manifest, subdomain or domain.
rate_limit_exceeded429Too many requests from this address this minute. Wait and retry.
plan_limit_reached400The plan has no room for another key, subdomain or domain.
handle_unavailable409That subdomain is taken or reserved. The body suggests others.
domain_verification_pending400The domain's DNS record has not been seen yet.
anonymous_uploads_disabled400This counter only takes uploads from accounts.
billing_not_configured501Paid plans are not available on this deployment.

House rules

  1. Tell the person the exact expires_at of anything handed in without an account.
  2. Never turn a kept upload into a temporary one without asking.
  3. API keys and claim tokens are secrets: not in URLs, logs or commits.
  4. Only share public_url once the state is published.
  5. At most 60 uploads a minute from one address. On 429, wait.