Get Request Cost
curl --request GET \
--url https://api.evolink.ai/v1/requests/{request_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.evolink.ai/v1/requests/{request_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.evolink.ai/v1/requests/{request_id}', 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://api.evolink.ai/v1/requests/{request_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.evolink.ai/v1/requests/{request_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.evolink.ai/v1/requests/{request_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evolink.ai/v1/requests/{request_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "20261117223155519063884QnAx70lK",
"object": "request",
"model": "claude-haiku-5-5",
"status": "completed",
"finished_at": 1794925917,
"usage": {
"input_tokens": 18,
"output_tokens": 4,
"cached_tokens": 0,
"credits_used": 0.01,
"cost": {
"credits": 0.01,
"usd": 0.0002,
"cny": 0.001
}
}
}Account Management
Get Request Cost
Query status, usage, and actual cost by Request ID for synchronous API calls, primarily to text models
GET
/
v1
/
requests
/
{request_id}
Get Request Cost
curl --request GET \
--url https://api.evolink.ai/v1/requests/{request_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.evolink.ai/v1/requests/{request_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.evolink.ai/v1/requests/{request_id}', 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://api.evolink.ai/v1/requests/{request_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.evolink.ai/v1/requests/{request_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.evolink.ai/v1/requests/{request_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evolink.ai/v1/requests/{request_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "20261117223155519063884QnAx70lK",
"object": "request",
"model": "claude-haiku-5-5",
"status": "completed",
"finished_at": 1794925917,
"usage": {
"input_tokens": 18,
"output_tokens": 4,
"cached_tokens": 0,
"credits_used": 0.01,
"cost": {
"credits": 0.01,
"usd": 0.0002,
"cny": 0.001
}
}
}This endpoint queries the cost of synchronous API calls, primarily to text models through Chat Completions, Messages, or Responses.Use the value of the
X-Request-Id header from the original response as the Request ID. Wait a moment after the request completes before querying. For asynchronous tasks, use Get task status.Authorizations
All endpoints require Bearer Token authentication.
Get an API Key:
Visit the API Key management page to obtain your API Key.
Include the following request header:
Authorization: Bearer YOUR_API_KEY
Path Parameters
Response
Query successful
Request status:
completed: The request completed successfully.failed: The request failed. If usage occurred before the failure (for example, a streaming response was interrupted),usagereports the charges actually deducted.blocked: The request was rejected before processing, for example because of insufficient account balance, an exhausted API Key quota, a disabled or expired API Key, or a model that is not allowed. No charges are incurred.
Available options:
completed, failed, blocked Example:
"completed"