openshrtr for AI agents

openshrtr shortens links and judges every click: a person or a machine. An AI agent can open an account with one API request and get a key, free within published limits, with no email and no human. With the key it creates short links and reads how many clicks came from people the analyzer confirmed and how many from machines.

The API lives at https://openshrtr.com/api/v1. It is JSON over HTTPS with a key in the Authorization header. These instructions are also at https://openshrtr.com/agents, in Markdown at https://openshrtr.com/llms.txt and as OpenAPI 3.1 at https://openshrtr.com/openapi.json.

What it is for

What it is not

How a click is judged

A short link does not redirect at once. It opens a thin check page that runs a script for up to 1.5 seconds, collects device and behavior signals, and then sends the visitor on: people to the target, machines to the decoy when there is one.

The analyzer turns the signals into a verdict (human, machine or unclear) with the evidence for each side. A client that does not run JavaScript gets no verdict; the page sends it to the decoy if there is one, otherwise to the target.

Opening a short link with curl returns the check page (HTTP 200), not a redirect, and the click is counted under machines because curl names itself in its User-Agent. A click by a person on a phone or a computer is what fills the humans counter.

A test click of your own, with curl or any other client, stays in the counters: single clicks cannot be removed, only the whole link with all its clicks.

During the check the visitor's browser also sends a request to api4.ipify.org and api6.ipify.org to learn its own IPv4 and IPv6 addresses.

Quick start

  1. Create an account and get a key. The answer holds api_key (shown once) and a 12-word phrase for the dashboard. The next steps read the key from a variable: export OPENSHRTR_API_KEY=sk_….
    curl -s -X POST https://openshrtr.com/api/v1/agents \
      -H "Content-Type: application/json" \
      -d '{"name": "my-agent"}'
  2. Create a short link. The answer holds url, the short address to share, and code. The next step reads the code from a variable: export LINK_CODE=….
    curl -s -X POST https://openshrtr.com/api/v1/links \
      -H "Authorization: Bearer $OPENSHRTR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"target": "https://example.com/page"}'
  3. Read the counters. counts.humans is clicks confirmed as people; counts.machines, counts.unclear and counts.no_verdict are the rest. A recent click where the check ran carries its evidence; for the others any machine sign is in signals.
    curl -s https://openshrtr.com/api/v1/links/$LINK_CODE \
      -H "Authorization: Bearer $OPENSHRTR_API_KEY"

Authentication

Every request except GET /api/v1 and POST /api/v1/agents needs the key, as Authorization: Bearer sk_… or as X-API-Key: sk_…. Cookies are not accepted.

Whoever holds the key controls the account. If it leaks, POST /api/v1/key/rotate replaces it. A lost key cannot be recovered.

Browsers may call the API from any site: answers carry Access-Control-Allow-Origin: *.

Endpoints

GET /api/v1 — What this API is

A short pointer: the service, whether agent sign-up is open, and where the documentation is. No key needed.

Key: not needed.

curl -s https://openshrtr.com/api/v1

Answer 200:

{
  "service": "openshrtr",
  "about": "Short links that tell a human from a bot.",
  "signup_open": true,
  "signup": "POST https://openshrtr.com/api/v1/agents",
  "docs": {
    "html": "https://openshrtr.com/agents",
    "markdown": "https://openshrtr.com/llms.txt",
    "openapi": "https://openshrtr.com/openapi.json"
  }
}

Errors: rate_limited.

POST /api/v1/agents — Create an agent account and a key

One request, no key, no email. The answer holds the API key and a 12-word phrase; both are shown only once, the service keeps only their hashes.

The key and the phrase are secrets: they belong out of logs, out of replies to users and out of public places. Whoever holds either of them controls the account.

From one address: 3 sign-ups in a row, then one every 10 minutes. For the whole service: 300 new agent accounts per UTC day.

Key: not needed.

Body (JSON):

  • name (optional): How the agent calls itself, up to 80 characters. Shown to the service administrator as plain text; control characters are removed.
curl -s -X POST https://openshrtr.com/api/v1/agents \
  -H "Content-Type: application/json" \
  -d '{"name": "my-agent"}'

Answer 201:

{
  "api_key": "sk_q8Xv2mN4pL6tR9wY1zA3cE5gJ7kM0oQs",
  "phrase": "orbit sauce timber glow minute vessel cradle eager throw lunar quote spike",
  "account": {
    "label": "key:1a2b3c4d",
    "name": "my-agent",
    "origin": "agent",
    "created_at": "2026-11-26T10:00:00.000Z"
  },
  "limits": {
    "links_per_account": 100,
    "new_links_per_hour": 60,
    "requests_per_minute": 120
  },
  "docs": "https://openshrtr.com/agents",
  "sign_in": "https://openshrtr.com/login"
}

Errors: invalid_json, invalid_request, body_too_large, signup_paused, rate_limited, daily_signup_limit.

GET /api/v1/me — The account, its limits and usage

Who the key belongs to, how many links the account holds and the limits in force.

Key: required.

curl -s https://openshrtr.com/api/v1/me \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY"

Answer 200:

{
  "account": {
    "label": "key:1a2b3c4d",
    "name": "my-agent",
    "origin": "agent",
    "created_at": "2026-11-26T10:00:00.000Z"
  },
  "links": {
    "used": 1,
    "limit": 100
  },
  "limits": {
    "links_per_account": 100,
    "new_links_per_hour": 60,
    "requests_per_minute": 120
  }
}

Errors: missing_api_key, invalid_api_key, conflicting_api_keys, rate_limited.

POST /api/v1/links — Create a short link

Every link opens the check page first (the deep check is always on), so each click gets a verdict when the visitor's browser runs the page script.

The account holds up to 100 links (deleting one frees a place; disabling does not) and creates up to 60 links an hour.

Key: required.

Body (JSON):

  • target (required): Where people are sent: an http or https address up to 2048 characters, without a user name or password, not on this service's own domains. Without a scheme, https:// is assumed.
  • title (optional): Your label, up to 200 characters.
  • domain (optional): Short domain for the link, one of shrtr.win, openshrtr.com; by default shrtr.win.
  • decoy (optional): Where machines are sent instead of the target: an http or https address without a user name or password, or "rickroll" for a harmless video. Omit for no decoy: then machines reach the target too.
curl -s -X POST https://openshrtr.com/api/v1/links \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target": "https://example.com/page"}'

Answer 201:

{
  "code": "k7Qm2x",
  "url": "https://shrtr.win/k7Qm2x",
  "target": "https://example.com/page",
  "title": null,
  "decoy": null,
  "active": true,
  "created_at": "2026-11-26T10:00:00.000Z",
  "last_click_at": null,
  "counts": {
    "clicks": 0,
    "humans": 0,
    "human_devices": 0,
    "machines": 0,
    "unclear": 0,
    "no_verdict": 0
  }
}

Errors: missing_api_key, invalid_api_key, invalid_json, invalid_request, invalid_target, invalid_decoy, invalid_domain, body_too_large, link_limit_reached, rate_limited.

All links of the account, newest first, each with its counters.

Key: required.

curl -s https://openshrtr.com/api/v1/links \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY"

Answer 200:

{
  "links": [
    {
      "code": "k7Qm2x",
      "url": "https://shrtr.win/k7Qm2x",
      "target": "https://example.com/page",
      "title": null,
      "decoy": null,
      "active": true,
      "created_at": "2026-11-26T10:00:00.000Z",
      "last_click_at": "2026-11-26T12:30:00.000Z",
      "counts": {
        "clicks": 12,
        "humans": 7,
        "human_devices": 6,
        "machines": 3,
        "unclear": 1,
        "no_verdict": 1
      }
    }
  ]
}

Errors: missing_api_key, invalid_api_key, rate_limited.

Counters, the last 30 UTC days (oldest first, today included) and up to 100 latest clicks, each with its group, machine signs and, where the check ran, the verdict, confidence and evidence. Visitor addresses are never returned.

A code that does not exist and a code of another account get the same 404.

Key: required.

curl -s https://openshrtr.com/api/v1/links/$LINK_CODE \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY"

Answer 200:

{
  "link": {
    "code": "k7Qm2x",
    "url": "https://shrtr.win/k7Qm2x",
    "target": "https://example.com/page",
    "title": null,
    "decoy": null,
    "active": true,
    "created_at": "2026-11-26T10:00:00.000Z",
    "last_click_at": "2026-11-26T12:30:00.000Z",
    "counts": {
      "clicks": 12,
      "humans": 7,
      "human_devices": 6,
      "machines": 3,
      "unclear": 1,
      "no_verdict": 1
    }
  },
  "daily": [
    {
      "date": "2026-11-26",
      "clicks": 12,
      "humans": 7,
      "machines": 3,
      "unclear": 1,
      "no_verdict": 1
    }
  ],
  "recent_clicks": [
    {
      "at": "2026-11-26T12:30:00.000Z",
      "kind": "human",
      "verdict": "human",
      "confidence": 85,
      "evidence": {
        "for_machine": [],
        "for_human": [
          "Time zone Europe/Berlin",
          "Screen 390x844 @3x"
        ]
      },
      "signals": {
        "declared_bot": false,
        "scanner": false,
        "burst": false
      },
      "engine": "2026.11.25",
      "country": "Germany",
      "country_code": "DE",
      "device": "mobile",
      "os": "iOS",
      "browser": "Safari",
      "referrer_host": null
    }
  ]
}

Errors: missing_api_key, invalid_api_key, not_found, rate_limited.

{"active": false} makes the link answer "Link not found" to visitors; true turns it back on. Counters stay.

Key: required.

Body (JSON):

  • active (required): true to turn the link on, false to turn it off.
curl -s -X PATCH https://openshrtr.com/api/v1/links/$LINK_CODE \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"active": false}'

Answer 200:

{
  "code": "k7Qm2x",
  "url": "https://shrtr.win/k7Qm2x",
  "target": "https://example.com/page",
  "title": null,
  "decoy": null,
  "active": false,
  "created_at": "2026-11-26T10:00:00.000Z",
  "last_click_at": "2026-11-26T12:30:00.000Z",
  "counts": {
    "clicks": 12,
    "humans": 7,
    "human_devices": 6,
    "machines": 3,
    "unclear": 1,
    "no_verdict": 1
  }
}

Errors: missing_api_key, invalid_api_key, invalid_json, invalid_request, not_found, rate_limited.

Deletes the link together with all its clicks. This cannot be undone.

Key: required.

curl -s -X DELETE https://openshrtr.com/api/v1/links/$LINK_CODE \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY"

Answer 200:

{
  "deleted": "k7Qm2x"
}

Errors: missing_api_key, invalid_api_key, not_found, rate_limited.

POST /api/v1/key/rotate — Replace the key

Issues a new key for the same account. The old key stops working at once. The new key is shown only in this answer.

Key: required.

curl -s -X POST https://openshrtr.com/api/v1/key/rotate \
  -H "Authorization: Bearer $OPENSHRTR_API_KEY"

Answer 200:

{
  "api_key": "sk_N3wKeyN3wKeyN3wKeyN3wKeyN3wKeyN3"
}

Errors: missing_api_key, invalid_api_key, rate_limited.

Counters

FieldMeaning
clicksEvery recorded click on the link.
humansClicks the analyzer confirmed as a person. The same number the dashboard shows as Humans.
human_devicesDistinct devices among the confirmed humans (by device fingerprint).
machinesClicks that are not confirmed humans and carry a machine sign: a User-Agent that names a bot or a tool, a data-center address, a burst, or the analyzer's machine verdict.
unclearThe analyzer ran but found neither a machine sign nor enough evidence of a person.
no_verdictThe check did not finish (no JavaScript, the visitor left early, a prefetch) and no machine sign was seen.

clicks = humans + machines + unclear + no_verdict. Each click is in exactly one group, and the group of a click is its kind.

No rates are computed. humans divided by clicks is the share of recorded clicks confirmed as people; it is not a delivery rate and not a conversion rate.

Each click in recent_clicks has a kind:

Fields of a click:

Limits

Errors

Errors come as JSON: {"error": "...", "code": "...", "docs": "https://openshrtr.com/agents#errors"}. error is for people, code is stable.

Requests over a limit get 429 with a Retry-After header in seconds. Limits are checked before any other work, so a refused request changes nothing.

StatusCodeMeaning
400invalid_jsonThe body is not valid JSON.
400invalid_requestA field is missing or has the wrong type; the error text names it.
400invalid_targettarget is not an http or https address, carries a user name or password (user@host), is longer than 2048 characters, or points to this service.
400invalid_decoydecoy is not an http or https address (or "rickroll"), or carries a user name or password.
400invalid_domaindomain is not one of shrtr.win, openshrtr.com.
400conflicting_api_keysAuthorization and X-API-Key carry two different keys.
401missing_api_keyNo key in the request.
401invalid_api_keyThe key is unknown, replaced, malformed, or its account is disabled.
403link_limit_reachedThe account already holds 100 links; delete one to make room.
403signup_pausedAgent sign-up is paused; keys already issued keep working.
404not_foundNo such endpoint, or no link with this code in your account.
405method_not_allowedThe endpoint exists but not with this method; the Allow header lists the methods.
413body_too_largeThe body is larger than 8 KB.
429rate_limitedToo many requests; the Retry-After header says how many seconds to wait.
429daily_signup_limitThe service has reached 300 new agent accounts today; Retry-After points to 00:00 UTC.
500server_errorSomething failed on our side.

Rules of use

For a person

The sign-up answer holds a 12-word phrase. A person who has it signs in at https://openshrtr.com/login, tab "Secret phrase", and sees the same links in the dashboard with the full click breakdown.

The phrase cannot be recovered, and whoever holds it controls the account.

Machine-readable