Skip to content

Informe desglosado de costes​

GET
/v1/org/{org_id}/cost-analytics

billing.view — OWNER ADMIN

Informe de coste calculado del uso por mensaje: totales, serie temporal y desglose por agente/canal/transporte/scope/conversación/contacto/modelo, con separación por tipo de token y ventanas de fechas + filtros arbitrarios.

Autorizaciones​

bearer

Token de servicio (kjtk_live_…), creado desde el panel en Ajustes → Tokens de servicio. Pertenece a una organización y lleva sus propios permisos.

Tipo
HTTP (bearer)
o
JWT

Sesión de una persona en el panel. No sirve para integrar.

Tipo
HTTP (bearer)

Parámetros​

Parámetros de la ruta

org_id*
Tipo
number
Requerido

Parámetros de consulta

from

Lower bound (ISO date) on the message timestamp. Default: 30 days ago.

Tipo
string
to

Upper bound (ISO date), exclusive. Default: now.

Tipo
string
bucket

Time-bucket granularity of the series.

Tipo
string
Valores válidos
"hour""day""week""month"
group_by

Dimension the breakdown is grouped by.

Tipo
string
Valores válidos
"agent""channel""transport""scope""conversation""contact""model""cron"
agent_id

Filter to a single agent.

Tipo
number
Mínimo
1
channel_id

Filter to a single channel.

Tipo
number
Mínimo
1
transport

Filter to a single transport.

Tipo
string
Valores válidos
"INTERNAL""WHATSAPP""GMAIL""DISCORD""TELEGRAM""SLACK""WEBHOOK""EMAIL""GITHUB""DRIVE""CALENDAR"

Respuestas​

application/json
JSON
{
  
"from": "2026-05-20T00:00:00.000Z",
  
"to": "2026-06-19T00:00:00.000Z",
  
"bucket": "day",
  
"group_by": "agent",
  
"totals": {
  
  
"cost_micro": "5000000",
  
  
"input_tokens": "120000",
  
  
"output_tokens": "34000",
  
  
"cache_read_tokens": "900000",
  
  
"cache_write_tokens": "45000",
  
  
"total_tokens": "1099000"
  
},
  
"series": [
  
  
{
  
  
  
"cost_micro": "5000000",
  
  
  
"input_tokens": "120000",
  
  
  
"output_tokens": "34000",
  
  
  
"cache_read_tokens": "900000",
  
  
  
"cache_write_tokens": "45000",
  
  
  
"total_tokens": "1099000",
  
  
  
"bucket": "2026-06-18T00:00:00.000Z"
  
  
}
  
],
  
"breakdown": [
  
  
{
  
  
  
"cost_micro": "5000000",
  
  
  
"input_tokens": "120000",
  
  
  
"output_tokens": "34000",
  
  
  
"cache_read_tokens": "900000",
  
  
  
"cache_write_tokens": "45000",
  
  
  
"total_tokens": "1099000",
  
  
  
"key": "10",
  
  
  
"label": "Ailfred",
  
  
  
"agent_id": 7,
  
  
  
"transport": "TELEGRAM",
  
  
  
"contact_name": "Soki",
  
  
  
"person_kind": "INTERNAL_USER",
  
  
  
"person_avatar_url": "/user/3/avatar?v=1718900000000",
  
  
  
"message_count": "991"
  
  
}
  
]
}

Pruébalo​

Autorización
Variables
Clave
Valor

Ejemplos​