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 CxM | Key type | Billing and usage data |
|---|---|---|
| OpenAI (Admin) | Admin key, read only | Yes: 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) |
| OpenAI | Project API key | No |
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.
- Sign in to platform.openai.com.
- Open the Admin keys page of your organization settings: platform.openai.com/settings/organization/admin-keys.
- Create a new admin key and name it
Cloud ex Machina. - In Permissions, select Read only.
- 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
- In the sidebar, click Integrations.
- Find OpenAI (Admin) and click Sign in. If the integration already has a connection, the button is Add connection.
- Fill in Admin Key with the key from Step 1.
- 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
- Sign in to platform.openai.com and select the project.
- Go to API keys and click Create new secret key.
- Name the key
Cloud ex Machina. - In Permissions, select Restricted. Set Models to Read. Leave every other permission at None.
- Copy the key. OpenAI shows the key only once.
Step 2: Add the connection in Cloud ex Machina
- In the sidebar, click Integrations.
- Find OpenAI and click Sign in. If the integration already has a connection, the button is Add connection.
- Fill in API Key with the key from Step 1.
- Submit the form. Cloud ex Machina checks the key with OpenAI and saves the connection.
Remove a connection
To remove a connection:
- Click the connection row under its card.
- Click Disconnect.
- Delete the key in OpenAI.
Next Steps
- See all available integrations in the Integrations Overview.