TosKey is API-compatible with Unkey. Migrate in minutes — map your concepts, swap the SDK, and go live.
Unkey and TosKey share the same core concepts. Here is how they map:
| Concept | Unkey | TosKey |
|---|---|---|
| API Key | unkey.keys.create() | toskey.keys.create() |
| Verify Key | POST /v1/keys/verify | POST /v1/verify |
| Rate Limit | POST /v1/ratelimits.limit | POST /v1/ratelimit |
| Workspace | unkey.workspaces | toskey.projects |
| Identity | unkey.identities | toskey.identities |
| Usage | GET /v1/usage | GET /v1/internal/keys/:keyId/usage |
| Analytics | Unkey Analytics | TosKey Usage Dashboard |
| Webhooks | unkey.webhooks | toskey.webhooks |
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,
})Regional PoPs in Singapore, Bangkok, and Ho Chi Minh City for sub-2ms latency in SEA.
Pay with KHQR — no credit card required. Top up credits and pay as you go.
Your data stays in the region. Compliance-ready for Cambodian and SEA regulations.
Drop-in replacement. Change the import and the token — everything else stays the same.
Start free — no credit card required. Your first 2,500 verifications are on us.