Omit Logging
Exploring the Power of Optional Headers
Usage
# 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"),
)
# headers are optional
headers = {
"GPTBoost-Request-Logging": "false", # default is true, set to false to disable logging
"GPTBoost-Response-Logging": "false" # default is true, set to false to disable logging
}
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Tell me an interesting fact about Health Insurance"},
],
extra_headers=headers
)
print(response.choices[0].message.content)Visualization

Last updated