> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.mixlayer.com/api-reference/platform-api/billing-accounts/list-credits-for-billing-account/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mixlayer.com/_mcp/server. # List billing account credits GET https://api.mixlayer.com/v1/billing_accounts/{billing_account_id}/credits Returns credits whose schedules currently apply to the billing account. Reference: https://docs.mixlayer.com/api-reference/platform-api/billing-accounts/list-credits-for-billing-account ## Authentication - `Authorization` header (bearer token, required) — Console user session or Mixlayer API key supplied as a Bearer token. ## Request ### Path parameters - `billing_account_id` (string, required) — Billing account ID ## Response ### 200 Billing account credits - `data` (list of ApiDataResponseVecCustomerCreditDataItems, required) — Response payload. ## Errors ### 401 Unauthorized Error Authentication is missing or invalid. - `error` (ApiErrorBody, required) — Structured error details. ### 403 Forbidden Error The authenticated principal cannot perform this operation. - `error` (ApiErrorBody, required) — Structured error details. ### 500 Internal Server Error An unexpected server or database error occurred. - `error` (ApiErrorBody, required) — Structured error details. ## Types ### ApiDataResponseVecCustomerCreditDataItems Credit amounts displayed on a customer billing page. - `expires_at` (datetime, required) — End of the credit's latest access-schedule segment, in UTC. - `name` (string, required) — Human-readable credit name. - `remaining_amount_in_cents` (long, required) — Amount currently available to spend, in cents. - `total_amount_in_cents` (long, required) — Total amount granted across the credit access schedule, in cents. - `applicable_model_skus` (list of string, optional, nullable) — Applicable model SKUs; empty means all models and null means other restrictions apply. ### ApiErrorBody Structured error details returned by the platform API. - `message` (string, required) — Human-readable error message. - `code` (string, optional, nullable) — Stable machine-readable error code, when available. - `details` (any, optional) — Error-specific structured context, when available. ## Examples **Response** ```json { "data": [ { "expires_at": "2024-01-15T09:30:00Z", "name": "string", "remaining_amount_in_cents": 1, "total_amount_in_cents": 1, "applicable_model_skus": [ "string" ] } ] } ``` **SDK Code** ```python import requests url = "https://api.mixlayer.com/v1/billing_accounts/billing_account_id/credits" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.mixlayer.com/v1/billing_accounts/billing_account_id/credits'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.mixlayer.com/v1/billing_accounts/billing_account_id/credits" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.mixlayer.com/v1/billing_accounts/billing_account_id/credits") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.mixlayer.com/v1/billing_accounts/billing_account_id/credits") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.mixlayer.com/v1/billing_accounts/billing_account_id/credits', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ```