Get project billing
const options = {method: 'GET'};
fetch('https://api.example.com/v1/regions/global/projects/billing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/global/projects/billing"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.example.com/v1/regions/global/projects/billingimport requests
url = "https://api.example.com/v1/regions/global/projects/billing"
response = requests.get(url)
print(response.text){
"success": true,
"data": {
"projectId": "<string>",
"status": "active",
"currentPeriod": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"usage": {
"compute": 123,
"storage": 123,
"network": 123,
"total": 123,
"currency": "USD"
},
"invoices": [
{
"id": "<string>",
"number": "<string>",
"status": "draft",
"amount": 123,
"currency": "<string>",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}Billing
Get project billing
Get billing information for the current project, including usage summary and recent invoices
GET
/
v1
/
regions
/
global
/
projects
/
billing
Get project billing
const options = {method: 'GET'};
fetch('https://api.example.com/v1/regions/global/projects/billing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/global/projects/billing"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request GET \
--url https://api.example.com/v1/regions/global/projects/billingimport requests
url = "https://api.example.com/v1/regions/global/projects/billing"
response = requests.get(url)
print(response.text){
"success": true,
"data": {
"projectId": "<string>",
"status": "active",
"currentPeriod": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"usage": {
"compute": 123,
"storage": 123,
"network": 123,
"total": 123,
"currency": "USD"
},
"invoices": [
{
"id": "<string>",
"number": "<string>",
"status": "draft",
"amount": 123,
"currency": "<string>",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"dueDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}
]
}
}Was this page helpful?