Generation
NAME
OpenRouter::API::Result::Generation - Post-hoc generation metadata
SYNOPSIS
# Look up a single call by its gen-id.
my $g = $or.get-generation('gen-abc123');
say "cost: \$", $g.total-cost;
say "latency: {$g.latency} ms";
say "finish: ", $g.finish-reason;
say "provider: ", $g.provider-name;
# Include the stored prompt + completion text (only when request
# logging was enabled on the account).
my $full = $or.get-generation-content($g.id);
say $full.prompt-text;
say $full.completion-text;
DESCRIPTION
Unified wrapper over GET /generation and GET /generation/content.
The former returns cost / token / latency metadata; the latter
additionally returns the stored prompt messages and completion text
(when logging is enabled).
The Client merges both responses into a single Generation when
get-generation-content is called ā prompt-text /
completion-text / reasoning-text stay Nil unless the content
fetch happened.