0

Get Strale Wallet Balance

by
Published Apr 14, 2026

Check your Strale wallet balance. Useful as a pre-check in flows before executing paid capabilities, or for monitoring remaining credits. Strale uses a prepaid wallet model (EUR). Top up via Stripe at https://strale.dev

Script strale Verified

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 7 days ago
1
//native
2

3
// Get your Strale wallet balance.
4
// Useful in flows to check remaining credits before executing paid capabilities.
5
//
6
// Strale uses a prepaid wallet model — top up via Stripe, then capabilities
7
// deduct from your balance on each execution.
8
// https://strale.dev
9

10
type Strale = {
11
  api_key: string;
12
  base_url?: string;
13
};
14

15
export async function main(strale: Strale) {
16
  const baseUrl = strale.base_url ?? "https://api.strale.io";
17

18
  const response = await fetch(`${baseUrl}/v1/balance`, {
19
    method: "GET",
20
    headers: {
21
      "Authorization": `Bearer ${strale.api_key}`,
22
    },
23
  });
24

25
  if (!response.ok) {
26
    const error = await response.json().catch(() => ({ message: response.statusText }));
27
    throw new Error(
28
      `Strale API error (${response.status}): ${(error as any).error?.message ?? (error as any).message ?? "Unknown error"}`
29
    );
30
  }
31

32
  const data = await response.json() as {
33
    balance_cents: number;
34
    currency: string;
35
  };
36

37
  return {
38
    balance_cents: data.balance_cents,
39
    balance: `€${(data.balance_cents / 100).toFixed(2)}`,
40
    currency: data.currency ?? "EUR",
41
  };
42
}
43

44
export async function main(x: string) {
45
  return x
46
}
Other submissions
  • Submitted by petter133 Deno
    Created 56 days ago
    1
    // Get your Strale wallet balance.
    2
    // Useful in flows to check remaining credits before executing paid capabilities.
    3
    //
    4
    // Strale uses a prepaid wallet model — top up via Stripe, then capabilities
    5
    // deduct from your balance on each execution.
    6
    // https://strale.dev
    7
    
    
    8
    type Strale = {
    9
      api_key: string;
    10
      base_url?: string;
    11
    };
    12
    
    
    13
    export async function main(strale: Strale) {
    14
      const baseUrl = strale.base_url ?? "https://api.strale.io";
    15
    
    
    16
      const response = await fetch(`${baseUrl}/v1/balance`, {
    17
        method: "GET",
    18
        headers: {
    19
          "Authorization": `Bearer ${strale.api_key}`,
    20
        },
    21
      });
    22
    
    
    23
      if (!response.ok) {
    24
        const error = await response.json().catch(() => ({ message: response.statusText }));
    25
        throw new Error(
    26
          `Strale API error (${response.status}): ${(error as any).error?.message ?? (error as any).message ?? "Unknown error"}`
    27
        );
    28
      }
    29
    
    
    30
      const data = await response.json() as {
    31
        balance_cents: number;
    32
        currency: string;
    33
      };
    34
    
    
    35
      return {
    36
        balance_cents: data.balance_cents,
    37
        balance: `€${(data.balance_cents / 100).toFixed(2)}`,
    38
        currency: data.currency ?? "EUR",
    39
      };
    40
    }// import * as wmill from 'npm:windmill-client'
    41
    
    
    42
    export async function main(x: string) {
    43
      return x
    44
    }