Talk-Bot开放接口

对外接口


消耗记录详情查询

<p>[TOC]</p> <h5>简要描述</h5> <ul> <li>消耗记录详情查询接口</li> </ul> <h5>请求URL</h5> <ul> <li><code>https://api.hellogptworld.com/v1/billing/usage</code></li> </ul> <h5>请求方式</h5> <ul> <li>GET</li> </ul> <h5>请求头信息</h5> <ul> <li>Authorization: Bearer 密钥信息 (你的密钥,在 [api对接](<a href="https://vip.gptchatclub.com/api">https://vip.gptchatclub.com/api</a> &quot;api对接&quot;) 中查看)</li> </ul> <h5>请求参数说明</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">必选</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">pageNum</td> <td style="text-align: left;">是</td> <td style="text-align: left;">int</td> <td>页码</td> </tr> <tr> <td style="text-align: left;">pageSize</td> <td style="text-align: left;">是</td> <td style="text-align: left;">int</td> <td>每页数据量</td> </tr> <tr> <td style="text-align: left;">startDate</td> <td style="text-align: left;">是</td> <td style="text-align: left;">string</td> <td>查询日期,格式为yyyy-MM-dd</td> </tr> </tbody> </table> <h5>正确返回示例</h5> <pre><code>{     &amp;quot;msg&amp;quot;: &amp;quot;操作成功。&amp;quot;,     &amp;quot;total&amp;quot;: 16,     &amp;quot;code&amp;quot;: 200,     &amp;quot;data&amp;quot;: [         {             &amp;quot;name&amp;quot;: &amp;quot;gpt-3.5-turbo&amp;quot;,             &amp;quot;cost&amp;quot;: &amp;quot;0.008595&amp;quot;,             &amp;quot;completionTokens&amp;quot;: &amp;quot;610&amp;quot;,             &amp;quot;promptTokens&amp;quot;: &amp;quot;5&amp;quot;,             &amp;quot;number&amp;quot;: &amp;quot;0&amp;quot;,             &amp;quot;createTime&amp;quot;: &amp;quot;2023-09-18 14:55:00&amp;quot;,             &amp;quot;exchangeRate&amp;quot;: &amp;quot;7.300000&amp;quot;,             &amp;quot;secretName&amp;quot;: &amp;quot;Secret Key&amp;quot;         },         {             &amp;quot;name&amp;quot;: &amp;quot;gpt-3.5-turbo&amp;quot;,             &amp;quot;cost&amp;quot;: &amp;quot;0.007860&amp;quot;,             &amp;quot;completionTokens&amp;quot;: &amp;quot;552&amp;quot;,             &amp;quot;promptTokens&amp;quot;: &amp;quot;12&amp;quot;,             &amp;quot;number&amp;quot;: &amp;quot;0&amp;quot;,             &amp;quot;createTime&amp;quot;: &amp;quot;2023-09-18 14:54:19&amp;quot;,             &amp;quot;exchangeRate&amp;quot;: &amp;quot;7.300000&amp;quot;,             &amp;quot;secretName&amp;quot;: &amp;quot;Secret Key&amp;quot;         },         {             &amp;quot;name&amp;quot;: &amp;quot;gpt-3.5-turbo&amp;quot;,             &amp;quot;cost&amp;quot;: &amp;quot;0.004159&amp;quot;,             &amp;quot;completionTokens&amp;quot;: &amp;quot;290&amp;quot;,             &amp;quot;promptTokens&amp;quot;: &amp;quot;9&amp;quot;,             &amp;quot;number&amp;quot;: &amp;quot;0&amp;quot;,             &amp;quot;createTime&amp;quot;: &amp;quot;2023-09-18 14:26:40&amp;quot;,             &amp;quot;exchangeRate&amp;quot;: &amp;quot;7.300000&amp;quot;,             &amp;quot;secretName&amp;quot;: &amp;quot;Secret Key&amp;quot;         }     ] } </code></pre> <h5>错误返回示例</h5> <pre><code>密钥不对或者密钥没有填 {     &amp;quot;msg&amp;quot;: &amp;quot;Error request, response status: 401&amp;quot;,     &amp;quot;code&amp;quot;: 401 } 必填参数没有传 {     &amp;quot;msg&amp;quot;: &amp;quot;参数错误。&amp;quot;,     &amp;quot;code&amp;quot;: 500 }</code></pre> <h5>返回参数说明</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">msg</td> <td style="text-align: left;">string</td> <td>返回状态描述</td> </tr> <tr> <td style="text-align: left;">code</td> <td style="text-align: left;">int</td> <td>返回状态码</td> </tr> <tr> <td style="text-align: left;">total</td> <td style="text-align: left;">int</td> <td>总数</td> </tr> <tr> <td style="text-align: left;">data</td> <td style="text-align: left;">object</td> <td>返回数据</td> </tr> </tbody> </table> <p>data字段说明</p> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">name</td> <td style="text-align: left;">string</td> <td>模型名称</td> </tr> <tr> <td style="text-align: left;">cost</td> <td style="text-align: left;">string</td> <td>消耗金额</td> </tr> <tr> <td style="text-align: left;">completionTokens</td> <td style="text-align: left;">string</td> <td>GPT回答的token数</td> </tr> <tr> <td style="text-align: left;">promptTokens</td> <td style="text-align: left;">string</td> <td>输入的token数</td> </tr> <tr> <td style="text-align: left;">number</td> <td style="text-align: left;">string</td> <td>dalle模型返回的图片张数</td> </tr> <tr> <td style="text-align: left;">createTime</td> <td style="text-align: left;">string</td> <td>创建时间</td> </tr> <tr> <td style="text-align: left;">exchangeRate</td> <td style="text-align: left;">string</td> <td>利率</td> </tr> <tr> <td style="text-align: left;">secretName</td> <td style="text-align: left;">string</td> <td>密钥名称</td> </tr> </tbody> </table> <h5>备注</h5> <ul> <li>暂无</li> </ul>

页面列表

ITEM_HTML