Skip to main content
Token Layer exposes the same protocol surface through three integration paths:
  • raw HTTP calls against the REST API
  • the TypeScript SDK for typed app integrations
  • the Rust CLI for agents, scripts, and terminal workflows

Base URLs

export TL_API_URL="https://api.tokenlayer.network/functions/v1"
export TL_TESTNET_API_URL="https://api-testnet.tokenlayer.network/functions/v1"

Choose your integration path

REST API

Direct HTTP access to the full public surface

TypeScript SDK

Typed client for /token-layer and /info

CLI

Scriptable command surface for agents and operators

Option 1: Start with raw HTTP

Use POST /info for read-oriented operations and POST /token-layer for action execution.
curl -X POST "${TL_API_URL}/info" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "getTokensV2",
    "keyword": "base",
    "limit": 10,
    "offset": 0,
    "order_by": "volume_24h",
    "order_direction": "DESC"
  }'
For authenticated requests:
curl -X GET "${TL_API_URL}/me" \
  -H "Authorization: Bearer ${TL_API_KEY}"

Option 2: Start with the SDK

npm install @token-layer/sdk-typescript viem
import { TokenLayer } from "@token-layer/sdk-typescript";

const tokenLayer = new TokenLayer({
  baseUrl: "https://api.tokenlayer.network/functions/v1",
  auth: { type: "apiKey", token: process.env.TL_API_KEY! },
});

const tokens = await tokenLayer.info.getTokensV2({
  keyword: "base",
  limit: 10,
  offset: 0,
  order_by: "volume_24h",
  order_direction: "DESC",
});

Option 3: Start with the CLI

cd packages/token-layer-cli
cargo install --path .

tokenlayer init --quick-wallet --name default
tokenlayer info get-tokens-v2 --order-by volume_24h --limit 10

Authentication

Depending on the endpoint and client, Token Layer supports:
  • API key auth
  • JWT auth
  • wallet-signed auth for supported flows

Next steps