GPTBoost Props
Enhance log records with custom properties
# This example is for v1+ of the openai: https://pypi.org/project/openai/
from openai import OpenAI
client = OpenAI(
base_url = "https://turbo.gptboost.io/v1",
api_key = os.getenv("OPENAI_API_KEY"),
)
# Custom Headers
headers = {
"GPTBoost-Prop-Plan": "free",
"GPTBoost-Prop-IP": "1.1.1.1",
"GPTBoost-Prop-Session": "session_id",
"GPTBoost-Prop-User": "user_id"
}
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Tell me a joke about GPTBoost"},
],
extra_headers=headers
)
print(response.choices[0].message.content)
Properties Example Usage:
Last updated