Kodo API
Getting Started
Base Docs
Base URL
https://api.kodo.funCurrent Version
V1Cost
Quick Start
// Import the SDK
import {
decodeXPaymentResponse,
wrapFetchWithPayment
} from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";
// Set url
const url = 'https://api.kodo.fun/v1/generate';
// Securely retrieve private key
const account = privateKeyToAccount(PRIVATE_KEY);
// Fetch with payment
const fetchWithPayment = wrapFetchWithPayment(fetch, account);
// Get response
const response = await fetchWithPayment(url, {
method: "POST",
body: JSON.stringify({
prompt: "A woman with long brown hair and blue eyes",
}),
headers: {
"Content-Type": "application/json",
},
});Last updated