Receiving Payments from AI Agents
This functionality isn't publicly available yet. Reach out to [email protected] if you'd like an early look.
Create an account
Go to Skyfire.xyz and create a receiver account.
To create an account, you will only need your username and phone number.
After your account is created, you will need to register your API with Skyfire. This will allow Skyfire users to interact with your API using Skyfire for payment.
Set up quotes for your API
Set up our API quotes on the Skyfire Dashboard. This quote dictates how much users will be charged for requests to your API. The simplest quote is a fixed price per request.
Claim your earnings
When users call your API with a valid claim token, you accrue unclaimed earnings. You can claim your earnings at any time via the Skyfire Dashboard or by using the sdk.
Claim on the dashboard
Go to Skyfire.xyz to claim earnings
Claim via the SDK
// redeem claims when you have over 100 USDC in earnings
const balance = skyfire.getBalance()
if (balance.claims.received > 100_000_000) {
const rsp = skyfire.redeemClaims()
}
Quick Start - Integrate your API with Skyfire Payments
Follow this if you wish to integrate your API directly with Skyfire payments.
-
Step 1: Install the Skyfire SDK
npm install @skyfire/receiver-sdk
-
Step 2: Initialize the SDK
import { SkyfireClient } from '@skyfire/receiver-sdk' const skyfire = new SkyfireClient({ apiKey: 'YOUR_API_KEY' })
-
Step 3: Integrate your API authentication with Skyfire payments.
Integrating skyfire payments is as simple as verifying the claim token sent by the sender.
// example of using express middleware to authenticate skyfire requests app = express() app.use((req, res, next) => { const token = req.headers['x-skyfire-claim'] if (token) { // validate that the token is correct and contains the claim for a single request const claim = skyfire.verifyClaim(token) req.claim = claim // continue with your own auth flow next() } })
Updated about 1 month ago