Accounts
List requests
List your requests in a period, newest first, each with its operation’s id and the id of the request that made it.
GET
/
v1
/
organization
/
usage
/
requests
List requests
curl --request GET \
--url https://api.sqwish.ai/v1/organization/usage/requests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/organization/usage/requests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sqwish.ai/v1/organization/usage/requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "<string>",
"request_id": "<string>",
"status": "accepted",
"source": "api",
"created_at": 123,
"endpoint": "<string>",
"status_code": 123,
"requested_model": "<string>",
"served_model": "<string>",
"decisions": 123,
"input_tokens": 123,
"server_ms": 123,
"request_ms": 123,
"fallback_reason": "<string>",
"error_code": "<string>",
"api_key": {
"id": "<string>",
"name": "<string>",
"is_console": true,
"revoked_at": 123
},
"cost_usd": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}Query Parameters
List requests
curl --request GET \
--url https://api.sqwish.ai/v1/organization/usage/requests \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/organization/usage/requests"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sqwish.ai/v1/organization/usage/requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "<string>",
"request_id": "<string>",
"status": "accepted",
"source": "api",
"created_at": 123,
"endpoint": "<string>",
"status_code": 123,
"requested_model": "<string>",
"served_model": "<string>",
"decisions": 123,
"input_tokens": 123,
"server_ms": 123,
"request_ms": 123,
"fallback_reason": "<string>",
"error_code": "<string>",
"api_key": {
"id": "<string>",
"name": "<string>",
"is_console": true,
"revoked_at": 123
},
"cost_usd": "<string>"
}
],
"has_more": true,
"next_cursor": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"details": [
{
"path": [
"<string>"
],
"message": "<string>",
"type": "<string>"
}
]
}
}