OpenAgents
BETA
OpenAgents
BETA
Get Started

Agent Payments

Each agent can have its own wallet to send and receive payments. Agent payments support creating invoices, paying invoices, and checking balances.

post /api/v1/agents/{agent_id}/wallet
Create a wallet for the specified agent.

Parameters

Name In Required Type Description
agent_id path Yes string

Responses

Schema: AgentWallet
Property Type Description
agent_id string The unique identifier for the Agent instance
spark_address string The public Spark address for receiving payments
identity_public_key string The identity public key associated with the Spark wallet
wallet_status string The status of the agent's wallet
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
get /api/v1/agents/{agent_id}/wallet/balance
Get the wallet balance for the specified agent.

Parameters

Name In Required Type Description
agent_id path Yes string

Responses

Schema: AgentBalance
Property Type Description
balance_sats string The wallet balance in satoshis
token_balances object Balances of any tokens held by the wallet
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
post /api/v1/agents/{agent_id}/wallet/pay-invoice
Pay a Lightning invoice from the agent's wallet.

Parameters

Name In Required Type Description
agent_id path Yes string

Request Body

Invoice payment payload

Schema: PayInvoiceRequest
Property Type Required Description
invoice string Yes The Lightning invoice to pay
max_fee_sats integer Yes Maximum fee to pay in satoshis

Responses

Schema: PayInvoiceResponse
Property Type Description
payment_id string The internal payment ID
status string The status of the payment
amount_paid_sats string The amount paid in satoshis
fee_paid_sats string The fee paid in satoshis
preimage string The payment preimage
failure_reason string The reason for payment failure if applicable
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
post /api/v1/agents/{agent_id}/wallet/create-invoice
Create a Lightning invoice for the agent's wallet.

Parameters

Name In Required Type Description
agent_id path Yes string

Request Body

Invoice creation payload

Schema: CreateInvoiceRequest
Property Type Required Description
amount_sats integer Yes Amount in satoshis to request
memo string No Optional description for the invoice
expiry integer No Optional expiry time in seconds

Responses

Schema: CreateInvoiceResponse
Property Type Description
invoice string The encoded Lightning invoice
payment_hash string The payment hash for this invoice
amount_sats integer The amount requested in satoshis
status string The status of the invoice
expires_at integer When this invoice expires (Unix timestamp)
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
post /api/v1/agents/{agent_id}/wallet/send
Send a payment from an agent.

Parameters

Name In Required Type Description
agent_id path Yes string

Request Body

Payment request payload

Schema: SendPaymentRequest
Property Type Required Description
amount_sats integer Yes Amount to send in satoshis
recipient_agent_id string No Agent ID to send payment to
external_address string No External spark address to send to
lightning_invoice string No Lightning invoice to pay
memo string No Optional memo for the payment
max_fee_sats integer No Maximum fee to pay in satoshis

Responses

Schema: PayInvoiceResponse
Property Type Description
payment_id string The internal payment ID
status string The status of the payment
amount_paid_sats string The amount paid in satoshis
fee_paid_sats string The fee paid in satoshis
preimage string The payment preimage
failure_reason string The reason for payment failure if applicable
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string
object
Properties
Property Type Description
message string