curl --request POST \
--url https://api.monid.ai/v1/wallet/topup/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 25,
"currency": "USD",
"success_redirect": "https://app.monid.ai/wallet?topup=success",
"cancel_redirect": "https://app.monid.ai/wallet?topup=cancelled",
"autoReload": true
}
'import requests
url = "https://api.monid.ai/v1/wallet/topup/sessions"
payload = {
"amount": 25,
"currency": "USD",
"success_redirect": "https://app.monid.ai/wallet?topup=success",
"cancel_redirect": "https://app.monid.ai/wallet?topup=cancelled",
"autoReload": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 25,
currency: 'USD',
success_redirect: 'https://app.monid.ai/wallet?topup=success',
cancel_redirect: 'https://app.monid.ai/wallet?topup=cancelled',
autoReload: true
})
};
fetch('https://api.monid.ai/v1/wallet/topup/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.monid.ai/v1/wallet/topup/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 25,
'currency' => 'USD',
'success_redirect' => 'https://app.monid.ai/wallet?topup=success',
'cancel_redirect' => 'https://app.monid.ai/wallet?topup=cancelled',
'autoReload' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.monid.ai/v1/wallet/topup/sessions"
payload := strings.NewReader("{\n \"amount\": 25,\n \"currency\": \"USD\",\n \"success_redirect\": \"https://app.monid.ai/wallet?topup=success\",\n \"cancel_redirect\": \"https://app.monid.ai/wallet?topup=cancelled\",\n \"autoReload\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.monid.ai/v1/wallet/topup/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25,\n \"currency\": \"USD\",\n \"success_redirect\": \"https://app.monid.ai/wallet?topup=success\",\n \"cancel_redirect\": \"https://app.monid.ai/wallet?topup=cancelled\",\n \"autoReload\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monid.ai/v1/wallet/topup/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 25,\n \"currency\": \"USD\",\n \"success_redirect\": \"https://app.monid.ai/wallet?topup=success\",\n \"cancel_redirect\": \"https://app.monid.ai/wallet?topup=cancelled\",\n \"autoReload\": true\n}"
response = http.request(request)
puts response.read_body{
"paymentProcessor": "STRIPE",
"sessionId": "cs_test_...",
"url": "https://checkout.stripe.com/c/pay/..."
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 503,
"message": "Wallet is being provisioned.",
"walletStatus": "PROVISIONING"
}Create a hosted top-up checkout session
Creates a hosted Stripe checkout session and returns the session id and redirect URL. This is the funding path advertised by the WALLET_INSUFFICIENT_FUNDS 402 and by GET /v1/wallet/balance (topup.stripe): an agent creates the session and hands url to its human owner to pay.
curl --request POST \
--url https://api.monid.ai/v1/wallet/topup/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 25,
"currency": "USD",
"success_redirect": "https://app.monid.ai/wallet?topup=success",
"cancel_redirect": "https://app.monid.ai/wallet?topup=cancelled",
"autoReload": true
}
'import requests
url = "https://api.monid.ai/v1/wallet/topup/sessions"
payload = {
"amount": 25,
"currency": "USD",
"success_redirect": "https://app.monid.ai/wallet?topup=success",
"cancel_redirect": "https://app.monid.ai/wallet?topup=cancelled",
"autoReload": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 25,
currency: 'USD',
success_redirect: 'https://app.monid.ai/wallet?topup=success',
cancel_redirect: 'https://app.monid.ai/wallet?topup=cancelled',
autoReload: true
})
};
fetch('https://api.monid.ai/v1/wallet/topup/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.monid.ai/v1/wallet/topup/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 25,
'currency' => 'USD',
'success_redirect' => 'https://app.monid.ai/wallet?topup=success',
'cancel_redirect' => 'https://app.monid.ai/wallet?topup=cancelled',
'autoReload' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.monid.ai/v1/wallet/topup/sessions"
payload := strings.NewReader("{\n \"amount\": 25,\n \"currency\": \"USD\",\n \"success_redirect\": \"https://app.monid.ai/wallet?topup=success\",\n \"cancel_redirect\": \"https://app.monid.ai/wallet?topup=cancelled\",\n \"autoReload\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.monid.ai/v1/wallet/topup/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25,\n \"currency\": \"USD\",\n \"success_redirect\": \"https://app.monid.ai/wallet?topup=success\",\n \"cancel_redirect\": \"https://app.monid.ai/wallet?topup=cancelled\",\n \"autoReload\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monid.ai/v1/wallet/topup/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 25,\n \"currency\": \"USD\",\n \"success_redirect\": \"https://app.monid.ai/wallet?topup=success\",\n \"cancel_redirect\": \"https://app.monid.ai/wallet?topup=cancelled\",\n \"autoReload\": true\n}"
response = http.request(request)
puts response.read_body{
"paymentProcessor": "STRIPE",
"sessionId": "cs_test_...",
"url": "https://checkout.stripe.com/c/pay/..."
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 400,
"message": "Bad Request",
"hints": {},
"errorCode": "RATE_LIMITED"
}{
"code": 503,
"message": "Wallet is being provisioned.",
"walletStatus": "PROVISIONING"
}Authorizations
Monid API key (Authorization: Bearer mk_...) or Clerk-issued JWT. Each operation lists the ONE scope an API key needs. {resource}:* grants every action on that resource; * grants everything; Clerk sessions hold *. Operations with an empty list need no scope. Scope catalog: GET /v1/api-keys/scopes.
Headers
Model driving the calling agent. Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Agent harness or client making the call (e.g. a coding agent, an agent framework). Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Caller-side session identifier, so the calls of one agent session (discover → inspect → run → polling) can be correlated. Optional; a value that is empty, longer than 256 characters or not printable ASCII is ignored (never an error).
256Body
Top-up amount in dollars (float).
25
Top-up currency (currently only USD).
USD Where to send the payer after a successful checkout. Must be on the Monid web-app origin. Defaults to the web-app wallet page, so an agent without a UI can omit it and hand the returned url to its owner.
"https://app.monid.ai/wallet?topup=success"
Where to send the user if checkout is cancelled. Must be on the Monid web-app origin.
"https://app.monid.ai/wallet?topup=cancelled"
Opt in to auto-reload (with the service defaults) when this checkout completes. Opt-in ONLY: the system never enables auto-reload on the caller's behalf, so false and an omitted field are equivalent and record nothing. Ignored when auto-reload is already enabled on the wallet.
Analytics attribution hand-off (web app only). Stored as Checkout metadata and forwarded on the server-side GA4 purchase event once the session is paid. Never affects the top-up itself; agents can omit it.
Show child attributes
Show child attributes