{"type":"root","children":[{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"What this solves"}]},{"type":"text","value":": Lets a finance system, ERP, or dashboard pull accounts from Tare automatically, without a human logging into the console."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The Reconciliation API is an accounting interface for "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"machines"}]},{"type":"text","value":". It authenticates with a Reconciliation key, not an Inference key, and doesn't need to simulate a console login."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"When to use the Reconciliation API"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Sync balance and transactions daily."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Pull locked statements at month-end."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Break usage down by key, model, and date."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Compare Tare's accounts with your upstream providers' bills."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Integration advice"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Create a Reconciliation key."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Set an expiry on it."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Start with "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/whoami"}]},{"type":"text","value":" to confirm the account, period, and time zone."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Sync "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/balance"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/transactions"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Sync "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/statements"}]},{"type":"text","value":" at month-end."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"When you need business breakdowns, pull "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/usage/daily"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/attribution"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"When you need to check upstream bills, pull "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/reconciliation"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"A Reconciliation key "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"can only read accounts"}]},{"type":"text","value":"; it can't call models, and it can't manage keys. The reverse is also true: "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"don't put a spend-capable Inference key into a finance system"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"img","properties":{"src":"diagram:en-integration-api-sequence","alt":"Reconciliation API integration order: start from whoami, pull statements at month-end","data-block":"true"},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Details"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"Use a reconciliation key, not an inference key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Reconciliation endpoints need a "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"reconciliation key"}]},{"type":"text","value":" (integration key). Create one on the console's API Keys page, choosing Reconciliation as the type; it can also be issued by the platform on your behalf."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The three key types have non-overlapping permissions. Using the wrong type returns a "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"clear rejection"}]},{"type":"text","value":", not a vague 401:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Key type"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Permission"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Inference key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Call models"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Reconciliation key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Read reports, "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"cannot call models"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Provisioning key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Manage keys, "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"can neither call models nor read accounts"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"Endpoints"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Base: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"https://tare.jamerly.ai/v1/integration"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"table","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"thead","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Path"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"th","properties":{},"children":[{"type":"text","value":"Purpose"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tbody","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/whoami"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Whose key this is, the current period, accessible resources"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/balance"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Balance, credit limit, available credit, cumulative top-ups and spend"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/transactions"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Transactions, paginated"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/statements"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Monthly statement list"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/statements/{period}"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"The statement for one period, e.g. "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"2026-07"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/usage/daily"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Daily usage, filterable by "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"apiKeyId"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/attribution"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Cost, request count, retry / tool-failure waste, "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"broken down by model and by stage"}]},{"type":"text","value":". Currently no filtering by "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"usage_label"}]},{"type":"text","value":", "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"task_id"}]},{"type":"text","value":", or "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"action_code"}]},{"type":"text","value":"; only the three parameters "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"from"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"to"}]},{"type":"text","value":" / "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"apiKeyId"}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"tr","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/reconciliation"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"td","properties":{},"children":[{"type":"text","value":"Differences between platform accounts and upstream bills"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"pre","properties":{},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"curl https://tare.jamerly.ai/v1/integration/balance \\\n  -H \"Authorization: Bearer $TARE_INTEGRATION_KEY\"\n"}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{"data-alert":"warning"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"This response wraps only one layer"}]},{"type":"text","value":" ("},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"response.data.balance"}]},{"type":"text","value":"). If you put another Java gateway in front and forward this path through it (instead of hitting "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"tare.jamerly.ai"}]},{"type":"text","value":" directly as above), the gateway adds its own envelope, making it two layers of nesting ("},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"response.data.data.balance"}]},{"type":"text","value":"). For how to tell which one you got, see "},{"type":"element","tagName":"a","properties":{"href":"errors"},"children":[{"type":"text","value":"Error codes"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"Granularity: balance is account-level, usage can be split by key"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/balance"}]},{"type":"text","value":" and "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/transactions"}]},{"type":"text","value":" are "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"account-level"}]},{"type":"text","value":"; all keys under the same account share one wallet."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"This is consistent with the role a key plays: "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"a key is a billing unit"}]},{"type":"text","value":", usage can be split by key, and the balance is shared. To limit a single key's spend, use the "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"limit"}]},{"type":"text","value":" of the "},{"type":"element","tagName":"a","properties":{"href":"provisioning"},"children":[{"type":"text","value":"Provisioning key"}]},{"type":"text","value":", which is a separate mechanism."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Splitting usage by key"}]},{"type":"text","value":": "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"/usage/daily?apiKeyId=…"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"Two limits"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"A single query window is capped at 100 days."}]},{"type":"text","value":" A year's reconciliation takes four pulls. Exceeding it returns a clear error rather than silently truncating — a scheduled job starting from "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"from=2020-01-01"}]},{"type":"text","value":" will fail clearly here, instead of getting data quietly cut short."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Rate limit 1200/minute"}]},{"type":"text","value":", counted separately from model traffic. Reconciliation often pages through hundreds of pages by day, by key, by model; the model-tier threshold "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"will 429 on first integration"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"Field stability"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The response fields of these endpoints are a "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"stability promise"}]},{"type":"text","value":" and won't be renamed by later implementation changes. If you need OpenAPI / JSON Schema descriptions, see the last section of "},{"type":"element","tagName":"a","properties":{"href":"endpoints"},"children":[{"type":"text","value":"Endpoint list"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h4","properties":{},"children":[{"type":"text","value":"Two prerequisites for reconciliation"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"The period is split by some time zone."}]},{"type":"text","value":" "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"2026-07"}]},{"type":"text","value":" is just a string; its starting instant isn't self-evident, so every response carries the time zone used for the split. If your side splits months by a different time zone, the usage on the last day of the month falls into a different month, the two sides never reconcile, and the difference is small enough to be mistaken for rounding error."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Late corrections count toward the next period."}]},{"type":"text","value":" A locked statement isn't rewritten. If your ERP expects \"when a correction arrives, last month's numbers change with it\", that won't happen. Look for the top-up line in the current period; it notes which month it came from."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{},"children":[{"type":"text","value":"Next steps"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Want to understand why statements lock and where top-ups come from: read "},{"type":"element","tagName":"a","properties":{"href":"statements"},"children":[{"type":"text","value":"Statements and invoices"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Want to figure out which costs land on you: read "},{"type":"element","tagName":"a","properties":{"href":"billing"},"children":[{"type":"text","value":"Billing rules"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Want to see all available endpoints: read "},{"type":"element","tagName":"a","properties":{"href":"endpoints"},"children":[{"type":"text","value":"Endpoint list"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"}]}]}