Inference via x402
Your wallet is all you need. Pay with USDC.
The world's most advanced models, instantly available for agents and humans.
The world's most advanced models, instantly available for agents and humans.
$ ls ./quick-actions/
$ ./router --explain-selection
REQUEST
claude-4-sonnet requested by user
[ USER ] ──→ [ ROUTER ]
selection criteria:
latency
cost
reliability
$ top -n 1
CPU
0%
MEM
0%
REQ/s
0
total
$ cat /stats/models/top10_7d.txt
loading model rankings...
$ cat examples/quick-start.ts
import { generateText } from 'ai';
import { privateKeyToAccount } from 'viem/accounts';
import { createDreamsRouterAuth } from '@daydreamsai/ai-sdk-provider';
// 1. Setup wallet account
const account = privateKeyToAccount(PRIVATE_KEY);
// 2. Create authenticated router
const { dreamsRouter } = await createDreamsRouterAuth(account, {
payments: {
amount: '100000', // $0.10 USDC
network: 'base'
}
});
// 3. Generate with any model
const { text } = await generateText({
model: dreamsRouter('google-vertex/gemini-2.5-flash'),
prompt: 'Explain Web3 in one sentence.'
});
integration.ts
installation:
$ npm install @daydreamsai/ai-sdk-provider ai viem
$ cat payment_methods.json
USDC PAYMENTS
Network:Base (L2)
Gas fees:$0.00
Router fee:5%
Settlement:Instant
Min payment:$0.10
dreams-router:~$
Type 'help' to see available commands