x402

Alphakek API is also available via x402 - an open, neutral standard for internet-native payments.

Alphakek x402 Gateway provides the following endpoints:

New x402 endpoints are being added regularly. Please reach out on Twitter if you want a specific endpoint to be prioritized.

import { Wallet } from "ethers";
import { wrapFetch } from "x402-fetch";
const PRIVATE_KEY = "faaa8824...c33816";
const wallet = new Wallet(PRIVATE_KEY);
const fetchX402 = wrapFetch(wallet);
const response = await fetchX402(
    "https://api.alphakek.ai/x402/knowledge/ask",
    {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
            question: "how to start a fake somali daycare..."
        })
    }
);
const data = await response.json();
console.log(`Status: ${response.status}`);
console.log(`Response:\n${data.answer}`);

The response format is equivalent to POST /knowledge/ask.

Further reading:

Last updated