Namespaces
Organizing Requests
Use Namespaces
# 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 = {
"GPTBoost-Namespace": "development"
}
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "user", "content": "Tell me an interesting fact about pandas"},
],
extra_headers=headers
)
print(response.choices[0].message.content)curl --location 'https://turbo.gptboost.io/v1/chat/completions' \
--header 'Authorization: Bearer $OPENAI_API_KEY' \
--header 'Content-Type: application/json' \
--header 'GPTBoost-Namespace: staging' \
--data '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "Tell me an interesting fact about koalas!"
}
]
}'Vizualization in GPTBoost
Use Cases



Last updated