Connect Gateway (for example LiteLLM) and local models to Optimeter
These are the ways to get the cost of Gateway (for example LiteLLM) and local models into Optimeter, best first. They are the same steps the guide in the app shows.
Send to Optimeter's API
Your gateway (for example LiteLLM) sends the usage to Optimeter with an Optimeter key. Done once, about 5 minutes.
3 steps, about 5 min. Once.
What Optimeter may read: The Optimeter key can only send usage to your organization in Optimeter. It is shown once and stored only as a checksum.
Create an Optimeter key
In Optimeter
Create the key here in the step. It is shown only once; put it in the gateway's settings.
Copy the example
In Optimeter
Copy the example: the address, the header Authorization: Bearer $OPTIMETER_KEY and one post in JSON with the source gateway.
Send a test post
In Optimeter
Send the example with ?dry_run=1 in the address. The guide shows the answer, for example that one post would be created. The test post is never saved.
Common mistakes
- The posts end up under the wrong service.
- Use the source gateway in every post.
- The key was not copied.
- It is shown only once. Create a new key and revoke the old one.
Upload in Optimeter's format
Fill in Optimeter's template with the gateway's usage and upload it, once a month.
3 steps, about 12 min. Every month.
Download the template
In Optimeter
Download the template. It has only the header row, and each column is explained with an example value.
Fill in the template
At the provider
Write one row per day and key from the gateway's log or report.
Upload the file
In Optimeter
Upload the file. Optimeter shows what would be saved before anything is saved.
Common mistakes
- The file has other columns than the template.
- Start from the template and do not change the column headers.