π£οΈCustomer & Subscriber Management
Term
Usage
Integration Parameter
Example API Call Incorporating Customer Data
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
import openai
import revenium_middleware_openai
# Ensure REVENIUM_METERING_API_KEY & OPENAI_API_KEY are set in your .env file
response = openai.chat.completions.create(
model="gpt-4o-mini",
messages=[
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Please verify you are ready to assist me."
},
],
max_tokens=500,
usage_metadata={
"subscriber": {
"id": "1473847563",
"email": "[email protected]",
"credential": {
"name": "Engineering API Key",
"value": "hak-abc123456"
}
},
"organization_id": "Finoptic Labs",
"subscription_id": "sub_gold_1234567890",
},
)
print(response.choices[0].message.content)Last updated
Was this helpful?