Get Proxy Call Records
Proxy call records (Proxy Usage) document the information of each call made through the Proxy service (such as OpenAI compatible proxies). This interface is similar to the API call records but is specific to Proxy type services.
This interface requires authentication, for details please refer to Platform Token.
¶ Interface Description
- Request Method: GET
- Request URL:
https://platform.acedata.cloud/api/v1/usage/proxies/ - Request Headers:
- accept:
application/json - authorization:
Bearer {token}
- accept:
¶ Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
application_id |
string | No | Filter by application ID |
proxy_id |
string | No | Filter by Proxy ID |
created_at_from |
string | No | Start time of creation |
created_at_to |
string | No | End time of creation |
limit |
integer | No | Number of results per page |
offset |
integer | No | Offset |
¶ CURL Request Example
curl -X GET \
-H "accept: application/json" \
-H "authorization: Bearer {token}" \
"https://platform.acedata.cloud/api/v1/usage/proxies/"
¶ Response Result Example
{
"count": 50,
"results": [
{
"id": "usage-uuid",
"user_id": "b87f67c1-b04f-4332-99a1-7a5e651331c6",
"application_id": "app-uuid",
"proxy_id": "proxy-uuid",
"remaining_amount": 800.0,
"used_amount": 2.5,
"deducted_amount": 2.5,
"service": {
"id": "service-uuid",
"alias": "openai-proxy",
"name": "OpenAI Proxy"
},
"metadata": {},
"created_at": "2024-08-16T07:51:15.603207Z",
"updated_at": "2024-08-16T07:51:15.603207Z"
}
]
}
¶ Response Field Description
| Field | Type | Description |
|---|---|---|
id |
string | Unique identifier for the record |
user_id |
string | User ID |
application_id |
string | Application ID |
proxy_id |
string | Proxy ID |
remaining_amount |
number | Remaining balance after the call |
used_amount |
number | Amount consumed this time |
deducted_amount |
number | Actual deducted amount |
service |
object | Information about the service |
metadata |
object | Request metadata |
¶ Code Example
Python:
import requests
url = "https://platform.acedata.cloud/api/v1/usage/proxies/"
headers = {
"accept": "application/json",
"authorization": "Bearer {token}"
}
response = requests.get(url, headers=headers)
data = response.json()
for usage in data["results"]:
print(f"Proxy: {usage['service']['name']} | Consumption: {usage['deducted_amount']}")
