Ресурс

LLM Log

Logs of all the LLM API calls for AI features in this project.

Модель LLM Log

Свойства

  • Имя
    _id
    Тип
    Object ID
    Описание

    ID of this object

  • Имя
    createdAt
    Тип
    Date
    Описание

    Date and Time when the object was created.

  • Имя
    updatedAt
    Тип
    Date
    Описание

    Date and Time when the object was updated.

  • Имя
    project
    Тип
    Project
    Описание

    Relation to Project Resource in which this object belongs

  • Имя
    projectId
    Тип
    Object IDОбязательно
    Описание

    ID of your Project in which this object belongs

  • Имя
    llmProvider
    Тип
    LLM Provider
    Описание

    LLM Provider used for this API call

  • Имя
    llmProviderId
    Тип
    Object ID
    Описание

    ID of LLM Provider used for this API call

  • Имя
    llmProviderName
    Тип
    Text
    Описание

    Name of the LLM Provider at time of call

  • Имя
    llmType
    Тип
    Text
    Описание

    Type of LLM (OpenAI, Anthropic, Ollama)

  • Имя
    modelName
    Тип
    Text
    Описание

    Name of the model used (e.g., gpt-4, claude-3-opus)

  • Имя
    isGlobalProvider
    Тип
    BooleanОбязательно
    Описание

    Was a global LLM provider used for this call?

  • Имя
    totalTokens
    Тип
    NumberОбязательно
    Описание

    Total tokens used (input + output)

  • Имя
    costInUSDCents
    Тип
    NumberОбязательно
    Описание

    Total cost in USD cents

  • Имя
    wasBilled
    Тип
    BooleanОбязательно
    Описание

    Was the project charged for this API call?

  • Имя
    status
    Тип
    TextОбязательно
    Описание

    Status of the LLM API call

  • Имя
    statusMessage
    Тип
    Long Text
    Описание

    Status Message (error details if failed)

  • Имя
    feature
    Тип
    Text
    Описание

    The feature that triggered this API call (e.g., IncidentPostmortem)

  • Имя
    requestPrompt
    Тип
    Very Long Text
    Описание

    The prompt sent to the LLM (truncated)

  • Имя
    responsePreview
    Тип
    Very Long Text
    Описание

    Preview of the LLM response (truncated)

  • Имя
    incident
    Тип
    Incident
    Описание

    Incident associated with this LLM call (if any)

  • Имя
    incidentId
    Тип
    Object ID
    Описание

    ID of Incident associated with this LLM call (if any)

  • Имя
    alert
    Тип
    Alert
    Описание

    Alert associated with this LLM call (if any)

  • Имя
    alertId
    Тип
    Object ID
    Описание

    ID of Alert associated with this LLM call (if any)

  • Имя
    scheduledMaintenance
    Тип
    Scheduled Maintenance Event
    Описание

    Scheduled Maintenance associated with this LLM call (if any)

  • Имя
    scheduledMaintenanceId
    Тип
    Object ID
    Описание

    ID of Scheduled Maintenance associated with this LLM call (if any)

  • Имя
    user
    Тип
    User
    Описание

    User who triggered this LLM call (if any)

  • Имя
    userId
    Тип
    Object ID
    Описание

    ID of User who triggered this LLM call (if any)

  • Имя
    requestStartedAt
    Тип
    Date
    Описание

    When the LLM request started

  • Имя
    requestCompletedAt
    Тип
    Date
    Описание

    When the LLM request completed

  • Имя
    durationMs
    Тип
    Number
    Описание

    Request duration in milliseconds

GETorPOST/api/llm-log/get-list

Список

Этот метод возвращает постраничный список ваших объектов «LLM Log». По умолчанию на странице до десяти записей.

Необязательные query-параметры

  • limit
    число
    Сколько объектов вернуть. По умолчанию 10, максимум 100
  • skip
    число
    Сколько объектов пропустить (для пагинации)

Необязательное тело запроса

Запрос списка

POST
/api/llm-log/get-list?skip=0&limit=10
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "costInUSDCents": true,
    "isGlobalProvider": true,
    "projectId": true,
    "status": true,
    "totalTokens": true
  },
  "query": {
    "status": "Example status"
  },
  "sort": {
    "createdAt": -1
  }
}

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "3773dba0-28fe-11f1-b591-3fdcef396aba",
      "costInUSDCents": 100,
      "isGlobalProvider": true,
      "projectId": "550e8400-e29b-41d4-a716-446655440000",
      "status": "Example status",
      "totalTokens": 100
    },
    {
      "_id": "3773dba1-28fe-11f1-b591-3fdcef396aba",
      "costInUSDCents": 100,
      "isGlobalProvider": true,
      "projectId": "550e8400-e29b-41d4-a716-446655440000",
      "status": "Example status",
      "totalTokens": 100
    },
    {
      "_id": "3773dba2-28fe-11f1-b591-3fdcef396aba",
      "costInUSDCents": 100,
      "isGlobalProvider": true,
      "projectId": "550e8400-e29b-41d4-a716-446655440000",
      "status": "Example status",
      "totalTokens": 100
    }
  ]
}
GETorPOST/api/llm-log/:id/get-item

Получить по ID

Возвращает объект «LLM Log» по идентификатору.

  • id
    строка
    ID объекта

Необязательное тело запроса

  • select
    По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.

Запрос одного объекта

POST
/api/llm-log/:id/get-item
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "costInUSDCents": true,
    "isGlobalProvider": true,
    "projectId": true,
    "status": true,
    "totalTokens": true
  }
}

Ответ

{
  "_id": "3773dba0-28fe-11f1-b591-3fdcef396aba",
  "costInUSDCents": 100,
  "isGlobalProvider": true,
  "projectId": "550e8400-e29b-41d4-a716-446655440000",
  "status": "Example status",
  "totalTokens": 100
}
POST/api/llm-log/count

Количество

Возвращает количество ваших объектов «LLM Log».

Необязательное тело запроса

Запрос количества

POST
/api/llm-log/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "status": "Example status"
  }
}

Ответ

{
  "count": 107
}

Права доступа

Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.

Права на чтение

Нужны для чтения LLM Log

  • Project Owner
  • Project Admin
  • Project Member
  • Read LLM Log
  • Read All Project Resources

Права на создание

Нужны для создания LLM Log

Ресурс нельзя создать через API

Права на обновление

Нужны для обновления LLM Log

Ресурс нельзя обновить через API

Права на удаление

Нужны для удаления LLM Log

Ресурс нельзя удалить через API