Self-hosted
A node runs inside your own Fastify app. Resource functions execute in your process, and their code never leaves your server.
Open source · Peer-to-peer
Stellarium is a decentralized, programmable API network where anyone can host an API and get paid for it.
npm install stellarium-ts fastify requestscriptOverview
A resource is a named object with typed functions, hosted on a node. Nodes share the resources they know about with their peers. Programs call resources by name, and each call is routed to the node that hosts it.
A node runs inside your own Fastify app. Resource functions execute in your process, and their code never leaves your server.
Programs refer to resources by full name, like com.example.Weather. Your node works out which peer hosts each one and forwards the call.
Start a node with the address of any running peer. It copies that peer's peer and resource lists, then announces itself to the network.
How it works
Register functions on your node. They run locally when called.
await node.register({
metadata: {},
path: "com.example",
name: "Weather",
functions: [{
name: "temperature",
parameters: [{ name: "city", type: "string" }],
returnType: "int32",
exec: async (args) => 12,
}],
});Name the resources you need and call them. No URLs or API keys.
request GetTemperature {
const weather: com.example.Weather
const reading = weather.temperature(city: "Oslo")
if (reading.error != null) {
return reading.error.message
}
return reading.value
}Send the request to POST /v1/run on any node.
{ "returnValue": 12 }A failed resource call returns an error value the script can check. It doesn't fail the whole request.
Payments Coming soon
Add a payment manifest to any function on a resource you host. Callers pay per successful call from an on-chain escrow on Solana. A valid payment also authorizes the call, so there is no billing system or key management to run.
paymentManifest: {
costMicroUsdc: 10000, // $0.01 per call
recipientAddress: process.env.RECIPIENT_ADDRESS,
}Get started