Prepaid pack lines use the list rate (
$0.14 times units). Wallet lines use the cash Kling deducted (deduction_amount), with list_price kept as the pre-discount amount. A task is on one ledger only, so the two are not added together.- Manual setup
- Terraform
1
Create an Open Platform API key
In the Kling AI developer console, create an Open Platform API key. Copy it immediately. It is shown once.Do not use AccessKey + SecretKey (JWT). Costory sends
Authorization: Bearer. See Kling’s Get started guide for key creation.2
Connect in Costory
Go to Integrations, click + Add integration, then choose Kling AI under Billing. The connect URL is
/integration/new/kling-ai/billing. 3
Enter connection details
Fill Connection name (default Kling AI) and API key.Region is optional. Leave it on Singapore (
api-singapore.klingai.com) unless this account lives on Beijing (api-beijing.klingai.com). The wrong region looks like a bad key.Start date is optional. Leave it empty to use Costory’s default lookback.4
Validate, then save
Click Validate. Costory calls Kling Unit Deduction Detail with
Authorization: Bearer. Save stays disabled until the key can read unit deductions. An empty deduction window is still success. After save, each sync also reads Balance Deduction Detail with the same key. If this is the only billing source and it is demo data, Costory asks you to confirm before replacing it.Field reference
What Costory includes
Costory pulls both deduction APIs and maps them into .
CNY wallet charges are converted to USD with Costory’s monthly exchange rate. The original yuan amount is kept on the line.
How to analyze Kling AI costs
- Spend over time: use the same date presets as other billing sources in Explorer
- Spend by product or SKU: group by Service name or SKU when those fields are populated from the deduction export
- Pack usage vs wallet charges: filter the ledger label (
packageorbalance)
- The price paid to buy a prepaid pack (pack-tier and volume discounts)
- Pack-name catalog (
/account/costs) - AccessKey + SecretKey JWT auth
Rotate the API key from Integrations when you need a new credential. The stored region stays the same. A Singapore to Beijing move is a different console and key: create a new datasource.
Troubleshooting
Related pages
Billing Data
All billing providers and shared setup notes.
ElevenLabs billing
Connect ElevenLabs workspace usage the same way.
BytePlus billing
Import BytePlus account bill details, including Seedance.
OpenAI billing
Import OpenAI Platform organization costs.
Explorer
Filter and group Kling spend with the rest of your stack.
