Skip to main content

OpenAI Integration

This guide describes how you can integrate OpenAI with BricksAI to gain fine-grained monitoring and access control over your OpenAI calls.

Step 1. Add your OpenAI API key

Go to the Settings page. Under "LLM providers", click "Add provider", select "OpenAI", fill in all information, then click "Add".

Step 2. Create a proxy secret key

To create a proxy secret key, go to the Secret keys page. Click "Create a new secret key", fill in all information, then click "Create".

Step 3. Make a call to OpenAI via BricksAI

Here is a list of all currently supported OpenAI API endpoints.

Below are sample code snippets for calling OpenAI with BricksAI:

from openai import OpenAI

client = OpenAI(
api_key="your-bricks-secret-key",
base_url="https://api.trybricks.ai/api/providers/openai/v1",
)

# Call OpenAI as normal...