# GPTBoost Props

Apart from the HEADERS used to omit logging GPTBoost offers additional custom properties that you can include in the HEADERS to add more data to the logs. Tracking of such supplementary details allows seamless user and thread management.

**Include any custom property that will benefit your work. Just remember to incorporate them in the HEADERS with GPTBoost-prefix and they'll be added to your OpenAI request ;).**&#x20;

**Utilizing  Properties:**

* The Key follows the format **GPTBoost-Prop-{PropertyName}**, where you replace {Name} with your chosen property name.
* The Value represents the string value associated with the property in the request.

  ####

{% tabs %}
{% tab title="Python" %}

```python
# 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)

```

{% endtab %}

{% tab title="cURL" %}

```powershell
curl --request 'https://turbo.gptboost.io/v1/chat/completions' \
--header 'Authorization: Bearer $OPENAI_API_KEY' \
--header 'GPTBoost-Prop-Plan: free' \
--header 'GPTBoost-Prop-IP: 1.1.1.1' \
--header 'GPTBoost-Prop-Session: session_id' \
--header 'GPTBoost-Prop-User: user_id' \
--header 'Content-Type: application/json' \
--data '{
    "model": "gpt-3.5-turbo",
    "messages": [
        {
            "role": "user",
            "content": "Tell me an interesting fact about Oman!"
        }
    ]
}'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
// This code is for v4+ of the openai package: npmjs.com/package/openai
import OpenAI from 'openai';

// Custom Headers
const headers = {
  "GPTBoost-Prop-Plan": "free",
  "GPTBoost-Prop-Ip": "1.1.1.1",
  "GPTBoost-Prop-Session": "session_id",
  "GPTBoost-Prop-User": "user_id",

}

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: "https://turbo.gptboost.io/v1",
  defaultHeaders: headers
})

async function ask_gpt(){ 

  const response = await openai.chat.completions.create({
      model: "gpt-3.5-turbo-16k",
      messages: [{ role: "user", content: "Who won the World Cup series 2020" }],
      
  });
  console.log(response.choices[0].message.content)
}

ask_gpt()



```

{% endtab %}
{% endtabs %}

#### &#x20;Properties Example Usage:

* **GPTBoost-Prop-User -** Collecting data for a specific user by adding its Id to the request allows you to track individual users' preferences, behaviours, and trends. Say goodbye to generic insights: now you can serve personalized experiences and understand user journeys like never before.
* **GPTBoost-Prop-Session -** Adding the Session-Id helps you group related requests together, creating a coherent storyline. This is a game-changer when it comes to analyzing multi-step interactions or complex dialogues. For instance, you can evaluate the effectiveness of a chatbot's guidance throughout a session, identify key turning points, and assess user satisfaction based on how sessions are structured.
* **GPTBoost-Prop-Plan -** Knowing a user's plan level (e.g., free, basic, premium) allows you to correlate user behaviour with their subscription tier, helping you understand the value users derive from different plans. For instance, you can analyze the cost-effectiveness of each plan, optimize feature offerings, and even predict user churn by identifying patterns among subscription levels.
* **GPTBoost-Prop-Ip -** By capturing unique IP addresses tied to each user's device or network, you gain valuable insights. Discover where your users are located, ensuring tailored responses based on their geographical context. Improve security by detecting unauthorized access through unusual IP patterns.

By harnessing the magic of GPTBoost custom properties, your data analysis transforms into a dynamic adventure. You can uncover personalized insights, enhance user experiences, and make data-driven decisions that propel your LLM-powered application to new heights! 🚀


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gptboost.io/advanced/gptboost-props.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
