PublicAML Service API

Internal endpoints called by PublicAML's own services. Not for integrators.

GitHub OpenAPI

Operations 1

POST /v1/service/free-keys SERVICE ONLY: issue a free read-only key for a Telegram user #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/publicaml-org:publicaml-org-service-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

publicaml-org-service-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PublicAML Intelligence Service API
  version: 1.0.0
  summary: 'Blockchain anti-money-laundering intelligence: address risk, entity attribution and fund tracing.'
  description: 'Screen a crypto address, find out what it is and who it belongs to, and follow its money forwards to a cash-out or backwards to its funding. ## Reading a result honestly


    Three things about this data are easy to get wrong and each has cost somebody an incorrect conclusion:


    1. **An unknown address is not a clean address.** /v2/enrich puts addresses it has no data for in `not_found`, not in `entities` with a zero. A brand-new wallet is unknown, not innocent. 2. **`risk.score` is risk, not a proportion of funds.** It combines its parts by MAX, so the components in `risk.breakdown` do not sum to it. 3. **A negative is only as good as its window.** Endpoints that answer ''did this wallet do X'' report how much they actually read (`scan`, `coverage`, `partial`, `truncated`, `degraded`). A `false` next to `negative_conclusive: false` means ''nothing known'', not ''nothing happened''. ## v1 is deprecated, and what that does and does not mean


    Every `/v1/*` response carries `Deprecation: true`, `X-API-Recommended-Version: v2` and a `Link` header pointing here, and JSON object bodies also carry an `api_version` field saying the same thing. Read it as *migrate when you can*, not as *this stops working soon*: **no removal date is set**, which is exactly why no `Sunset` header is sent — that header carries a date, and inventing one would be a promise nobody made. v2 is not a different product. `/v2/enrich` calls the v1 handler and translates the shape, so the two cannot disagree about the facts. What changes is the form: no duplicated fields, and attribution arrives as `axes` — each question about an address answered separately instead of collapsed into one winning category. ## Chains


    bitcoin, ethereum, bsc and tron. The same 0x address exists on ethereum, bsc and tron and is a different wallet on each, so `chain` is part of the identity and never a hint. bitcoin''s graph is bipartite — address → transaction → address — so one hop there is half an economic step, and a `counterparty` field holds a transaction hash rather than an address. ## Auth


    Read endpoints work unauthenticated, rate-limited per client IP. Send `X-API-Key` to remove the limit and see your own pushed labels. ### The anonymous limit, in numbers


    The budget is counted in UNITS, and a unit is one ADDRESS, not one call: a batch of 60 addresses spends 60. This is the part worth reading twice, because a script that batches looks well-behaved by request count and still exhausts an hour''s budget in one call. | bucket | limit | window |

    | --- | --- | --- |

    | anonymous, standard endpoints (`/v2/enrich` among them) | 100 units | 1 hour |

    | anonymous, heavy endpoints (`/v1/trace`, `/v1/counterparties`, `/v1/transactions`, `/v1/address-transactions`, `/v1/address-flows`, `/v1/entity-transfers`, `/v1/tx-enrich`, `/v1/swap-through`, `/v1/cluster-mappings`) | 20 units | 1 hour |

    | authenticated (`X-API-Key` or HMAC) | no limit, unless the key was issued with a quota of its own | — |


    `/v2/enrich` costs one unit per address and draws on the standard bucket: a batch of 60 spends 60 of the 100. The same unit is what a key with a quota of its own is metered in. So the pause to configure is: none, if you send a key. Authenticating removes the limit outright rather than raising it, which is why a bulk check should carry the key even though the endpoint does not require one. A key CAN be issued with a quota — units per window, metered per key rather than per account, so several keys on one contract get independent budgets. Yours has one only if you were told so when it was issued; the `429` body says which case you are in. A rejected request answers `429` with a JSON body naming what it cost you and when to come back — `{"error": "rate limit exceeded", "cost": 60, "limit": 100, "window_sec": 3600, "retry_after": 1973}` — plus a `Retry-After` header.'
  contact:
    name: PublicAML
    url: https://publicaml.org
servers:
- url: https://intelapi.publicaml.org
  description: Production.
security:
- ApiKeyAuth: []
- {}
tags:
- name: Service
  description: Internal endpoints called by PublicAML's own services. Not for integrators.
paths:
  /v1/service/free-keys:
    post:
      operationId: serviceIssueFreeKey
      summary: 'SERVICE ONLY: issue a free read-only key for a Telegram user'
      description: 'Not for integrators. Called by the PublicAML Telegram bot (@PublicAMLbot) to hand its users a free read-only API key.


        Only an allowlisted key-issuing service may call it, with an HMAC-signed request. Everyone else gets `403 key_issuer_required`: anonymous callers, bare `X-API-Key` requests (including the service''s own key sent unsigned) and signed requests from any other customer.


        What is issued is fixed server-side: tier `free`, no HMAC secret (the key is sent bare as `X-API-Key` and can only read), the free-tier quota in units per `window_sec` (2000 per hour), a `tg_` prefix, and `customer_id = tg-`.


        Idempotent per `external_id`: an active key is returned again with `reissued: true` and status 200. A revoked or expired key is `409 key_revoked` and no new key is minted. New keys are capped per rolling 24 hours across the whole endpoint (`429 daily_issue_limit`); returning an existing key is never capped.


        `create: false` only looks: it returns the user''s key (200) or `404 no_key`, never mints one, and neither spends nor is limited by the daily budget. It is what the bot''s `/mykey` uses.


        200 and 201 carry `usage`: the key''s quota spend in the current rate-limit window (the same counter as its `RateLimit-*` headers), plus 24 h and 30 d totals, or `null` when that could not be read.'
      tags:
      - Service
      x-internal: true
      security:
      - HmacSignature: []
        ApiKeyAuth: []
        HmacTimestamp: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - external_id
              additionalProperties: false
              properties:
                external_id:
                  type: string
                  pattern: ^tg:[1-9][0-9]{0,19}$
                  description: '`tg:<telegram_user_id>`. Decides the customer id (`tg-<id>`) one-to-one.'
                display:
                  type: string
                  maxLength: 64
                  description: Optional human-readable name. Written to the service log next to the key fingerprint; not stored with the key and never returned.
                create:
                  type: boolean
                  default: true
                  description: 'false = look up only: return the existing key or `404 no_key`, never create one. Must be a JSON boolean.'
      responses:
        '200':
          description: 'The user already holds an active key; it is returned again (`reissued: true`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssuedFreeKey'
        '201':
          description: 'A new key was issued (`reissued: false`).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IssuedFreeKey'
        '400':
          description: '`invalid_request`: unknown field, missing or malformed `external_id`, `create` not a boolean.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: A credential was sent and did not check out (`invalid_signature`, `timestamp_out_of_window`, ...).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: '`key_issuer_required`: not an allowlisted service, or not HMAC-signed.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '`no_key`: `create: false` and this user has no key. Nothing was created.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: '`key_revoked`: this user''s key was revoked or expired, whatever `create` says. Nothing new is issued.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`daily_issue_limit`: the endpoint-wide budget of new keys for the last 24 hours is spent. Body carries `limit`, `window_sec` (86400) and `retry_after`; a `Retry-After` header too.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: '`issuance_failed`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: '`issuance_paused`: new keys are switched off; existing ones are still returned.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    IssuedFreeKey:
      type: object
      required:
      - api_key
      - tier
      - rate_limit_units
      - window_sec
      - created_at
      - reissued
      properties:
        api_key:
          type: string
          description: '`tg_…`. Send it as `X-API-Key` on every call; it has no secret and cannot sign.'
        key_hint:
          type: string
          description: 16-hex fingerprint, safe to log. The same id usage accounting groups by.
        customer_id:
          type: string
          description: '`tg-<telegram_user_id>`.'
        external_id:
          type: string
        tier:
          type: string
          enum:
          - free
          - pro
          - enterprise
        hmac:
          type: boolean
          const: false
        rate_limit_units:
          type:
          - integer
          - 'null'
          description: Units (addresses) this key may spend per `window_sec`, metered per key across every endpoint. null = unmetered.
        window_sec:
          type: integer
          description: Rate-limit window in seconds (3600 in production).
        created_at:
          type: string
          format: date-time
        reissued:
          type: boolean
          description: true when an existing active key was returned instead of a new one.
        docs:
          type: object
          properties:
            base_url:
              type: string
            console:
              type: string
            openapi:
              type: string
            rate_limits:
              type: string
        usage:
          type:
          - object
          - 'null'
          description: How much of its quota this key has spent. `null` when the rate-limit store or the usage log could not be read; the key itself is still returned. The current-window numbers are read from the same counter the rate limiter charges, so they equal the `RateLimit-*` headers the key's own calls receive. Calling this endpoint never charges the user's key.
          required:
          - window_sec
          - units_limit
          - units_used
          - units_remaining
          - reset_at
          - used_24h
          - used_30d
          - last_used_at
          properties:
            window_sec:
              type: integer
              description: Length of the quota window in seconds (3600 in production).
            units_limit:
              type:
              - integer
              - 'null'
              description: Units per window. null = the key is not metered; then units_used, units_remaining and reset_at are null too.
            units_used:
              type:
              - integer
              - 'null'
              description: Units spent in the current window, rejected (429) requests included, as the limiter counts them.
            units_remaining:
              type:
              - integer
              - 'null'
              description: max(0, units_limit - units_used). Same number as `RateLimit-Remaining`.
            reset_at:
              type:
              - string
              - 'null'
              format: date-time
              description: 'End of the current window, UTC. The window is fixed, not rolling: the whole quota comes back at this instant.'
            used_24h:
              type: integer
              description: Units spent in the last 24 hours, from usage accounting. Trails live traffic by up to ~15 s.
            used_30d:
              type: integer
              description: Units spent in the last 30 days, from usage accounting.
            last_used_at:
              type:
              - string
              - 'null'
              format: date-time
              description: Start of the minute (UTC) of the key's most recent request, or null if it was never used.
    Error:
      type: object
      description: Ordinary failure. `error` is a short machine-readable reason.
      required:
      - error
      properties:
        error:
          type: string
        detail:
          type: string
          description: Present when there is more to say.
        reason:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Public key identifier (`pk_…`). On reads it removes the rate limit and unlocks your own pushed labels. It CANNOT write. A key that is unknown, revoked or expired is refused with `401 invalid_api_key` rather than silently ignored.
    HmacTimestamp:
      type: apiKey
      in: header
      name: X-Timestamp
      description: Unix milliseconds. Must be within 5 minutes of server time.
    HmacSignature:
      type: apiKey
      in: header
      name: X-Signature
      description: Hex HMAC-SHA256 over `{timestamp}\n{METHOD}\n{path}\n{body}` keyed with your secret, where `{path}` is the request path and, ONLY when the URL has a query string, `?` plus the query exactly as sent (`/v1/webhooks/events?endpoint_id=we_1&limit=50`); without a query there is no `?` (`/v1/webhooks/endpoints`, not `/v1/webhooks/endpoints?` — that fails with `invalid_signature`). `{body}` is the raw body, empty when there is none. Required on every write. Sending X-Timestamp or X-Signature commits the request to this path — a bad signature fails outright rather than falling back to key-only auth.