Documentation
Allocations

Get allocations

Get allocations.

GET
/allocations

Authorization

AuthorizationBearer <token>

In: header

Query Parameters

aggregate?string

Page number to retrieve.

Value in"model" | "label" | "day"

Response Body

Represents LLM costs allocation

TypeScript Definitions

Use the response body type in TypeScript.

Represents LLM costs allocation by days

date?string
Format"date"
total?number

Represents LLM costs allocation by model

model?string
total?number

Represents LLM costs allocation by label

label_key?string
label_value?string
input_costs?number
output_costs?number
total?number

Bad request.

TypeScript Definitions

Use the response body type in TypeScript.

type?string
title?string

Not found.

TypeScript Definitions

Use the response body type in TypeScript.

type?string
title?string
curl -X GET "https://api.gate.io/v1/allocations?aggregate=day" \
  -H "Authorization: Bearer <token>"
fetch("https://api.gate.io/v1/allocations?aggregate=day", {
  headers: {
    "Authorization": "Bearer <token>"
  }
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://api.gate.io/v1/allocations?aggregate=day"

  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <token>")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.gate.io/v1/allocations?aggregate=day"

response = requests.request("GET", url, headers = {
  "Authorization": "Bearer <token>"
})

print(response.text)
{
  "date": "2023-10-29",
  "total": 0
}
{
  "type": "object",
  "title": "Validation failed"
}
{
  "type": "object",
  "title": "Validation failed"
}