Documentation / Integrations / OpenAI
OpenAI connector
Connect an OpenAI organization API key so Meridian can pull spend and usage into spend_records for chargeback and reporting.
AvailableMethod: API
Overview
Connect an OpenAI organization API key so Meridian can pull spend and usage into spend_records for chargeback and reporting.
Data pulled
- Daily cost from the organization Costs API, grouped by line item, one row per model and line item type (for example input or output tokens)
- Token quantities where OpenAI reports them; request counts are not provided by this API (recorded as zero)
- Persisted as source_type=api_sync
What gets attributed
Meridian reads OpenAI's organization Costs API grouped by line item and stores one row per day for each model and line item type, such as input or output tokens. Project splitting is off until you ask for it.
Until a project is mapped, its spend arrives unattributed in the attribution inbox (Agents & allocation → Unattributed), where you can assign it to an agent or create a rule that matches on vendor or model.
Attributing spend by workspace or project
Project splitting is available on request. Contact support@onaro.io. We enable it with you and confirm your first month's split together. Dates before that cutover stay as a daily total.
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.
Authentication & credential storage
Meridian stores the following fields for this connector (values encrypted at rest):
api_key
- Credentials are encrypted with AES-256-GCM using a KMS-wrapped data encryption key (DEK) and stored in vendor_connections.credentials_encrypted.
- Meridian never returns the plaintext key after save. Revocation is disconnect: deactivate or delete the vendor connection — sync stops and the encrypted blob is no longer used.
- Use an organization Admin key with access to the Costs API. Billing access may require an org admin.
Sync schedule & behavior
Provider data freshness: OpenAI usage typically lags about ~24 hours. Syncs automatically every 6 hours; manual sync anytime. There is no per-connection frequency setting.
Setup steps
- Create an API key in the OpenAI platform dashboard.
- In Meridian → Vendors, select OpenAI, paste the key, and label the connection.
- Confirm the first sync creates spend_records, then rely on the 6-hour schedule or trigger a manual sync.
Troubleshooting
- 401/403: rotate the key and reconnect; permanent failures mark the connection errored without silent retries.
- Empty sync: confirm Costs API access and wait for the ~24h provider lag window.
- 429: Meridian retries transient errors with backoff; wait for the next schedule if the window was exhausted.
Related
- Open Agent Spend Attribution (OASA) Specification
- Glossary
- Integrations hub
- Meridian Vendors (connect / disconnect)
Onaro Meridian is FinOps for agentic AI: the system of record that attributes, controls and books what AI agents spend.