Skip to main content
Glama

get_account_balance

Check your Kling AI account balance and available credits to monitor your video generation resource usage and account status.

Instructions

Check your Kling AI account balance and total available credits. Provides a comprehensive overview of your account status including total balance and breakdown by resource packages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function that makes API call to retrieve Kling AI account balance
    async getAccountBalance(): Promise<AccountBalance> { const path = '/v1/account/balance'; try { const response = await this.axiosInstance.get(path); return response.data.data; } catch (error) { if (axios.isAxiosError(error)) { throw new Error(`Kling API error: ${error.response?.data?.message || error.message}`); } throw error; } }
  • MCP server handler case that invokes klingClient.getAccountBalance and formats response for the tool call
    case 'get_account_balance': { const balance = await klingClient.getAccountBalance(); let balanceText = `Kling AI Account Balance:\n\nTotal Balance: ${balance.total_balance} credits`; if (balance.resource_packages && balance.resource_packages.length > 0) { balanceText += '\n\nResource Packages Breakdown:'; balance.resource_packages.forEach((pkg, index) => { balanceText += `\n\nPackage ${index + 1}:`; balanceText += `\n- Name: ${pkg.name}`; balanceText += `\n- Amount: ${pkg.amount} credits`; balanceText += `\n- Expires: ${new Date(pkg.expire_at).toLocaleString()}`; }); } return { content: [ { type: 'text', text: balanceText, }, ], }; }
  • src/index.ts:422-430 (registration)
    Tool registration in TOOLS array with name, description, and empty input schema
    { name: 'get_account_balance', description: 'Check your Kling AI account balance and total available credits. Provides a comprehensive overview of your account status including total balance and breakdown by resource packages.', inputSchema: { type: 'object', properties: {}, required: [], }, },
  • TypeScript interface defining the output structure of account balance response (schema for handler result)
    export interface AccountBalance { total_balance: number; resource_packages: ResourcePackage[]; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/199-mcp/mcp-kling'

If you have feedback or need assistance with the MCP directory API, please join our Discord server