Open source · Peer-to-peer

The programmable API network

Stellarium is a decentralized, programmable API network where anyone can host an API and get paid for it.

Install
npm install stellarium-ts fastify requestscript
Language
RequestScript
Node
stellarium-ts
Runtime
Node.js 20+, Fastify 5
Payments
USDC on Solana

Overview

Every API is a resource on the network

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.

Self-hosted

A node runs inside your own Fastify app. Resource functions execute in your process, and their code never leaves your server.

Called by name

Programs refer to resources by full name, like com.example.Weather. Your node works out which peer hosts each one and forwards the call.

Peer discovery

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

One request, any number of nodes

1 Host a resource

Register functions on your node. They run locally when called.

server.ts
await node.register({
  metadata: {},
  path: "com.example",
  name: "Weather",
  functions: [{
    name: "temperature",
    parameters: [{ name: "city", type: "string" }],
    returnType: "int32",
    exec: async (args) => 12,
  }],
});

2 Write a request

Name the resources you need and call them. No URLs or API keys.

GetTemperature.req
request GetTemperature {
  const weather: com.example.Weather

  const reading = weather.temperature(city: "Oslo")
  if (reading.error != null) {
    return reading.error.message
  }

  return reading.value
}

3 Get one response

Send the request to POST /v1/run on any node.

200 OK
{ "returnValue": 12 }

A failed resource call returns an error value the script can check. It doesn't fail the whole request.

Payments Coming soon

Charge per call, settled in USDC

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.

Function payment manifest
paymentManifest: {
  costMicroUsdc: 10000, // $0.01 per call
  recipientAddress: process.env.RECIPIENT_ADDRESS,
}

How payments work ↗

Get started

Next steps