OpenAI AI Consumption integration

Use the OpenAI AI Consumption integration to collect OpenAI API Platform usage and cost data and load it into AI Usage Data in Yarken.

Yarken deploys and maintains the Advanced Integration for your environment. Your organization creates the required OpenAI Admin API key, authorizes the Advanced Connection, and monitors the resulting data.


Current scope

This integration currently supports usage and cost data from your OpenAI API Platform organization.

ChatGPT Enterprise/Workspace usage is a separate OpenAI data source and is not currently available through the active Yarken integration. Missing ChatGPT workspace usage does not indicate that the OpenAI API Platform integration failed.


What the integration provides

The integration retrieves supported OpenAI API Platform usage and cost data for reporting and analysis in Yarken.

  • OpenAI usage cost.

  • Input token usage.

  • Output token usage.

  • Cached token usage, where OpenAI provides it.

  • Project or sub-account information, where available.

  • User or service-account attribution, where available.

  • Daily usage information.


Where the data appears

After ingestion:

  • Review the imported OpenAI usage data in Designer > Consumption > AI.

  • Use Analytics > AI Consumption for reporting and analysis.


Roles and responsibilities

Activity

Responsibility

Deploy and maintain the Advanced Integration

Yarken

Maintain connector logic and data transformation

Yarken

Create and maintain the OpenAI Admin API key

OpenAI API Platform Organization Owner

Authorize the OpenAI connection in Yarken

Yarken administrator

Run and monitor the Advanced pipeline

Admin or Cost Model Manager

Review imported AI Consumption data

FinOps and reporting users


Before you begin

Requirement

Details

OpenAI API Platform organization

Identify the API Platform organization whose usage and spend you want to report.

Organization Owner access

Only an API Platform Organization Owner can create the Admin API key required by this integration.

Admin API key

Create the key in the same API Platform organization whose usage and cost data you want to retrieve. The key must begin with sk-admin-.

Permissions

Use Read only permissions. If your organization requires narrower access, use Restricted with read access to the Usage API and Organization Administration.

Yarken access

You need a Yarken administrator account to authorize the OpenAI Advanced Connection.

Secure secret storage

Store the Admin API key in an organization-approved secrets manager.

Do not use a project API key beginning with sk-proj- or a ChatGPT workspace Admin key. These credentials do not provide access to the API Platform organization usage and cost endpoints.


Create the OpenAI Admin API key

Complete these steps as an OpenAI API Platform Organization Owner:

  1. Sign in to platform.openai.com.

  2. Go to Organization settings > Admin keys.

  3. Select + Create new admin key.

  4. Enter a descriptive name for the key.

  5. Set Permissions to Read only.

  6. If your organization requires restricted access, set the required Usage API and Organization Administration permissions to read access.

  7. Select Create admin key.

  8. Copy the secret immediately and store it securely.

The Admin API key is displayed only once and begins with sk-admin-.

Every time you create an Admin API key, OpenAI creates a separate credential. Revoke unsuccessful, duplicate, or obsolete keys so you can clearly identify the active key.


Optional: Verify the Admin API key

You can verify the credential before configuring Yarken.

Bash
curl -i "https://api.openai.com/v1/organization/usage/completions?start_time=<UNIX_SECONDS>&bucket_width=1d&limit=1" \
  -H "Authorization: Bearer <YOUR_ADMIN_KEY>" \
  -H "Content-Type: application/json"

An HTTP 200 response confirms that the Admin API key can access the organization usage endpoint. The key uses an Authorization: Bearer header.


Authorize the OpenAI connection

  1. Sign in to Yarken as an administrator.

  2. Go to Admin > Pipelines > Connections.

  3. Select the ADVANCED tab.

  4. Open the OpenAI connection.

  5. Complete the required connection fields.

    image-20261003-180427.png
    OpenAI Advanced Connection
  6. Select Connect.

  7. Confirm that the connection status changes to Connected.

Field

Requirement

Value or guidance

Base URI

Required

Default: https://api.openai.com. Use another value only when Yarken instructs you to do so.

Admin API key

Required

Enter the API Platform organization Admin API key. It must begin with sk-admin-.

Billing account ID override

Optional

Leave blank to use the organization_id returned by the OpenAI costs API. Enter a value only when you need to override it.

Billing account name override

Optional

Leave blank to use the organization_name returned by the OpenAI costs API. Enter a value only when you need to override it.

Usage pool / plan type

Optional

Enter your usage pool or plan type when required for reporting, for example Pay-as-you-go or Prepaid. OpenAI does not provide this value through the API.

Collector source

Configured

The connection displays OpenAI Admin API. The configured value is written to collector_source on the resulting records.

OpenAI Advanced Connection

For the general authorization workflow, see Authorize Advanced Connections.


How the integration works

The OpenAI Advanced Integration uses the API Platform organization Admin API key to retrieve supported OpenAI usage and cost data. You do not configure the underlying API requests or transformation logic.

  1. OpenAI API Platform provides organization usage and cost information.

  2. The OpenAI Advanced Connection authorizes Yarken using the Admin API key.

  3. The Yarken-managed Advanced Integration retrieves and processes the supported records.

  4. The Advanced pipeline runs the integration and records execution activity.

  5. AI Usage Data stores the normalized usage and cost records.

  6. Analytics > AI Consumption provides reporting and analysis.


Data collected

Data

Behavior

Cost

OpenAI usage cost where returned by the source.

Input tokens

Input token consumption for supported API usage.

Output tokens

Output token consumption for supported API usage.

Cached tokens

Cached token usage where OpenAI provides it.

Provider

OpenAI.

Project or sub-account

Project or sub-account information where available.

User or service account

Attribution where OpenAI provides enough source information.

Usage period

Source usage can be reported at daily granularity.


Billing account overrides

Normally, Yarken uses the organization details returned by the OpenAI costs API.

Use Billing account ID override or Billing account name override only when you intentionally want a different reporting value. Leave the fields blank to use the organization ID and organization name returned by OpenAI.


Usage pool / plan type

OpenAI does not provide the usage pool or plan type through the API used by this connection.

If required for reporting, enter the value manually in Usage pool / plan type, for example Pay-as-you-go or Prepaid.


Important data interpretation guidance

API Platform and ChatGPT Enterprise are separate

The OpenAI API Platform feed and ChatGPT Enterprise/Workspace usage are separate data sources.

The Admin API key configured on this page retrieves API Platform organization usage and cost data. It does not retrieve ChatGPT Enterprise/Workspace seat or workspace activity.

Service-account attribution

Some OpenAI usage can be generated by non-human service accounts. In those cases, usage and cost may not map cleanly to a named user.

Review the available project, sub-account, and service-account information when performing user-level allocation or chargeback.


Run and monitor the Advanced pipeline

After the OpenAI connection shows Connected:

  1. Go to Admin > Pipelines > Pipelines.

  2. Select the ADVANCED tab.

  3. Locate the OpenAI pipeline.

  4. Select Run when you need an immediate execution, or keep recurring execution active as configured for your environment.

  5. Open the pipeline to review the latest status and run history.

See Manage Advanced pipelines for the common pipeline controls.


Validate the integration

After the first successful run:

  • Confirm the OpenAI connection shows Connected.

  • Confirm the Admin API key begins with sk-admin-.

  • Confirm the key belongs to the API Platform organization whose spend you expect to report.

  • Confirm the Advanced pipeline completed successfully.

  • Review the imported data in Designer > Consumption > AI.

  • Confirm expected OpenAI costs and token usage appear in Analytics > AI Consumption.

  • Review project, sub-account, user, and service-account attribution where expected.

  • Confirm billing account overrides are populated only when you intentionally configured them.


Current limitations

ChatGPT Enterprise/Workspace usage

The current OpenAI Advanced Integration collects usage and cost data from the OpenAI API Platform organization.

ChatGPT Enterprise/Workspace usage is provided through a separate OpenAI data source and requires different credentials. It is not currently available through the active Yarken integration.

  • ChatGPT Enterprise seat and workspace activity does not appear in the API Platform data collected by this integration.

  • Missing ChatGPT workspace activity does not indicate an API Platform ingestion failure.

  • Do not replace a working sk-admin- API Platform key in an attempt to retrieve ChatGPT Enterprise/Workspace usage.


Troubleshooting

Issue

Likely cause

What to do

Connection remains Access requested

The connection has not been authorized successfully.

Verify the required fields and select Connect.

Admin API key is rejected

The credential is not an API Platform organization Admin API key.

Confirm the key was created in Organization settings > Admin keys and begins with sk-admin-.

401 response

Project key, ChatGPT workspace Admin key, incomplete secret, or revoked key.

Confirm the key type and prefix. Re-copy the full secret or create a replacement if the key was revoked.

403 response

A Restricted Admin API key does not have the required Usage API permission.

Create or replace the key with Read only permissions, or grant the required read scopes.

Usage or cost data is missing

The key belongs to a different API Platform organization.

Confirm the key was created in the organization whose usage and spend you want to retrieve.

ChatGPT Enterprise/Workspace usage is missing

ChatGPT workspace usage uses a separate OpenAI data source and credential.

Do not replace a valid API Platform Admin API key. ChatGPT Enterprise/Workspace usage is not currently available through the active Yarken integration.

Cost cannot be attributed to a named user

Usage was generated by a service account or another non-human identity.

Review the available project, sub-account, and service-account information before allocating the cost.


Security and credential management

  • Store the Admin API key in an approved secrets manager.

  • Do not expose the full key in screenshots, documentation, email, chat, support tickets, or source code.

  • Revoke unsuccessful, duplicate, or obsolete Admin API keys.

  • Rotate the key according to your organization's security policy.

  • After replacing the key, update the OpenAI Advanced Connection and confirm that it returns to Connected.

  • Run the OpenAI Advanced pipeline after credential rotation to validate the integration.


Related content