Saltar al contenido principal
GET
/
api
/
v1
/
llm
/
usage
/
costs
Python (SDK)
from meetkai_mka1 import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.llm.usage.costs(start_time=612474, end_time=211313)

    # Handle response
    print(res)
{
  "object": "<unknown>",
  "currency": "<string>",
  "start_time": 0,
  "end_time": 0,
  "group_by": [],
  "data": [
    {
      "model": "<string>",
      "api_key_id": "<string>",
      "team_id": "<string>",
      "external_user_id": "<string>",
      "org_id": "<string>",
      "cost": 123,
      "cost_nano": "<string>"
    }
  ],
  "total_cost": 123,
  "total_cost_nano": "<string>"
}

Autorizaciones

Authorization
string
header
requerido

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Encabezados

X-On-Behalf-Of
string

Optional external end-user identifier forwarded by the API gateway.

Parámetros de consulta

start_time
integer
requerido

Marca de tiempo Unix, inclusiva

Rango requerido: 0 <= x <= 9007199254740991
end_time
integer
requerido

Timestamp de Unix, exclusivo

Rango requerido: 0 <= x <= 9007199254740991
org_id
string

Administradores de clúster solamente: organización cuyos costos informar (por defecto, la organización del que llama)

group_by

Costo del grupo por modelo / api_key_id (clave del inquilino) / team_id (subinquilino dentro de una organización) / external_user_id (usuario final proporcionado por el cliente, X-On-Behalf-Of, para recobro de reventa) / org_id

Opciones disponibles:
model,
api_key_id,
team_id,
external_user_id,
org_id

Respuesta

200 - application/json

Está bien

object
any
requerido
currency
string | null
requerido
start_time
integer
requerido
Rango requerido: -9007199254740991 <= x <= 9007199254740991
end_time
integer
requerido
Rango requerido: -9007199254740991 <= x <= 9007199254740991
group_by
enum<string>[]
requerido
Opciones disponibles:
model,
api_key_id,
team_id,
external_user_id,
org_id
data
object[]
requerido
total_cost
number
requerido
total_cost_nano
string
requerido

Costo total en unidades NANO enteras (1e9 por unidad mayor, NO en centavos); use total_cost para la cantidad mayor.