# Tail the live log (/docs/api/logs/logs_tail)

The newest events from the live tail (calls, waterfall run steps, jobs, lists and alerts), newest last, with the same filters as the stream: provider, capability, status, key, app, run or waterfall, minimum latency and cost, sample and fields. Stream them with GET /v1/logs/live or the logs://live MCP resource.

`GET /v1/logs/live/recent`

```json
{
  "operationId": "logs_tail",
  "summary": "Tail the live log",
  "description": "The newest events from the live tail (calls, waterfall run steps, jobs, lists and alerts), newest last, with the same filters as the stream: provider, capability, status, key, app, run or waterfall, minimum latency and cost, sample and fields. Stream them with GET /v1/logs/live or the logs://live MCP resource.",
  "tags": [
    "logs"
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "parameters": [
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "call",
                "run",
                "job",
                "list",
                "alert"
              ]
            },
            "maxItems": 5
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ],
        "description": "Event kinds (default: all)"
      },
      "required": false,
      "description": "Event kinds (default: all)",
      "name": "kinds",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "provider",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "capability",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "endpoint_id",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "key_id",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "app_id",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "mode",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "sync",
                "wait",
                "async",
                "batch",
                "list",
                "mcp"
              ]
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "client_mode",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "byok",
                "managed",
                "connected"
              ]
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "supply_mode",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "managed",
                "byok",
                "none"
              ]
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "credential",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "hit",
                "miss",
                "failed",
                "error"
              ]
            },
            "maxItems": 4
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ],
        "description": "hit, miss, failed (or error)"
      },
      "required": false,
      "description": "hit, miss, failed (or error)",
      "name": "status",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "http_status",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$"
            },
            "maxItems": 25
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ]
      },
      "required": false,
      "name": "error_code",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$",
        "description": "A run, waterfall run, list or job id: matches run_id, parent_id or the id itself"
      },
      "required": false,
      "description": "A run, waterfall run, list or job id: matches run_id, parent_id or the id itself",
      "name": "run_id",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_.:/@-]{1,200}$",
        "description": "Only this waterfall's runs and attempts"
      },
      "required": false,
      "description": "Only this waterfall's runs and attempts",
      "name": "waterfall_id",
      "in": "query"
    },
    {
      "schema": {
        "type": [
          "integer",
          "null"
        ],
        "minimum": 0
      },
      "required": false,
      "name": "latency_min",
      "in": "query"
    },
    {
      "schema": {
        "type": [
          "integer",
          "null"
        ],
        "minimum": 0,
        "description": "Micro-USD"
      },
      "required": false,
      "description": "Micro-USD",
      "name": "cost_min",
      "in": "query"
    },
    {
      "schema": {
        "type": "string",
        "maxLength": 2000,
        "description": "Log query text, the /logs grammar (`provider:mock -capability:email.find status:>=400`): includes, exclusions, ranges and search; calls only"
      },
      "required": false,
      "description": "Log query text, the /logs grammar (`provider:mock -capability:email.find status:>=400`): includes, exclusions, ranges and search; calls only",
      "name": "query",
      "in": "query"
    },
    {
      "schema": {
        "type": [
          "number",
          "null"
        ],
        "minimum": 0,
        "maximum": 1,
        "description": "Keep this share of events (0-1)"
      },
      "required": false,
      "description": "Keep this share of events (0-1)",
      "name": "sample",
      "in": "query"
    },
    {
      "schema": {
        "anyOf": [
          {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "call_id",
                "parent_id",
                "attempt",
                "workspace_id",
                "app_id",
                "app_name",
                "key_id",
                "agent_id",
                "run_id",
                "supply_mode",
                "capability",
                "endpoint_id",
                "provider",
                "mode",
                "client_mode",
                "credential",
                "outcome",
                "error_code",
                "http_status",
                "upstream_status",
                "total_ms",
                "overhead_ms",
                "upstream_ms",
                "ttfb_ms",
                "queue_wait_ms",
                "bytes_in",
                "bytes_out",
                "cost_micro",
                "cache",
                "saved_micro",
                "user_agent",
                "client_name",
                "client_version",
                "client_kind",
                "ip",
                "asn",
                "country",
                "colo",
                "meta",
                "request_hash",
                "effective_options",
                "billing_verdict",
                "billing_billable",
                "vendor_expected_credits",
                "vendor_reported_credits",
                "vendor_balance_after",
                "vendor_expected_micro",
                "vendor_reported_micro",
                "ts",
                "has_body"
              ]
            },
            "maxItems": 60
          },
          {
            "type": "string",
            "maxLength": 4000
          }
        ],
        "description": "Project call rows to these columns"
      },
      "required": false,
      "description": "Project call rows to these columns",
      "name": "fields",
      "in": "query"
    },
    {
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 1000,
        "default": 50,
        "description": "How many of the newest buffered events to return"
      },
      "required": false,
      "description": "How many of the newest buffered events to return",
      "name": "limit",
      "in": "query"
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "seq": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "ts": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "shard": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "call"
                          ]
                        },
                        "row": {
                          "type": "object",
                          "properties": {
                            "call_id": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 128
                            },
                            "parent_id": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 128
                            },
                            "attempt": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "workspace_id": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "app_id": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64
                            },
                            "app_name": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 80
                            },
                            "key_id": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64
                            },
                            "agent_id": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64
                            },
                            "run_id": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 128
                            },
                            "supply_mode": {
                              "type": "string",
                              "enum": [
                                "byok",
                                "managed",
                                "connected"
                              ]
                            },
                            "capability": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "endpoint_id": {
                              "type": "string",
                              "maxLength": 200
                            },
                            "provider": {
                              "type": "string",
                              "maxLength": 80
                            },
                            "mode": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "client_mode": {
                              "type": "string",
                              "enum": [
                                "sync",
                                "wait",
                                "async",
                                "batch",
                                "list",
                                "mcp"
                              ]
                            },
                            "credential": {
                              "type": "string",
                              "enum": [
                                "managed",
                                "byok",
                                "none"
                              ]
                            },
                            "outcome": {
                              "type": "string",
                              "enum": [
                                "hit",
                                "miss",
                                "failed"
                              ]
                            },
                            "error_code": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64
                            },
                            "http_status": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "upstream_status": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 0
                            },
                            "total_ms": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "overhead_ms": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "upstream_ms": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "ttfb_ms": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 0
                            },
                            "queue_wait_ms": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bytes_in": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "bytes_out": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "cost_micro": {
                              "type": "integer",
                              "minimum": 0
                            },
                            "cache": {
                              "type": "string",
                              "enum": [
                                "hit",
                                "partial",
                                "miss",
                                "stale",
                                "bypass"
                              ]
                            },
                            "saved_micro": {
                              "type": "integer",
                              "minimum": 0,
                              "default": 0
                            },
                            "user_agent": {
                              "type": "string",
                              "maxLength": 512
                            },
                            "client_name": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "client_version": {
                              "type": "string",
                              "maxLength": 32
                            },
                            "client_kind": {
                              "type": "string",
                              "enum": [
                                "sdk",
                                "mcp",
                                "cli",
                                "browser",
                                "server",
                                "unknown"
                              ]
                            },
                            "ip": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64
                            },
                            "asn": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 0
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 8
                            },
                            "colo": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 8
                            },
                            "meta": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string",
                                "maxLength": 500
                              }
                            },
                            "request_hash": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64
                            },
                            "effective_options": {
                              "type": "string",
                              "maxLength": 4000,
                              "default": ""
                            },
                            "billing_verdict": {
                              "type": "string",
                              "enum": [
                                "ok",
                                "charged_for_miss",
                                "double_charged_retry",
                                "price_mismatch",
                                "unverifiable",
                                "none",
                                "managed"
                              ]
                            },
                            "billing_billable": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "default": null
                            },
                            "vendor_expected_credits": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "minimum": 0,
                              "default": null
                            },
                            "vendor_reported_credits": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "minimum": 0,
                              "default": null
                            },
                            "vendor_balance_after": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "default": null
                            },
                            "vendor_expected_micro": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 0,
                              "default": null
                            },
                            "vendor_reported_micro": {
                              "type": [
                                "integer",
                                "null"
                              ],
                              "minimum": 0,
                              "default": null
                            },
                            "ts": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "has_body": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "seq",
                        "ts",
                        "shard",
                        "kind",
                        "row"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "seq": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "ts": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "shard": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "run"
                          ]
                        },
                        "run_id": {
                          "type": "string"
                        },
                        "waterfall_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "run.started",
                            "attempt.started",
                            "attempt.finished",
                            "stage.finished",
                            "run.finished"
                          ]
                        },
                        "data": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "seq",
                        "ts",
                        "shard",
                        "kind",
                        "run_id",
                        "waterfall_id",
                        "type",
                        "data"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "seq": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "ts": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "shard": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "job"
                          ]
                        },
                        "job_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "maxLength": 32
                        },
                        "endpoint_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cost_micro": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 0
                        }
                      },
                      "required": [
                        "seq",
                        "ts",
                        "shard",
                        "kind",
                        "job_id",
                        "status",
                        "endpoint_id",
                        "cost_micro"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "seq": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "ts": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "shard": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "list"
                          ]
                        },
                        "list_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "maxLength": 32
                        },
                        "done": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "total": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "hits": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "cost_micro": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "seq",
                        "ts",
                        "shard",
                        "kind",
                        "list_id",
                        "status",
                        "done",
                        "total",
                        "hits",
                        "cost_micro"
                      ]
                    },
                    {
                      "type": "object",
                      "properties": {
                        "seq": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "ts": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "shard": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "alert"
                          ]
                        },
                        "alert": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "maxLength": 200
                            },
                            "rule": {
                              "type": "string",
                              "enum": [
                                "error_rate",
                                "p95_latency",
                                "spend",
                                "budget_used",
                                "vendor_failure_spike",
                                "vendor_key_failing",
                                "billing_mismatch",
                                "cache_hit_rate",
                                "delivery_backlog",
                                "security_event",
                                "new_ip"
                              ]
                            },
                            "rule_id": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "maxLength": 64,
                              "default": null
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "triggered",
                                "resolved"
                              ],
                              "default": "triggered"
                            },
                            "severity": {
                              "type": "string",
                              "enum": [
                                "info",
                                "warning",
                                "critical"
                              ]
                            },
                            "title": {
                              "type": "string",
                              "maxLength": 160
                            },
                            "message": {
                              "type": "string",
                              "maxLength": 500
                            },
                            "data": {
                              "type": "object",
                              "additionalProperties": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "boolean"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            }
                          },
                          "required": [
                            "id",
                            "rule",
                            "severity",
                            "title",
                            "message",
                            "data"
                          ]
                        }
                      },
                      "required": [
                        "seq",
                        "ts",
                        "shard",
                        "kind",
                        "alert"
                      ]
                    }
                  ]
                }
              },
              "shards": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "items",
              "shards"
            ]
          }
        }
      }
    },
    "default": {
      "description": "Error",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "invalid_request",
                      "unauthorized",
                      "insufficient_balance",
                      "max_cost_exceeded",
                      "scope_denied",
                      "budget_blocked",
                      "not_found",
                      "idempotency_mismatch",
                      "invalid_meta",
                      "rate_limited",
                      "upstream_error",
                      "response_buffer_limit",
                      "provider_capacity_unavailable",
                      "grid_saturated",
                      "upstream_timeout",
                      "conflict",
                      "internal_error",
                      "account_frozen",
                      "strict_filters",
                      "plan_limit_reached",
                      "validation_failed",
                      "deadline_exceeded",
                      "cancelled"
                    ]
                  },
                  "message": {
                    "type": "string"
                  },
                  "request_id": {
                    "type": "string"
                  },
                  "call_id": {
                    "type": "string"
                  },
                  "retry_after_ms": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "details": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "code",
                  "message"
                ]
              }
            },
            "required": [
              "error"
            ]
          }
        }
      }
    }
  }
}
```
