Manually track analytics

So you're ready to start tracking analytics & usage for your AI product!

This quickstart is if you do NOT want to use the OpenAI wrapper SDKs. For example, if you are using another LLM provider (like Anthropic) or are using a custom implementation OpenAI SDK implementation (like our OpenAI load balancer)

Get API key

Sign up for an account and get your API key at

Install package

If Python, install our Python package

pip install spryngtime_analytics_sdk_python_sdk

If Node.js, install our Node.js package

npm i test_spryngtime_sdk

Track with one line of code!

Track token usage with a simple line of code


const {SpryngtimeAnalyticsSdk} = require("test_spryngtime_sdk");

const spryngtimeanalyticssdk = new SpryngtimeAnalyticsSdk({
    apiKey: "apiKey123",

const chatCompletion = await{
    messages: [{ role: 'user', content: 'what is 2+45' }],
    model: 'gpt-3.5-turbo',

// Replace `key` with the customer/company that you want to associate the usage with
// For example, if the chatCompletion is for `companyA`, then I'll track the usage against `companyA`
const trackUsageResponse =
    await spryngtimeanalyticssdk.usageTracking.trackUsage({
        key: "companyA",

Python code:

from spryngtime_analytics_sdk import SpryngtimeAnalyticsSdk

spryngtimeanalyticssdk = SpryngtimeAnalyticsSdk(

openAICompletion =
  messages=[[{ role: 'user', content: 'what is 2+45' }]]


Last updated