REST API

This page describes the REST surface exposed by antd. By default, the daemon listens on http://localhost:8082.

All current REST payloads are JSON. When you send or receive binary data, the bytes are base64-encoded inside a data field.

Health

Health Check

Endpoint: GET /health

Returns daemon health and the selected network.

Response:

{
  "status": "ok",
  "network": "default",
  "version": "0.6.1",
  "evm_network": "arbitrum-one",
  "uptime_seconds": 12345,
  "build_commit": "529280c3",
  "payment_token_address": "0xde817De9d8AC8C3aA10C3Ed0EE5FCB6C53cE7B0a",
  "payment_vault_address": "0x607483B50C5F06c25cDC316b6d1E071084EeC9f5"
}

All six fields (version, evm_network, uptime_seconds, build_commit, payment_token_address, payment_vault_address) are always present. On a local devnet, payment_token_address and payment_vault_address may be empty strings, and build_commit is empty when the binary was built outside a git checkout.

Example:

Data

Store Public Data

Endpoint: POST /v1/data/public

Stores public data and returns the public address that can be shared with readers.

Parameters:

Name
Type
Required
Description

data

string

Yes

Base64-encoded payload

payment_mode

string

No

auto, merkle, or single

Response:

Example:

Get Public Data

Endpoint: GET /v1/data/public/{addr}

Fetches public data by address.

Parameters:

Name
Type
Required
Description

addr

path

Yes

64-character hex data address

Response:

Example:

Stream Public Data

Endpoint: GET /v1/data/public/{addr}/stream

This endpoint is exposed, but the handler is a stub and returns an empty SSE stream.

Parameters:

Name
Type
Required
Description

addr

path

Yes

64-character hex data address

Example:

Store Private Data

Endpoint: POST /v1/data/private

Stores private data and returns a serialized DataMap instead of a public address.

Parameters:

Name
Type
Required
Description

data

string

Yes

Base64-encoded payload

payment_mode

string

No

auto, merkle, or single

Response:

Example:

Get Private Data

Endpoint: GET /v1/data/private

Retrieves private data using the returned DataMap.

Parameters:

Name
Type
Required
Description

data_map

query

Yes

Hex-encoded serialized DataMap

Response:

Example:

Estimate Data Cost

Endpoint: POST /v1/data/cost

Estimates the storage cost for a data payload without uploading it.

Parameters:

Name
Type
Required
Description

data

string

Yes

Base64-encoded payload

Response:

Example:

Chunks

Store a Chunk

Endpoint: POST /v1/chunks

Stores a raw chunk.

Parameters:

Name
Type
Required
Description

data

string

Yes

Base64-encoded chunk bytes

Response:

Example:

Get a Chunk

Endpoint: GET /v1/chunks/{addr}

Retrieves a raw chunk by address.

Parameters:

Name
Type
Required
Description

addr

path

Yes

64-character hex chunk address

Response:

Example:

Files and directories

These endpoints work on paths visible to the machine running antd.

Upload a Public File

Endpoint: POST /v1/files/upload/public

Uploads a local file and stores its DataMap publicly.

Parameters:

Name
Type
Required
Description

path

string

Yes

Local file path

payment_mode

string

No

auto, merkle, or single

Response:

Example:

Download a Public File

Endpoint: POST /v1/files/download/public

Downloads a file to a local destination path.

Parameters:

Name
Type
Required
Description

address

string

Yes

64-character hex file address

dest_path

string

Yes

Local destination path

Response: HTTP 200 OK with no JSON body

Example:

Upload a Public Directory

Endpoint: POST /v1/dirs/upload/public

Uploads a local directory recursively.

Parameters:

Name
Type
Required
Description

path

string

Yes

Local directory path

payment_mode

string

No

auto, merkle, or single

Response:

Example:

Download a Public Directory

Endpoint: POST /v1/dirs/download/public

Downloads a directory to a local destination path.

Parameters:

Name
Type
Required
Description

address

string

Yes

64-character hex directory address

dest_path

string

Yes

Local destination path

Response: HTTP 200 OK with no JSON body

Example:

Estimate File Cost

Endpoint: POST /v1/files/cost

Estimates upload cost for a local file.

Parameters:

Name
Type
Required
Description

path

string

Yes

Local file path

is_public

boolean

No

Defaults to true

Response:

Example:

Wallet

Get Wallet Address

Endpoint: GET /v1/wallet/address

Returns the configured wallet address.

Response:

Example:

Get Wallet Balance

Endpoint: GET /v1/wallet/balance

Returns token and gas balances.

Response:

Example:

Approve Wallet Spend

Endpoint: POST /v1/wallet/approve

Approves token spend for payment contracts.

Parameters: None

Response:

Example:

External signer flow

Prepare a Data Upload

Endpoint: POST /v1/data/prepare

Prepares an in-memory data upload for external signing.

Parameters:

Name
Type
Required
Description

data

string

Yes

Base64-encoded payload

visibility

string

No

"private" (default) or "public". "public" returns 501 on this endpoint. Use /v1/upload/prepare with a file path for public external-signer uploads.

Response:

The response varies by payment_type.

The daemon returns wave_batch for uploads under 64 chunks and merkle for uploads with 64 or more chunks.

Merkle variant:

Each pool_commitments entry contains exactly 16 candidate payments. The example above shows one candidate for brevity.

Example:

Prepare a File Upload

Endpoint: POST /v1/upload/prepare

Prepares a file upload for external signing.

Parameters:

Name
Type
Required
Description

path

string

Yes

Local file path

visibility

string

No

"private" (default) or "public". "public" bundles the serialized DataMap chunk into the same payment batch and stores it on-network; its address is returned on finalize via data_map_address.

Response: Same payment_type-based shape as POST /v1/data/prepare

Example:

Finalize an Upload

Endpoint: POST /v1/upload/finalize

Finalizes a prepared upload after the external signer has submitted the matching payment transaction.

Parameters:

Name
Type
Required
Description

upload_id

string

Yes

Value returned by a prepare endpoint

tx_hashes

object

No

Wave-batch only: map of quote_hash to tx_hash

winner_pool_hash

string

No

Merkle only: winner pool hash emitted by MerklePaymentMade

store_data_map

boolean

No

If true, also stores the DataMap on-network

Provide tx_hashes when the prepare response returned payment_type: "wave_batch". Provide winner_pool_hash when it returned payment_type: "merkle".

Response:

address is only present when store_data_map is true; that path uses the daemon's own wallet to store the DataMap. data_map_address is only present when the upload was prepared with visibility:"public"; it is the network address of the bundled DataMap chunk whose payment was included in the same external-signer batch as the data chunks.

Examples:

Error codes

Code
Meaning
Resolution

400

Bad request

Check base64 encoding, address length, data map format, and local paths

402

Payment required

Fund the configured wallet or reduce the upload size

404

Not found

Check the address or upload_id

413

Payload too large

Split the upload or switch to file/directory endpoints

500

Internal server error

Check daemon logs and retry

501

Not implemented

visibility:"public" is not supported on /v1/data/prepare; use /v1/upload/prepare with a file path instead

502

Network unreachable

Confirm the daemon can reach the Autonomi network

503

Service unavailable

Configure a wallet before calling wallet or write endpoints

Last updated