Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|------|-------------|--------------|
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/admin/keys/luca/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/app/api/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);`,
Expand All @@ -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'])`,
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/dashboard/keys/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,13 @@ export default function ApiKeysPage() {
<div>
<p style={{ fontSize: "0.68rem", color: "var(--muted)", marginBottom: 4, textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 700 }}>Bearer token</p>
<code style={{ fontFamily: "var(--font-mono)", fontSize: "0.78rem", background: "var(--surface-soft)", padding: "6px 10px", borderRadius: 6, display: "block" }}>
Authorization: Bearer xb_live_
Authorization: Bearer zt_live_
</code>
</div>
<div>
<p style={{ fontSize: "0.68rem", color: "var(--muted)", marginBottom: 4, textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 700 }}>API key header</p>
<code style={{ fontFamily: "var(--font-mono)", fontSize: "0.78rem", background: "var(--surface-soft)", padding: "6px 10px", borderRadius: 6, display: "block" }}>
X-API-Key: xb_live_
X-API-Key: zt_live_
</code>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/app/developer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default function DeveloperPage() {
padding: "6px 10px", borderRadius: 6,
display: "block",
}}>
Authorization: Bearer xb_live_
Authorization: Bearer zt_live_
</code>
</div>
<div>
Expand All @@ -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_
</code>
</div>
</div>
Expand Down
22 changes: 11 additions & 11 deletions src/app/docs/luca-skills/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: `{
Expand All @@ -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: `{
Expand Down Expand Up @@ -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: `{
Expand Down Expand Up @@ -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: `{
Expand Down Expand Up @@ -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: `{
Expand Down Expand Up @@ -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: `{
Expand Down Expand Up @@ -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: `{
Expand Down Expand Up @@ -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 (
<div style={{ minHeight: "100vh", background: "var(--bg)", color: "var(--ink)" }}>
Expand All @@ -302,7 +302,7 @@ export default function LucaSkillsDocsPage() {
</div>
<div style={{ padding: "6px 14px", background: "var(--surface)", border: "1px solid var(--line)", borderRadius: 6, fontSize: 12 }}>
<span style={{ color: "var(--muted)" }}>Auth: </span>
<code style={{ fontFamily: "var(--font-mono)", color: "var(--ink)", fontWeight: 600 }}>Authorization: Bearer xb_live_...</code>
<code style={{ fontFamily: "var(--font-mono)", color: "var(--ink)", fontWeight: 600 }}>Authorization: Bearer zt_live_...</code>
</div>
<Link href="/developer" style={{ padding: "6px 14px", background: "#6DB874", color: "#fff", borderRadius: 6, fontSize: 12, fontWeight: 700, textDecoration: "none" }}>
Get API Key →
Expand Down Expand Up @@ -451,13 +451,13 @@ export default function LucaSkillsDocsPage() {
</p>
<CodeBlock code={`# Option 1 — Bearer token (recommended)
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"}'

# Option 2 — X-API-Key header
curl -X POST https://www.zettaai.co/api/luca/skills/agent-books \\
-H "X-API-Key: xb_live_..." \\
-H "X-API-Key: zt_live_..." \\
-H "Content-Type: application/json" \\
-d '{"slug": "aeon"}'`} />
<div style={{ display: "flex", gap: 10, marginTop: 16, flexWrap: "wrap" }}>
Expand Down
4 changes: 2 additions & 2 deletions src/app/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ Content-Type: application/json
<div className="docs-code-block">
<div className="docs-code-head"><span>Request</span></div>
<pre>{`GET /api/v1/agent-financial-state?wallet=0x...&range=30d
Authorization: Bearer xb_live_...`}</pre>
Authorization: Bearer zt_live_...`}</pre>
</div>
<div className="docs-code-block">
<div className="docs-code-head"><span>Response (excerpt)</span></div>
Expand Down Expand Up @@ -607,7 +607,7 @@ Authorization: Bearer xb_live_...`}</pre>
<div className="docs-code-block">
<div className="docs-code-head"><span>Request</span></div>
<pre>{`GET /api/v1/agent-report?agentName=Aeon&days=7
Authorization: Bearer xb_live_...`}</pre>
Authorization: Bearer zt_live_...`}</pre>
</div>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/lib/api-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading