Platform API
The Platform API provides blockchain data queries and Lispeum evaluation over HTTP. It is a metered, pay-as-you-go service. You access it using API keys created from the Platform dashboard.
API keys
Create API keys from the Platform Keys page. Each key has its own balance and tracks data and eval spend separately. Keys can be toggled active/inactive and revoked at any time. Plans limit how many keys you can create.
Include the key as a Bearer token in the Authorization header:
Authorization: Bearer <your_api_key>
Data API
The Data API provides read-only access to blockchain state. Send a POST request to /api/v1/platform/data:
POST /api/v1/platform/data
Content-Type: application/json
Authorization: Bearer <key>
{
"endpoint": "block",
"params": {
"hash": "<block_hash>"
}
}
| Endpoint | Params | Description |
|---|---|---|
block |
hash or height |
Get a block's header and metadata. |
account |
address, optional block_hash |
Get account balance, code hash, data hash, counter. |
transaction |
hash |
Get a transaction's details and status. |
chain |
none | Get chain ID and latest block height/hash. |
Eval API
The Eval API executes Lispeum expressions on our infrastructure. Send a POST to /api/v1/platform/eval:
POST /api/v1/platform/eval
Content-Type: application/json
Authorization: Bearer <key>
{
"expression": "(+ 1 2)",
"environment_id": "<uuid>"
}
The environment_id is optional — it points to a code environment whose key-value entries are loaded into the execution context. Each eval call consumes eval spend from the key's balance.
Links
Links are named, prepaid expressions with a unique slug. Create a link from the Platform Links page:
- Give it a name and expression.
- Fund the link with ASTR credits.
- Access it at
/platform/links/<slug>.
Each resolution consumes the link's balance. You can top up the balance at any time. Links are ideal for embedding dynamic on-chain data into web pages or dashboards.
Usage and metering
Every API call and link resolution is logged as a PlatformUsage record. Each record tracks data spend and eval spend. You can view usage logs on the Platform home page. When a key or link runs out of balance, requests return a 402 Payment Required.