Growth Studio OpenAPI Integration Guide · 费用与钱包流水

Get the Current Discount

Retrieve the discount currently applicable to the account and workspace associated with the API key. The platform and OpenAPI share the same rules, without separate discounts by channel or feature.

This endpoint returns the rule effective at query time. The server independently calculates the charge when billing the task; wallet transactions are the source for actual amounts.

Request

GET /openapi/v1/wallet/discount
Authorization: Bearer <API_KEY>

No request parameters are required. The account and workspace are determined by the API key and cannot be overridden through request parameters or headers.

curl --request GET \
  "${BASE_URL}/openapi/v1/wallet/discount" \
  --header "Authorization: Bearer ${API_KEY}"

Successful Response

HTTP status: 200 OK.

{
  "discount": "70",
  "source": "workspace",
  "expires_at": "2026-12-31T15:59:59Z",
  "request_id": "wallet-discount-001"
}
Field Type Description
discount string Integer percentage of the original price to pay, from "1" to "100". "70" means paying 70% of the original price, equivalent to 30% off. "100" means full price
source string Selected rule source: workspace, account, or default
expires_at string / null Expiration of the selected rule, in RFC3339 format and returned in UTC. null means no expiration or default full-price billing
request_id string Request tracking ID, matching the X-Request-Id response header

The response includes Cache-Control: no-store. Do not cache the result.

When no rule applies, the response is:

{
  "discount": "100",
  "source": "default",
  "expires_at": null,
  "request_id": "wallet-discount-001"
}

Rule Priority and Expiration

The server selects the first valid rule in this order:

  1. Workspace rule.
  2. Rule for the account associated with the API key.
  3. Default full price.