% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/api_openrouter.R
\name{openrouter_generation}
\alias{openrouter_generation}
\title{Get Details for an OpenRouter Generation}
\usage{
openrouter_generation(
  .id,
  .api_url = "https://openrouter.ai",
  .timeout = 60,
  .max_tries = 3
)
}
\arguments{
\item{.id}{The generation ID string (e.g. \code{"gen-..."}) returned by OpenRouter.}

\item{.api_url}{Base URL for the OpenRouter API (default: \code{"https://openrouter.ai"}).}

\item{.timeout}{Request timeout in seconds (default: 60).}

\item{.max_tries}{Maximum retries (default: 3).}
}
\value{
A named list with generation details including \code{id}, \code{model},
\code{total_cost}, \code{tokens_prompt}, \code{tokens_completion}, and \code{latency}.
}
\description{
Fetches cost, latency, and token details for a past generation using its ID.
The generation ID is available in \code{get_metadata(result)$api_specific$id}
after a \code{chat()} call.
}
