> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracefall.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Send with no key, or with an API key for higher limits.

You can send without a key. A key raises your limits.

| | No key | With a key |
| - | - | - |
| How to get it | nothing to do | ask us on X, [@tracefall\_xyz](https://x.com/tracefall_xyz) |
| Rate | 5 sends a second per client address | by tier, from 25 to 500 a second ([Limits](https://docs.tracefall.xyz/limits.md)) |
| Status lookup | any caller can look up a keyless send | only the key that sent it |

An IPv6 client address counts as its /64, so every address of one /64 shares the keyless rate.

## Your key

A key is `tfs_` followed by 48 hex characters. We issue keys on request: for now, ask us on X,
[@tracefall\_xyz](https://x.com/tracefall_xyz). Treat a key like a password.

* **Lost it?** Ask us from the contact we issued it to. We show a key again only to that contact, never to a new one.
* **Leaked?** Tell us, and we revoke it and issue a new one. A revoked key stops working within seconds, on
  connections that are already open too.

## Passing the key

Every request may carry your key, in one of these places. We read them in this order:

1. `Authorization: Bearer <key>`
2. `x-api-key: <key>`
3. `?api-key=<key>` in the URL

```bash Header theme={null}
curl -s https://sender.tracefall.xyz \
  -H "Authorization: Bearer $SENDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"sendTransaction","params":["<base64 transaction>",{"encoding":"base64"}]}'
```

```ts URL (web3.js) theme={null}
import { Connection } from '@solana/web3.js';

const sender = new Connection(`https://sender.tracefall.xyz/?api-key=${process.env.SENDER_KEY}`);
```

```ts URL (WebSocket) theme={null}
const ws = new WebSocket(`wss://sender.tracefall.xyz/v1/ws?api-key=${key}`);
```

Prefer a header: a key in a URL ends up in logs and in browser history. Use the URL form only where a client can set
nothing but a URL, such as a browser's WebSocket, and read [Keys in a web page](#keys-in-a-web-page) first.

> [!WARNING]
>
> A request with a key we do not know, because it was never issued or has been revoked, is refused with `unauthorized`.
> It is never sent keyless instead. Leave the key out to send keyless.

## Keys in a web page

A key used in a web page is public: every visitor can read it, spend your rate and look up your sends. From a browser,
either send keyless, or ask us for a separate key limited per visitor address, so that one visitor can use only a small
part of its rate.

## Checking a key

`GET /v1/ping` with your key answers `{"key": "<prefix>", "tier": "<tier>"}`: the key's prefix and its tier.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.