Skip to content
Merged
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
4 changes: 2 additions & 2 deletions apps/portal/src/app/x402/server/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ if (verifyResult.status !== 200) {
}

// Do the expensive work that requires payment
const { tokensUsed } = await callExpensiveAIModel();
const { answer, tokensUsed } = await callExpensiveAIModel();

// Now settle the payment based on actual usage
const pricePerTokenUsed = 0.00001; // ex: $0.00001 per AI model token used
Expand All @@ -119,7 +119,7 @@ const settleResult = await settlePayment({
price: tokensUsed * pricePerTokenUsed, // adjust final price based on usage
});

return Response.json(result);
return Response.json(answer);
```

## Price and Token Configuration
Expand Down
Loading