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:
curl -fsSL https://host.anri.ai/skill.zip -o skill.zip && unzip skill.zip -d ~/.claude/skills| File | What it is |
|---|---|
| /skill.md | The publishing skill, in Markdown. |
| /skill.zip | The same skill, packaged for skill folders. |
| /openapi.json | OpenAPI 3 description of every endpoint. |
| /llms.txt, /llms-full.txt | Short and full overviews for language models. |
| /.well-known/agent.json | Agent 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.
Ask what the counter takes
File types per kind, limits, plans. Check instead of assuming.
Request curl https://host.anri.ai/api/v1/capabilitiesDeclare 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"}]}'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.htmlPublish
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/finalizeAnswer (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.
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:
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.
| error | HTTP | Means |
|---|---|---|
| invalid_file_type | 400 | That type is not taken in this kind. HTML, CSS and JS need kind "site". |
| unsafe_path | 400 | A path tried to leave the upload (../, absolute paths, hidden files). |
| too_many_files | 400 | More files than the limit for this account or for no account. |
| upload_too_large | 413 | Over the per-upload limit, or a file bigger than its declared size. |
| persistent_quota_exceeded | 409 | Not enough storage left. The body says how much is missing and the options. |
| invalid_state | 409 | The upload is not in a state that allows this call (already finalized, for example). |
| claim_invalid | 400 | The claim token is wrong, used, or expired. |
| unauthorized | 401 | Missing or revoked API key. |
| forbidden | 403 | The key is valid but this upload or domain belongs to someone else. |
| not_found | 404 | No such upload, file in the manifest, subdomain or domain. |
| rate_limit_exceeded | 429 | Too many requests from this address this minute. Wait and retry. |
| plan_limit_reached | 400 | The plan has no room for another key, subdomain or domain. |
| handle_unavailable | 409 | That subdomain is taken or reserved. The body suggests others. |
| domain_verification_pending | 400 | The domain's DNS record has not been seen yet. |
| anonymous_uploads_disabled | 400 | This counter only takes uploads from accounts. |
| billing_not_configured | 501 | Paid plans are not available on this deployment. |
House rules
- Tell the person the exact expires_at of anything handed in without an account.
- Never turn a kept upload into a temporary one without asking.
- API keys and claim tokens are secrets: not in URLs, logs or commits.
- Only share public_url once the state is published.
- At most 60 uploads a minute from one address. On 429, wait.