# `MimirAnalytics.Row.ModelCall`
[🔗](https://github.com/cash-mckeeman/mimir/blob/mimir_analytics-v0.8.1/mimir_analytics/lib/mimir_analytics/row/model_call.ex#L1)

One row of `model_calls` — a gateway `"request_log"` line. `new/1` owns the
rename off the wire shape (`request_id` → `mimir_request_id`,
`inserted_at` → `ts`) and the usage/fallback defaults. `run_id` starts
`nil`; `GatewayExport.resolve_run_ids/1` backfills it via
`(workflow_id, step_id)` against `runs` after ingest.

# `t`

```elixir
@type t() :: %MimirAnalytics.Row.ModelCall{
  cost_microdollars: integer(),
  error_class: String.t() | nil,
  fallback: boolean(),
  finish_reason: String.t() | nil,
  input_tokens: integer(),
  lane: String.t() | nil,
  latency_ms: integer() | nil,
  mimir_request_id: String.t(),
  model_id: String.t() | nil,
  output_tokens: integer(),
  parent_key_id: String.t() | nil,
  parent_step_id: String.t() | nil,
  provider: String.t() | nil,
  run_id: String.t() | nil,
  source_file: String.t(),
  status: String.t() | nil,
  step_id: String.t() | nil,
  tenant_id: String.t() | nil,
  ts: String.t() | nil,
  virtual_key_id: String.t() | nil,
  workflow_id: String.t() | nil
}
```

# `new`

```elixir
@spec new(map()) :: t()
```

Build a `t()` from a decoded "request_log" line plus "source_file".

---

*Consult [api-reference.md](api-reference.md) for complete listing*
