generate_api_key
Create a TeleKash API key to access prediction market intelligence tools, including probability data, market analysis, and arbitrage detection across 500+ live markets.
Instructions
Generate a free TeleKash API key for rate-limited access to prediction market intelligence.
Free tier: 100 calls/day, 7 core tools (probability, markets, search, history, sentiment, stats, trending). Calibration tier ($99/mo): 1,000 calls/day + arbitrage, divergence, and performance tracking tools. Edge tier ($499/mo): Unlimited + TPF signals, Kelly sizing, and market creation.
The API key is returned ONCE — save it immediately. Set it as TELEKASH_API_KEY environment variable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner_id | Yes | Your agent or user identifier (used for key management) | |
| owner_email | No | Contact email (optional, for billing if upgrading) |
Implementation Reference
- worker/src/tools.ts:1200-1228 (handler)The handler function that generates, hashes, and stores the API key in Supabase.
async function generateApiKey( supabase: SupabaseClient, args: { owner_id: string; owner_email?: string }, ): Promise<ToolResult> { const key = `tk_${crypto.randomUUID().replace(/-/g, "")}`; const encoder = new TextEncoder(); const hashBuffer = await crypto.subtle.digest("SHA-256", encoder.encode(key)); const keyHash = Array.from(new Uint8Array(hashBuffer)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); const { error } = await supabase.from("telekash_api_keys").insert({ key_hash: keyHash, owner_id: args.owner_id, owner_email: args.owner_email, tier: "free", daily_limit: 100, status: "active", }); if (error) throw new Error(`API key generation failed: ${error.message}`); return json({ api_key: key, tier: "free", daily_limit: 100, _warning: "Save this key now — it cannot be retrieved later.", usage: "Set header: Authorization: Bearer <key>", }); - worker/src/tools.ts:243-247 (registration)Tool dispatching logic that calls the generateApiKey handler.
case "generate_api_key": return generateApiKey( supabase, args as { owner_id: string; owner_email?: string }, ); - worker/src/schema.ts:434-444 (schema)Tool definition including description and input schema.
{ name: "generate_api_key", description: `Generate a free TeleKash API key. Free tier: 100 calls/day. Save the key — shown once.`, inputSchema: { type: "object", properties: { owner_id: { type: "string", description: "Agent or user identifier" }, owner_email: { type: "string", description: "Contact email (optional)", },