Cargo Tag
Read the same printed label as PNG, JPEG, or WebP. The selected image is the one sent to the model.
Model cloudflare/clairic
Source
Fields to extract
crate_idtext- The printed crate ID.
gross_weightnumber- The printed gross weight in kilograms.
inspection_datedate- The printed inspection date.
contentslist · text- Each item on its own line under Contents.
View C# example
using ExtractionsDotNet;
using var client = OpenRouterExtractionsClient.FromEnvironment();
// With one asset and no state, the SDK points the request at that asset for you.
var response = await client.ExtractAsync(new ExtractionRequest("cloudflare/clairic",
new Dictionary<string, ExtractionField>
{
["crate_id"] = new TextField { Instructions = "The printed crate ID." },
["gross_weight"] = new NumberField { Unit = "kg", Decimals = 2 },
["inspection_date"] = new DateField { Instructions = "The printed inspection date." },
["contents"] = new ListField(ListItemType.Text) { Instructions = "Each item on its own line under Contents." }
})
{
Assets = new Dictionary<string, ExtractionAsset>
{
// ExtractionAssetFormat.Png, Jpeg, or Webp, matching the bytes.
["cargo-tag"] = new(ExtractionAssetFormat.Png, await File.ReadAllBytesAsync("cargo-tag.png"))
}
});
Console.WriteLine($"Crate {response.GetText("crate_id").Value}: {response.GetNumber("gross_weight").Value} kg, " +
$"inspected {response.GetDate("inspection_date").Value}");
Console.WriteLine($"Contents: {string.Join(", ", response.GetList<string>("contents").Value ?? [])}");