Migration

Move from Unkey to TosKey

TosKey is API-compatible with Unkey. Migrate in minutes — map your concepts, swap the SDK, and go live.

Concept Mapping

Unkey and TosKey share the same core concepts. Here is how they map:

ConceptUnkeyTosKey
API Keyunkey.keys.create()toskey.keys.create()
Verify KeyPOST /v1/keys/verifyPOST /v1/verify
Rate LimitPOST /v1/ratelimits.limitPOST /v1/ratelimit
Workspaceunkey.workspacestoskey.projects
Identityunkey.identitiestoskey.identities
UsageGET /v1/usageGET /v1/internal/keys/:keyId/usage
AnalyticsUnkey AnalyticsTosKey Usage Dashboard
Webhooksunkey.webhookstoskey.webhooks

Code Migration

Before (Unkey)

import { Unkey } from "@unkey/api"

const unkey = new Unkey({ token: process.env.UNKEY_TOKEN })

// Create a key
const key = await unkey.keys.create({
  apiId: "api_abc123",
  name: "my-key",
  prefix: "sk",
  expires: 1735689600000, // unix ms
})

// Verify a key
const result = await unkey.keys.verify({
  key: "sk_abc123...",
})

// Rate limit
const ratelimit = await unkey.ratelimits.limit({
  identifier: "user_123",
  duration: 60000,
  limit: 100,
})

After (TosKey)

import { TosKey } from "@toskey/sdk"

const toskey = new TosKey({ token: process.env.TOSKEY_TOKEN })

// Create a key
const key = await toskey.keys.create({
  projectId: "proj_abc123",
  name: "my-key",
  prefix: "sk",
  expires: 1735689600000, // unix ms
})

// Verify a key
const result = await toskey.keys.verify({
  key: "sk_abc123...",
})

// Rate limit
const ratelimit = await toskey.ratelimit({
  identifier: "user_123",
  duration: 60000,
  limit: 100,
})

Why migrate to TosKey?

Southeast Asia edge

Regional PoPs in Singapore, Bangkok, and Ho Chi Minh City for sub-2ms latency in SEA.

KHQR prepaid credits

Pay with KHQR — no credit card required. Top up credits and pay as you go.

Full data residency

Your data stays in the region. Compliance-ready for Cambodian and SEA regulations.

Same API, same SDK

Drop-in replacement. Change the import and the token — everything else stays the same.

Ready to migrate?

Start free — no credit card required. Your first 2,500 verifications are on us.