hosting
GET /v1/sites/{siteId}/ide-assist/credit
What the site's web editor shows beside its assistant.
身份验证
此端点是公开的。它不需要任何凭据或组织——这是我们自己的营销网站和 AI 问答引擎所读取的内容。
此端点不需要组织 ID。您的密钥已用于识别其所属的组织,且响应范围也仅限于该组织。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X GET https://api.zinndigital.com/v1/sites/{siteId}/ide-assist/credit已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
The AI balance for the organisation that owns this site, and where its owner tops it up. The editor paints this when the assistant panel opens; every chat turn carries the same object back afterwards, so the number the customer sees is the one after their own question rather than one call behind it. spendable_micros is the figure to render, not balance_micros. They differ by whatever is left of today's included allowance, and an organisation with a zero balance and an unspent allowance can still ask the assistant anything it likes. This never refuses for lack of credit: the customer who has run out is precisely the one who needs this screen and its top_up_url.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
siteId (path) | Uuid | 是 | Site ID (UUIDv7). |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
available | boolean | 是 | False when the meter could not be read. A third state on purpose: we could not look is not you have nothing, and collapsing them puts a top-up prompt in front of an account… |
currency | string | 否 | ISO 4217, for the amounts below. |
balance_micros | integer | 否 | Purchased credit held, in USD micros. ⛔ Not what they can spend — see spendable_micros. |
spendable_micros | integer | 否 | Everything that can pay for the next call: the balance PLUS what is left of today's included allowance. This is the number the editor renders. |
included_remaining_micros | integer | 否 | What is left of today's included allowance, in USD micros. |
is_low | boolean | 否 | Whether what is spendable is low enough to say so. Computed by the meter rather than by each screen, because a second implementation of "low" is a second answer and the screen's… |
is_empty | boolean | 否 | Nothing can fund the next call — no credit and no allowance left. |
on_byo | boolean | 否 | The organisation holds a live key for every provider we route to, so credit genuinely cannot be spent. The editor shows no top-up affordance here: selling credit to somebody whose… |
top_up_url | string | 否 | Where this customer adds credit, resolved from their own brand — a reseller's customer is never sent to a hostname that is not their reseller's. Empty when on_byo is true,… |
此端点可能返回的错误
404