Projects
Get a project's spending limit and this month's spending
A project’s monthly spending limit, whether it stopped the project’s new work, and what the project spent this month (UTC).
GET
/
v1
/
projects
/
{project_id}
/
spending
Get a project's spending limit and this month's spending
curl --request GET \
--url https://api.sqwish.ai/v1/projects/{project_id}/spending \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/projects/{project_id}/spending"
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/projects/{project_id}/spending', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"monthly_limit_usd": "<string>",
"limit_stops": true,
"stopped": true,
"month_spent_usd": "<string>",
"month_started_at": 123
}{
"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>"
}
]
}
}Authorizations
Create an API key in the console.
Path Parameters
Response
Successful Response
The most its work may spend in a calendar month (UTC), or null for no limit.
Whether reaching the limit stops its new work until next month.
Whether its limit stopped its new work this month.
What its work spent this month, paid and promotional credit alike.
Get a project's spending limit and this month's spending
curl --request GET \
--url https://api.sqwish.ai/v1/projects/{project_id}/spending \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sqwish.ai/v1/projects/{project_id}/spending"
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/projects/{project_id}/spending', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"monthly_limit_usd": "<string>",
"limit_stops": true,
"stopped": true,
"month_spent_usd": "<string>",
"month_started_at": 123
}{
"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>"
}
]
}
}