The Nebuly SDK enables you to monitor all the requests made to:

Both of them are supported also when using stream or async modes.

Chat Models

  • Python

import nebuly

nebuly.init(api_key="<YOUR_NEBULY_API_KEY>")

from openai import OpenAI

client = OpenAI(api_key="<YOUR_OPENAI_API_KEY>")

completion = client.chat.completions.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who is the president of the United States of America?"}
    ],
    # ... other optional openai kwargs
    # Nebuly additional kwargs
    user_id="<YOUR_USER_ID>",
)

You can find a detailed explanation of the allowed nebuly additional keyword arguments below:

user_id
string
required

An id or username uniquely identifying the end-user. We recommend hashing their username or email address, in order to avoid sending us any identifying information.

nebuly_tags
dict

Tag user interactions by adding key-value pairs using this parameter. Each key represents the tag name, and the corresponding value is the tag value.

For example, if you want to tag an interaction with the model version used to reply to user input, provide it as an argument for nebuly_tags, e.g. {"version": "v1.0.0"}. You have the flexibility to define custom tags, making them available as potential filters on the Nebuly platform.

nebuly_api_key
string

You can use this field to temporarily override the Nebuly API key for the selected model call. The interaction will be stored in the project associated with the provided API key.

Completion Models

  • Python

import nebuly

nebuly.init(api_key="<YOUR_NEBULY_API_KEY>")

from openai import OpenAI
client = OpenAI(api_key="<YOUR_OPENAI_API_KEY>")

completion = client.completions.create(
    model="gpt-3.5-turbo-instruct",
    prompt="Who is the president of the United States of America?",
    # ... other optional openai kwargs
    # Nebuly additional kwargs
    user_id="<YOUR_USER_ID>",
)

You can find a detailed explanation of the allowed nebuly additional keyword arguments below:

user_id
string
required

An id or username uniquely identifying the end-user. We recommend hashing their username or email address, in order to avoid sending us any identifying information.

nebuly_tags
dict

Tag user interactions by adding key-value pairs using this parameter. Each key represents the tag name, and the corresponding value is the tag value.

For example, if you want to tag an interaction with the model version used to reply to user input, provide it as an argument for nebuly_tags, e.g. {"version": "v1.0.0"}. You have the flexibility to define custom tags, making them available as potential filters on the Nebuly platform.

nebuly_api_key
string

You can use this field to temporarily override the Nebuly API key for the selected model call. The interaction will be stored in the project associated with the provided API key.