From a0d2aa59f94e862f6f729beebb9243c1ed3af373 Mon Sep 17 00:00:00 2001
From: Claude
Date: Tue, 23 Jun 2026 08:04:14 +0000
Subject: [PATCH] =?UTF-8?q?chore:=20rename=20API=20key=20prefix=20xb=5Fliv?=
=?UTF-8?q?e=5F=20=E2=86=92=20zt=5Flive=5F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Aligns key prefix with Zetta AI brand. Validation is hash-based so
existing keys are unaffected — only newly generated keys use the new prefix.
Co-Authored-By: Claude Sonnet 4.6
Claude-Session: https://claude.ai/code/session_01RHDXdEbGQsn88zks713gye
---
README.md | 2 +-
src/app/api/admin/keys/luca/route.ts | 2 +-
src/app/api/page.tsx | 4 ++--
src/app/dashboard/keys/page.tsx | 4 ++--
src/app/developer/page.tsx | 4 ++--
src/app/docs/luca-skills/page.tsx | 22 +++++++++++-----------
src/app/docs/page.tsx | 4 ++--
src/lib/api-keys.ts | 6 +++---
8 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/README.md b/README.md
index 4e39b02..01a4d4b 100644
--- a/README.md
+++ b/README.md
@@ -110,7 +110,7 @@ Public REST API with key-based auth and $LUCA token-gated rate limits.
**Base URL:** `https://www.zettaai.co/api/v1`
-**Auth:** `Authorization: Bearer xb_live_...` or `X-API-Key: xb_live_...`
+**Auth:** `Authorization: Bearer zt_live_...` or `X-API-Key: zt_live_...`
| Tier | Requirement | Requests/day |
|------|-------------|--------------|
diff --git a/src/app/api/admin/keys/luca/route.ts b/src/app/api/admin/keys/luca/route.ts
index eab399f..e27dfd9 100644
--- a/src/app/api/admin/keys/luca/route.ts
+++ b/src/app/api/admin/keys/luca/route.ts
@@ -69,7 +69,7 @@ export async function POST(req: NextRequest) {
.eq("is_active", true);
// Generate new key
- const raw = "xb_live_" + randomHex(20);
+ const raw = "zt_live_" + randomHex(20);
const hash = await sha256hex(raw);
const prefix = raw.slice(0, 16);
diff --git a/src/app/api/page.tsx b/src/app/api/page.tsx
index 4034ff8..860ac21 100644
--- a/src/app/api/page.tsx
+++ b/src/app/api/page.tsx
@@ -33,7 +33,7 @@ console.log(stats.wallets_declared_or_above); // 15
// Fetch treasury health (API key)
const state = await fetch(
'https://www.zettaai.co/api/v1/agent-financial-state?wallet=0x...&range=30d',
- { headers: { 'Authorization': 'Bearer xb_live_...' } }
+ { headers: { 'Authorization': 'Bearer zt_live_...' } }
);
const data = await state.json();
console.log(data.financial_health.budget_status);`,
@@ -48,7 +48,7 @@ print(stats['wallets_declared_or_above']) # 15
state = requests.get(
'https://www.zettaai.co/api/v1/agent-financial-state',
params={'wallet': '0x...', 'range': '30d'},
- headers={'Authorization': 'Bearer xb_live_...'}
+ headers={'Authorization': 'Bearer zt_live_...'}
).json()
print(state['financial_health']['budget_status'])`,
};
diff --git a/src/app/dashboard/keys/page.tsx b/src/app/dashboard/keys/page.tsx
index 57fdb42..62497fb 100644
--- a/src/app/dashboard/keys/page.tsx
+++ b/src/app/dashboard/keys/page.tsx
@@ -300,13 +300,13 @@ export default function ApiKeysPage() {
Bearer token
- Authorization: Bearer xb_live_…
+ Authorization: Bearer zt_live_…
API key header
- X-API-Key: xb_live_…
+ X-API-Key: zt_live_…
diff --git a/src/app/developer/page.tsx b/src/app/developer/page.tsx
index 4246b7f..8fc0ba3 100644
--- a/src/app/developer/page.tsx
+++ b/src/app/developer/page.tsx
@@ -180,7 +180,7 @@ export default function DeveloperPage() {
padding: "6px 10px", borderRadius: 6,
display: "block",
}}>
- Authorization: Bearer xb_live_…
+ Authorization: Bearer zt_live_…
@@ -194,7 +194,7 @@ export default function DeveloperPage() {
padding: "6px 10px", borderRadius: 6,
display: "block",
}}>
- X-API-Key: xb_live_…
+ X-API-Key: zt_live_…
diff --git a/src/app/docs/luca-skills/page.tsx b/src/app/docs/luca-skills/page.tsx
index 77415f2..1565200 100644
--- a/src/app/docs/luca-skills/page.tsx
+++ b/src/app/docs/luca-skills/page.tsx
@@ -19,7 +19,7 @@ const SKILLS = [
{ field: "chain", type: "string", required: false, desc: "Chain name. Default: base" },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/wallet-audit \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"address": "0xf1e958db7d1e4c074377946018ad645db4fb158e"}'`,
example_response: `{
@@ -42,7 +42,7 @@ const SKILLS = [
{ field: "period", type: "string", required: false, desc: "Time window. One of: 7d, 14d, 30d, 90d. Default: 30d" },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/agent-books \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"slug": "aeon", "period": "30d"}'`,
example_response: `{
@@ -71,7 +71,7 @@ const SKILLS = [
{ field: "address", type: "string", required: false, desc: "Single wallet address. Required if slug not provided." },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/treasury-monitor \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"slug": "aeon"}'`,
example_response: `{
@@ -100,7 +100,7 @@ const SKILLS = [
{ field: "period", type: "string", required: false, desc: "Time window. One of: 7d, 14d, 30d, 90d. Default: 30d" },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/revenue-analysis \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"slug": "aeon", "period": "30d"}'`,
example_response: `{
@@ -128,7 +128,7 @@ const SKILLS = [
{ field: "query", type: "string", required: true, desc: "Agent slug, name fragment, or 0x wallet address" },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/registry-check \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"query": "aeon"}'`,
example_response: `{
@@ -164,7 +164,7 @@ const SKILLS = [
{ field: "period", type: "string", required: false, desc: "Time window. One of: 7d, 14d, 30d, 90d. Default: 30d" },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/luca-report \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"slug": "aeon", "period": "30d"}'`,
example_response: `{
@@ -202,7 +202,7 @@ const SKILLS = [
{ field: "period", type: "string", required: false, desc: "Activity period. Default: 30d" },
],
example_request: `curl -X POST https://www.zettaai.co/api/luca/skills/b20-token-analysis \\
- -H "Authorization: Bearer xb_live_..." \\
+ -H "Authorization: Bearer zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"address": "0xb2b335f832fd3f43461ebd1cd9831d93d9ca4ba3"}'`,
example_response: `{
@@ -278,7 +278,7 @@ export default function LucaSkillsDocsPage() {
const skill = SKILLS.find((s) => s.id === activeSkill) ?? SKILLS[0];
const exampleWithKey = showBearer
? skill.example_request
- : skill.example_request.replace('Authorization: Bearer xb_live_..."', 'X-API-Key: xb_live_..."');
+ : skill.example_request.replace('Authorization: Bearer zt_live_..."', 'X-API-Key: zt_live_..."');
return (
@@ -302,7 +302,7 @@ export default function LucaSkillsDocsPage() {
Auth:
- Authorization: Bearer xb_live_...
+ Authorization: Bearer zt_live_...
Get API Key →
@@ -451,13 +451,13 @@ export default function LucaSkillsDocsPage() {
diff --git a/src/app/docs/page.tsx b/src/app/docs/page.tsx
index 41b596d..75c53c8 100644
--- a/src/app/docs/page.tsx
+++ b/src/app/docs/page.tsx
@@ -577,7 +577,7 @@ Content-Type: application/json
Request
{`GET /api/v1/agent-financial-state?wallet=0x...&range=30d
-Authorization: Bearer xb_live_...`}
+Authorization: Bearer zt_live_...`}
Response (excerpt)
@@ -607,7 +607,7 @@ Authorization: Bearer xb_live_...`}
Request
{`GET /api/v1/agent-report?agentName=Aeon&days=7
-Authorization: Bearer xb_live_...`}
+Authorization: Bearer zt_live_...`}
diff --git a/src/lib/api-keys.ts b/src/lib/api-keys.ts
index bada023..bc167fd 100644
--- a/src/lib/api-keys.ts
+++ b/src/lib/api-keys.ts
@@ -5,7 +5,7 @@ import { verifyMessage } from "viem";
import { getSupabaseAdminClient, hasSupabaseAdminEnv } from "@/lib/supabase-admin";
import { type LucaTier, TIER_LIMITS, getWalletTier } from "@/lib/luca-token";
-const KEY_PREFIX = "xb_live_";
+const KEY_PREFIX = "zt_live_";
function todayUtc(): string {
return new Date().toISOString().slice(0, 10); // YYYY-MM-DD
@@ -51,9 +51,9 @@ export async function createApiKey(
): Promise<{ key: string; record: ApiKeyRecord } | null> {
if (!hasSupabaseAdminEnv()) return null;
- const raw = KEY_PREFIX + randomHex(20); // xb_live_ + 40 hex = 48 chars total
+ const raw = KEY_PREFIX + randomHex(20); // zt_live_ + 40 hex = 48 chars total
const hash = await sha256hex(raw);
- const prefix = raw.slice(0, 16); // "xb_live_XXXXXXXX"
+ const prefix = raw.slice(0, 16); // "zt_live_XXXXXXXX"
const supabase = getSupabaseAdminClient();
const { data, error } = await supabase