Docs
BlogHomeStart building

Account

Check your current credit balance and what each operation costs.


The Totalum API is a REST API for programmatically building, deploying, and managing projects.

  • Base URL: https://api-accounts.totalum.app
  • Authentication: every request must include the header api-key: <your-api-key> (keys are prefixed tlm_sk_).
  • Response envelope: every response is shaped as { "errors": null | { "errorCode": "...", "errorMessage": "..." }, "data": ... }.
Tip

Keep your API key secret — it must never leave your backend server. Never call the Totalum API directly from frontend code.

#Get Account Info

GET/api/v1/vcaas/accountFree

Retrieve your current credit balance and account details.

Response fields

FieldTypeDescription
data.creditsnumberTotal spendable balancerecurrentCredits + oneTimeCredits. This is the number to check before an operation
data.recurrentCreditsnumber | undefinedMonthly plan credits remaining. Reset at the start of each billing period. 0 on accounts with no plan credits
data.oneTimeCreditsnumber | undefinedPurchased credits remaining. These never expire
Spend order

data.credits is the only figure you need to gate a call — it is already the sum of both pools. The breakdown is informational: plan credits are consumed first, so purchased credits are what remains once the monthly allowance runs out. Accounts created before plan credits existed report the whole balance under oneTimeCredits.

Example request

bash
curl -H "api-key: tlm_sk_your_key" \
  https://api-accounts.totalum.app/api/v1/vcaas/account
Success · 200 OK
json
{
  "errors": null,
  "data": {
    "credits": 425,
    "recurrentCredits": 100,
    "oneTimeCredits": 325
  }
}
Error · 400
json
{
  "errors": {
    "errorCode": "GET_ACCOUNT_ERROR",
    "errorMessage": "Internal error fetching account info"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
GET_ACCOUNT_ERROR400Internal error fetching account info

#Get Credit Costs

GET/api/v1/vcaas/credit-costsFree

Retrieve the current price, in development credits, of every fixed-cost operation. Read it at runtime instead of hard-coding prices: it is the same table the API charges against, so a price change reaches your app without a release.

Fixed costs only

Only operations with a flat price appear here. Running the AI agent is not one of them — a prompt costs between roughly 2 and 30 credits depending on how much work it turns out to be, so it has no entry to publish. Infrastructure credits (ChatGPT, image generation, emails, PDFs and the rest) are likewise usage-based and are not listed. Every endpoint not named here is free.

Response fields

FieldTypeDescription
data.creditCostsobjectMap of operation name to its cost in development credits
data.creditCosts.CREATE_PROJECTnumberCreating a project
data.creditCosts.CREATE_DEPLOYMENTnumberDeploying to production
data.creditCosts.START_SERVERnumberStarting or restarting the dev server
data.creditCosts.GET_SOURCE_CODEnumberDownloading the full source archive
data.creditCosts.RECOVER_VERSIONnumberRecovering a previous version
data.creditCosts.UPLOAD_FILEnumberUploading a file to the project
data.creditCosts.ADD_CUSTOM_DOMAINnumberAttaching a custom domain
data.creditCosts.EXPORT_PROJECTnumberExporting a project
data.creditCosts.IMPORT_PROJECTnumberImporting a project
data.creditCosts.UPDATE_FILEnumberWriting one file through the project-files API
data.creditCosts.REBUILD_PROJECTnumberRebuilding the project after file writes

Example request

bash
curl -H "api-key: tlm_sk_your_key" \
  https://api-accounts.totalum.app/api/v1/vcaas/credit-costs
Success · 200 OK
json
{
  "errors": null,
  "data": {
    "creditCosts": {
      "CREATE_PROJECT": 1,
      "CREATE_DEPLOYMENT": 1,
      "START_SERVER": 3,
      "GET_SOURCE_CODE": 1,
      "RECOVER_VERSION": 2,
      "UPLOAD_FILE": 0.5,
      "ADD_CUSTOM_DOMAIN": 2,
      "EXPORT_PROJECT": 2,
      "IMPORT_PROJECT": 6,
      "UPDATE_FILE": 0.1,
      "REBUILD_PROJECT": 1
    }
  }
}
Reading a file is free, writing costs 0.1

Browsing the project tree and reading file contents are deliberately free — an editor opens a tree and then a dozen files, and metering that would make the API unusable for the thing it exists for. A write is a real mutation (it writes to the sandbox, commits, snapshots a version and may push to GitHub) but is priced at 0.1 so that saving a component and its two imports does not cost as much as creating a project. A rebuild keeps its full price because it burns a sandbox CPU for minutes.

Error · 400
json
{
  "errors": {
    "errorCode": "GET_CREDIT_COSTS_ERROR",
    "errorMessage": "Error getting credit costs"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
GET_CREDIT_COSTS_ERROR400Internal error fetching credit costs
End of Get Credit Costs Back to top