Model

NAME

OpenRouter::API::Result::Model - One model from OpenRouter's catalogue

SYNOPSIS


use OpenRouter::API::Client;

my $or = OpenRouter::API::Client.new;
my @models = $or.get-models;

for @models -> $m {
    say $m.id, "  ", $m.name;
    say "  ctx: ",       $m.context-length;
    say "  vision: ",    $m.supports-vision;
    say "  tools: ",     $m.supports-tool-use;
    say "  cheapest $: ", $m.input-price-per-token // 'n/a';
}

DESCRIPTION

Wraps a single entry from GET /models. Named accessors cover the fields callers reach for most often; .raw returns the wire hash for anything else. Prices come back as Rat in USD-per-token (OpenRouter's wire format is a string like "0.000005").

OpenRouter::API v0.1.1

Raku client for OpenRouter's non-inference REST API

Authors

  • Matt Doughty

License

Artistic-2.0

Dependencies

Cro::HTTP:ver<0.8.11>:auth<zef:cro>JSON::Fast:ver<0.19>:auth<cpan:TIMOTIMO>

Test Dependencies

Provides

  • OpenRouter::API
  • OpenRouter::API::Client
  • OpenRouter::API::Filter
  • OpenRouter::API::Result::ActivityRow
  • OpenRouter::API::Result::Credits
  • OpenRouter::API::Result::Endpoint
  • OpenRouter::API::Result::Generation
  • OpenRouter::API::Result::Model
  • OpenRouter::API::Result::Provider

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.