Skip to main content

OpenAI Integration

Connect OpenAI to bring your OpenAI API usage and spend into Cloud ex Machina, next to your cloud infrastructure costs.

Two connection types exist. Only one of them gives billing and usage data:

Integration name in CxMKey typeBilling and usage data
OpenAI (Admin)Admin key, read onlyYes: Usage API (tokens per project, model and key), Costs API (spend per line item), and Administration API (projects, users, service accounts, API keys and rate limits)
OpenAIProject API keyNo

OpenAI (Admin)​

Prerequisites​

  • Cloud ex Machina Admin access.
  • The Owner role in your OpenAI organization. Only organization owners can create Admin keys.

Step 1: Create a read-only Admin key​

Read only

Select Read only for the key permissions. Cloud ex Machina needs no write access.

  1. Sign in to platform.openai.com.
  2. Open the Admin keys page of your organization settings: platform.openai.com/settings/organization/admin-keys.
  3. Create a new admin key and name it Cloud ex Machina.
  4. In Permissions, select Read only.
  5. Copy the key. OpenAI shows the key only once.

An Admin key gives no access to models or to model inference.

Step 2: Add the connection in Cloud ex Machina​

  1. In the sidebar, click Integrations.
  2. Find OpenAI (Admin) and click Sign in. If the integration already has a connection, the button is Add connection.
  3. Fill in Admin Key with the key from Step 1.
  4. Submit the form. Cloud ex Machina checks the key with OpenAI and saves the connection.

OpenAI (project key)​

This connection uses a key from one OpenAI project. It gives no billing and no usage data. For spend, use OpenAI (Admin) above.

Prerequisites​

  • Cloud ex Machina Admin access.
  • The Owner role on the OpenAI project, or a project role that can create API keys and read models. A key cannot have more permissions than the role of the person who creates it.

Step 1: Create a restricted project key​

  1. Sign in to platform.openai.com and select the project.
  2. Go to API keys and click Create new secret key.
  3. Name the key Cloud ex Machina.
  4. In Permissions, select Restricted. Set Models to Read. Leave every other permission at None.
  5. Copy the key. OpenAI shows the key only once.

Step 2: Add the connection in Cloud ex Machina​

  1. In the sidebar, click Integrations.
  2. Find OpenAI and click Sign in. If the integration already has a connection, the button is Add connection.
  3. Fill in API Key with the key from Step 1.
  4. Submit the form. Cloud ex Machina checks the key with OpenAI and saves the connection.

Remove a connection​

To remove a connection:

  1. Click the connection row under its card.
  2. Click Disconnect.
  3. Delete the key in OpenAI.

Next Steps​