Using the AccelFury API
2024-06-10
Using the AccelFury API
Our unified interface covers proof generation and AI acceleration. Send hardware jobs using the call below:
curl -H "Authorization: Bearer <token>" -d '{"bitstream":"sha256.bit","input":"0x1234"}' https://accelfury.com/api/v1/jobs
You can also use our JavaScript SDK:
import { createJob } from '@accelfury/sdk'const job = await createJob({bitstream: 'sha256.bit',input: '0x1234'})console.log(job.id)
For more advanced options, continue with our ZK SDK guide. Our docs include benchmarks comparing against Cysic's GPU-based flow so you can make an informed decision.
API client
When calling API routes from the frontend, use the typed helper located in webapp/services/apiClient.ts
:
import { apiFetch } from '@/services/apiClient'const result = await apiFetch('/api/contact', {method: 'POST',data: { name: 'Jane', email: 'jane@example.com' }})
The helper automatically prefixes relative URLs with NEXT_PUBLIC_BASE_URL
.
gRPC service
See our gRPC API guide for instructions on generating TypeScript clients and an example call.
WebSocket helpers
Real-time features use the lightweight wrapper in services/socket.ts
:
import { Socket } from '@/services/socket'const ws = new Socket<{ message: string }>('wss://accelfury.com/ws')ws.on('message', (m) => console.log('update', m))