Skip to main content
Glama

get_account_balance

Retrieve your Kling AI account balance and credit breakdown to monitor available resources. Designed to provide a clear overview of your usage status for effective management.

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 executes the API call to Kling AI's account balance endpoint and returns the AccountBalance data.
    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; } }
  • TypeScript interface defining the structure of the account balance response (output schema).
    export interface AccountBalance { total_balance: number; resource_packages: ResourcePackage[]; }
  • src/index.ts:422-430 (registration)
    Tool registration entry in the TOOLS array, including 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: [], }, },
  • MCP server request handler case that invokes the KlingClient method and formats the response as MCP content.
    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, }, ], }; }

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