查询积分余额
curl --request GET \
--url https://revor.ai/api/v2/creditsimport requests
url = "https://revor.ai/api/v2/credits"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://revor.ai/api/v2/credits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://revor.ai/api/v2/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://revor.ai/api/v2/credits"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://revor.ai/api/v2/credits")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"available_credits": 123,
"as_of": {}
}开始使用
查询积分余额
返回 API Key 所属用户当前可使用的总积分。该接口为同步只读接口,不创建任务,也不消耗积分。
GET
/
api
/
v2
/
credits
查询积分余额
curl --request GET \
--url https://revor.ai/api/v2/creditsimport requests
url = "https://revor.ai/api/v2/credits"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://revor.ai/api/v2/credits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://revor.ai/api/v2/credits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://revor.ai/api/v2/credits"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://revor.ai/api/v2/credits")
.asString();require 'uri'
require 'net/http'
url = URI("https://revor.ai/api/v2/credits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"available_credits": 123,
"as_of": {}
}| 方法 | GET |
| 权限 | 积分读取 |
| 限流 | 标准限流 |
| 返回 | 积分余额 |
请求示例
cURL
curl --get \
--url "https://revor.ai/api/v2/credits" \
--header "Authorization: Bearer sk-revor-REPLACE_ME"
响应示例
200
{
"ok": true,
"request_id": "req_xxx",
"available_credits": 1280,
"as_of": "2026-08-25T08:00:00.000Z"
}
响应字段
available_credits 已包含积分分组、有效期和订阅状态等规则。客户端不应自行汇总积分流水来替代该值。错误
| HTTP | Code | 说明 |
|---|---|---|
401 | api_key_invalid | API Key 无效。 |
403 | permission_denied | Key 不具有积分读取权限。 |
429 | api_rate_limit_exceeded | 请求触发限流。 |
500 | credits_query_failed | 积分查询失败;不要把该错误解释成余额为零。 |

