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.

Status: Available · Claim C-18

Overview

Connect an OpenAI organization API key so Meridian can pull spend and usage into spend_records for chargeback and reporting.

Data pulled

  • Daily spend (cost) and usage (tokens, requests) by model
  • Persisted as source_type=api_sync

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 key with access to the Usage 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

  1. Create an API key in the OpenAI platform dashboard.
  2. In Meridian → Vendors, select OpenAI, paste the key, and label the connection.
  3. 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 Usage 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