Documentation / Attribution / OpenAI

OpenAI

Available

Connection steps are in the OpenAI connector guide. This page is only attribution. Use an Admin key, as that guide describes.

What you set up

  1. Connect OpenAI with the connector guide.
  2. Give each agent its own project, or its own API key inside a project. Keys belong to a project. (Costs)
  3. Ask Onaro to turn on project splitting. During Early access a platform admin does this with you. Write to support@onaro.io. Source identities shows the cutover date and whether key grouping is on. It does not include a switch.
  4. Key grouping is a second step, also on request, and only after project splitting is on. It has its own cutover, on or after the project cutover.
  5. Map each project, and each key if key grouping is on, to an agent and a department. Create the agents under Agents & allocation and the departments under Governance first.

The cutover is the first UTC date written at the finer grain. Earlier dates stay one row per day and line item. A re-sync keeps that shape. A date is never stored at two grains. If you already have OpenAI rows, the cutover is tomorrow, or the day after a locked month that would contain tomorrow. If you have no OpenAI rows yet, the first pull, about 30 days, is split from the start, except locked days, which are skipped.

Dates from the project cutover up to the key cutover are split by project only. On and after the key cutover they are split by project and by API key. The value stored is the key id, never the secret.

What Meridian receives

Meridian calls the Admin Costs API, one-day buckets. (Costs) This is the costs method, not the usage method.

While splitting is off, and before the cutover, Meridian stores one charge per UTC day and line item. Token quantities are stored when that cost line reports them.

On and after the project cutover, each row is one day, one line item, and one project. On and after the key cutover, the API key id is on the row as well.

A result with no project id, on a request that grouped by project, is kept. Dropping it would shrink the total. Meridian shows that bucket as No project.

How it's attributed

Lookup uses the finer identity first, and only for dates where that grouping is on.

  1. An active API-key mapping, when the row has a key id.
  2. Otherwise an active project mapping, when the row has a project.
  3. Otherwise the row stays unattributed.

No project is never given another project's mapping. A mapped project or key is mapped by you. A rule does not replace it. A person can replace a mapped row from the inbox. A person cannot replace a declared or inherited row.

A key that is not mapped, on a project that is mapped, does not go to the inbox. The spend follows the project. The key still shows as unmapped on Source identities, so you can map it later. That later mapping does not rewrite rows already stamped.

If gateway or OASA events for the same model and day are also coming in, Meridian scales the event rows that have no pool id to this bill so the dollars are not counted twice. Line-item names and model names have to match for that tie-out. When they differ, Meridian leaves the rows side by side. A pool id stays at the measured amount.

What lands unattributed, and how to fix it

While splitting is off, each day and line item is unattributed. Assign it, or add a rule for the vendor or the model. Those past dates stay combined.

After the cutover, the inbox shows one of these:

  • "This OpenAI project is not mapped to an agent or department." Map the project.
  • "This OpenAI API key is not mapped to an agent or department." This is used when key grouping is on, the key is present, and neither the key nor the project is mapped. Map the key or the project.
  • "Organization-level spend, including Scale Tier. Project grouping does not split this." The identity is No project.

Project grouping splits pay-as-you-go spend by OpenAI project. Scale Tier bundle cost is billed to the organization, not to projects, so it stays in No project spend. Mapping No project assigns that whole bundle. It does not divide the bundle across projects. (Reviewing API usage and costs)

A project can show usage and zero project spend when that usage sits inside the organization's Scale Tier allocation. The dollars are in No project, not missing.

Saving a mapping applies it to unlocked unattributed rows. A locked month becomes an adjustment on a later draft.

Limits

  • Organization member ids are not a group Meridian requests on the Costs API. The Costs API can group by user, and combining that with project can return an error. Meridian does not send it. The id is a person, not an agent. (Costs)
  • The request fields user, safety_identifier, and metadata are not cost groups. They do not reach this bill. (Safety identifiers)
  • One project or one key shared by many agents cannot be split further from the Costs API.
  • There is no cost-allocation tag on this API, and no FOCUS-style export of the API invoice documented for this pull.
  • Once a cutover is recorded, splitting cannot be turned off.
  • While splitting is off, a re-sync can refresh the amount on a locked date. The locked chargeback file is not rewritten. Once splitting is on, sync skips dates inside a locked month.

Status

  • OpenAI is Available in the integrations catalog.