Integration · no API key

The anyshare REST API

A file hosting API that needs no key and no account: POST a file or a folder’s files, get a live URL back, then update or delete it with the token from the response.

No install, no account. Returns JSON with your link and a claim link to keep it.

curl -F file=@index.html https://anyshare.ai/api/v1/sites

The whole API on one page

The base path is /api/v1 on the app domain, and there are four endpoints. POST /sites creates a link, GET /sites/{slug} returns its public metadata, PUT /sites/{slug} replaces the content at the same URL, and DELETE /sites/{slug} removes it. Changing or deleting a link needs Authorization: Bearer <token>.

Without an account a link expires 1 hour after upload unless someone keeps it: the response has a claimUrl where a person signs in or creates a free account, and the link then lasts 30 days. Send Authorization: Bearer as_key_… (a key from npx -y @anyshare/cli login) on the create and the link is in that account from the start; the same key can update or delete it instead of the token. POST /sites/{slug}/claim keeps an existing link from code.

Uploads are multipart file fields, and a filename may carry a relative path (assets/app.js), so a whole site can go up in one request. Or send a raw body with an X-Filename header. A single .zip is unpacked. Optional fields: slug, title, and spa=true for single-page apps.

Reference

Requests

Copy, paste, change the file name.

Create

Multipart file field. The JSON response has url, token and, without an account, claimUrl.

curl -F file=@report.pdf https://anyshare.ai/api/v1/sites

Several files

Filenames carry relative paths, so links between the files keep working.

curl -F "file=@index.html" -F "file=@assets/app.js;filename=assets/app.js" https://anyshare.ai/api/v1/sites

Folder

Zipped on the fly, without .env files. A single .zip is unpacked into a site.

(cd dist && zip -qrD - . -x '.env*' '*/.env*') | curl -F "file=@-;filename=site.zip" https://anyshare.ai/api/v1/sites

Raw body

X-Filename sets the name; Accept: text/plain returns just the URL.

curl --data-binary @notes.md -H "X-Filename: notes.md" -H "Accept: text/plain" https://anyshare.ai/api/v1/sites

Update / delete

The token from the create response. The URL stays the same on update.

curl -X PUT -H "Authorization: Bearer $TOKEN" -F file=@report.html https://anyshare.ai/api/v1/sites/sunny-otter-4821
curl -X DELETE -H "Authorization: Bearer $TOKEN" https://anyshare.ai/api/v1/sites/sunny-otter-4821

Response

Returned once, with status 201. Store token privately: it authorizes updates and deletion.

{
  "slug": "sunny-otter-4821",
  "url": "https://sunny-otter-4821.anyshare.site",
  "mode": "site",
  "kind": "html",
  "files": 3,
  "bytes": 48213,
  "plan": "free",
  "expiresAt": "2026-11-25T11:00:00.000Z",
  "version": 1,
  "claimed": false,
  "token": "as_tok_…",
  "manageUrl": "https://anyshare.ai/…",
  "claimUrl": "https://anyshare.ai/claim/sunny-otter-4821#token=as_tok_…"
}

When it’s shared

What the URL shows

The url in the response opens the right viewer for what you sent. Add ?raw to a file URL for the original bytes, or ?download to download it.

  • Websites from HTML or a zip
  • Viewers for PDFs, JSON and more
  • Raw bytes with ?raw
  • Range requests for video and audio

How it works

Create, read, change

  1. Step 1:

    POST the file

    Send one or more file fields to /api/v1/sites. The response has status 201 and a JSON body.

  2. Step 2:

    Read the response

    Show url to the user, with claimUrl if there is one, keep token privately, and use expiresAt to know exactly when the link goes away.

  3. Step 3:

    PUT or DELETE later

    Same body as the create, plus Authorization: Bearer <token>. The URL doesn’t change when you update.

The details

Details that matter in production

  • Retry-safe creates

    Send Idempotency-Key: <uuid> on POST. Repeating a create with the same key returns the original link instead of making a second one.

  • Plain-text mode

    Accept: text/plain returns just the URL and a newline, which is handy in shell scripts. The claim link comes in the X-Anyshare-Claim-Url header.

  • Errors written for people

    {"error":{"code":"…","message":"…"}} with stable codes: bad_request, too_large, too_many_files, unsupported, slug_taken, invalid_slug, unauthorized, not_found, already_claimed, rate_limited, internal. The message can be shown as is.

  • Notes explain what happened

    When there’s something to say, notes explains how the upload was read: a zip was unpacked, a wrapping folder was used, or a single-page app was detected.

  • Rate limits

    Uploads are rate limited per IP address. Over the limit you get 429 with rate_limited; wait and retry with the same idempotency key.

  • Free limits

    50 MB per upload (all files combined), 1,000 files per link. Without an account a link lasts 1 hour; keep it with a free account and it lasts 30 days from the upload.

FAQ

Questions, answered.

Is there an API key?
You don’t need one. Anyone can create a link, and each link gets its own secret token in the create response that authorizes updates and deletion. An account API key (from npx -y @anyshare/cli login) is optional: send it as Authorization: Bearer and links go straight into your account, with no claim step.
Is there an OpenAPI spec?
Not yet. The full reference lives in /llms-full.txt, a plain-text file written for agents to read, and the endpoints are small enough to fit on this page.
Can I choose when a link expires?
Not today. Without an account a link lasts 1 hour; keep it with a free account and it lasts 30 days from the upload. expiresAt in every response says exactly when. Links that don’t expire are part of Pro, which is coming soon.
How do I retry without creating duplicates?
Send an Idempotency-Key header with a UUID on POST, and reuse it on every retry. Retry network errors, 429 and 5xx responses with backoff.
Can I tell you which tool is publishing?
Optionally, yes: X-Anyshare-Source (cli, mcp or api) and X-Anyshare-Client (for example claude-code or codex). They help show who published a link.

Give your agent a URL for any file.

One step to connect, no account or API key. It hands you back a link anyone can open, and a claim link to keep it.