> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pelanor.io/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI

> Import OpenAI billing data into Pelanor to see AI-related spend alongside the rest of your cloud bill.

## Integration Basics

* **One integration per OpenAI organisation** – each org ID needs its own connector
* New uploads for a month **replace** any previous data for that month
* Data appears in Pelanor within **≈ 12 hours** of upload

## Integration Methods

1. **In-Platform Integration** – *coming soon*
2. **API Integration** – programmatic uploads\
   [API Docs (US Environment)](https://app.pelanor.io/api-docs) | [API Docs (EU Environment)](https://app-eu.pelanor.io/api-docs)

***

## Exporting OpenAI Usage Data

<Steps>
  <Step title="Log in to OpenAI">
    Use the organisation you want to integrate.
  </Step>

  <Step title="Navigate to Usage">
    Go to **Usage** from the side navigation.
  </Step>

  <Step title="Select billing range">
    Pick the date range for the billing month.
  </Step>

  <Step title="Click Export">
    Use the **Export** button in the top-right.
  </Step>

  <Step title="Configure export modal">
    * Tab: **Cost data** (not *Activity data*)
    * **Group by** → Line Item
    * **File format** → CSV
    * Confirm **Start / End dates**
    * **Time interval** → 1 day
  </Step>

  <Step title="Download">
    Click **Download** and save the file unmodified.
  </Step>
</Steps>

<Warning>
  Use the CSV <strong>exactly</strong> as downloaded from OpenAI.\
  Any structure/content changes will cause the import to fail.
</Warning>

***

## Required Data Fields

| Field Name          | Description                   | Format / Example               |
| ------------------- | ----------------------------- | ------------------------------ |
| `start_time`        | Beginning of the usage period | Unix timestamp `1716153600`    |
| `end_time`          | End of the usage period       | Unix timestamp                 |
| `amount_value`      | Cost of the usage             | Float                          |
| `amount_currency`   | Currency code                 | Currently only `USD` supported |
| `line_item`         | Service description           | `"gpt-4o-2024-08-06, input"`   |
| `project_id`        | Project identifier            | String                         |
| `organization_id`   | Organisation identifier       | String                         |
| `project_name`      | Project name                  | String                         |
| `organization_name` | Organisation name             | String                         |

***

## Validation & Processing

Pelanor verifies:

* `organization_id` matches the integration settings
* Required fields are present and correctly formatted
* Processing completes within \~12 hours

***

## Troubleshooting

| Issue                   | What to Check                                                     |
| ----------------------- | ----------------------------------------------------------------- |
| **Data not appearing**  | Was the file uploaded successfully? Is `organization_id` correct? |
| **Upload errors**       | Was **Cost data** exported (not *Activity data*)?                 |
| **Format issues**       | Is the uploaded file the **unmodified** CSV from OpenAI?          |
| **Date-range problems** | Does the file cover the **entire billing month**?                 |

***

## After Integration

* Compare OpenAI spend to other cloud costs
* Track efficiency using **Unit Cost Analysis**
* Build dashboards with OpenAI metrics
* Set alerts for spending anomalies
