Documentation / TinyFish

Tracking TinyFish in Onaro Meridian

Meridian attributes completed TinyFish Agent runs that arrive through a LiteLLM pass-through. Each run with a cost lands on the agent mapped to that virtual key, at the cost LiteLLM recorded. A pass-through run with no cost is not stored. Browser minutes are not on this path.

What's included

TinyFish productTracked through LiteLLM?
Agent runs (priced per step)Yes. A completed run is stored at the cost LiteLLM recorded.
Browser sessions (priced per minute)No. They do not pass through this LiteLLM route.
Search and FetchTinyFish does not charge for them, and this path does not record them.

Before you start

  • A TinyFish account and API key.
  • A LiteLLM proxy that includes the TinyFish pass-through.
  • LiteLLM already sending logs to Meridian. If it is not, follow the LiteLLM guide first. That setup uses a Usage ingest key from Settings → Keys & API → Usage ingest keys. A Discovery event key is a different key and is rejected.

Step 1: Route TinyFish through LiteLLM

  1. On the LiteLLM proxy, set your TinyFish API key as TINYFISH_API_KEY.
  2. In your code, replace TinyFish's address (https://agent.tinyfish.ai) with your proxy's address followed by /tinyfish. The official TinyFish SDK works unchanged when its base URL includes that /tinyfish prefix and the call uses your LiteLLM virtual key.
  3. Send the call with a LiteLLM virtual key in the X-API-Key header, instead of your TinyFish key.

LiteLLM's own instructions: TinyFish Agent pass-through.

Step 2: Use one virtual key per agent

Meridian attributes spend by virtual key. Give each agent, or each team that should share one agent, its own LiteLLM virtual key. A shared key puts all of those runs on one agent.

Step 3: Map the keys in Meridian

  1. Run one TinyFish task through each key so Meridian sees the key hash.
  2. In Meridian, open Settings, then Keys & API, then Gateway key registry (/meridian/settings/gateway-keys).
  3. Hashes with no mapping are listed under Unmapped keys. Assign each one to its agent.

Give that agent a department and an owner on Agents & allocation. A cost center on the registry is stored on the event. The rollup keeps it when every event for that agent and day has the same cost center, and that value can set the department when it matches one department or a cost-center mapping. The agent stays the one from the key.

Runs that arrived before the mapping stay unattributed. Assign those rows on Agents & allocation → Unattributed. Runs that arrive after the mapping land on the agent.

Step 4 (optional): Use your contract rate

LiteLLM prices a completed TinyFish run at its published per-step rate, unless you set TINYFISH_COST_PER_STEP on the proxy. Meridian stores the cost LiteLLM sends. It does not look the model up in the price catalog when that cost is present.

Check that it works

Run a TinyFish task through a mapped key. Meridian stores the usage record when the log arrives. The spend row appears on the ledger after the next rollup, at 20 minutes past the hour, UTC. Open Agents & allocation and the agent. You should see:

  • Provider: tinyfish
  • Model: tinyfish/automation-run
  • Cost: the cost LiteLLM recorded

Good to know

  • Completed runs carry the cost. LiteLLM records a cost for a completed run. A failed or cancelled run is not charged, and a pass-through row that arrives with no cost is not stored.
  • Dollars, not steps. Meridian shows each run's cost. It does not show the step count.
  • Long runs and proxy restarts. For an asynchronous run, LiteLLM records the cost when the run finishes. If the proxy restarts while that run is still going, LiteLLM may not record it.
  • Don't count the same run twice. Use this route for TinyFish keys that go through LiteLLM. A direct TinyFish connection is not available. If one is added later, do not connect a key that this proxy already uses.

Not using LiteLLM?

  • Your agents can send TinyFish usage as an OASA usage record with a Usage ingest key. Create that key under Settings → Keys & API → Usage ingest keys. See Usage ingest keys.
  • A direct TinyFish connection is not available yet. Tell us if you would use one.

TinyFish is a trademark of its owner. LiteLLM is a trademark of BerriAI.