Stykite
  1. Checkpoint
Stykite
  • Introduction
    • What is Stykite?
    • Who should use Stykite?
    • When Stykite isn't the right fit?
    • Key Concepts
    • Pre-requisites: Account & API Keys
  • Getting Started
    • Setup your Tracking & Billing
    • Integrate Subscription Plans & Payments
    • Setup Payments
      • Configuring Razorpay Webhooks for Stykite
  • API Reference
    • Customer Facing Widgets
      • Pricing Widget Integration Guide
      • My Account Widget Integration
      • Subscribe Button
    • API Reference
      • Webhooks
        • Customer Subscription Status Update
        • Add-on Purchase Success
      • Usage
        • Send Usage
      • Customer
        • Create Customer with Auto Subscribe
        • Get Customer and Subscription Details
        • Update Customer Meter Entitlements
      • Subscription
        • Create Subscription
        • Cancel Subscription
        • Update Subscription
      • Checkpoint
        • Track Checkpoint Usage API
          POST
  • Learning Stykite
    • Subscriptions & Plans
    • Add-ons
    • Pricing Versions
    • Manual Subscriptions & Exclusive Plans
    • Invoices
    • Payments
    • Sales Tax
    • Customers
    • Transactions & Refunds
    • Settings
  1. Checkpoint

Track Checkpoint Usage API

POST
/v1/company/{companyId}/country/{countryId}/checkpoint/usage
Here’s your updated Track Checkpoint Usage API documentation with the new sample success response you provided included under the examples section:

Track Checkpoint Usage API#

Description#

This API endpoint allows you to record usage data at a specific checkpoint for a given customer. Useful for tracking token usage and session metadata in AI interactions.

Request Parameters#

Path Parameters:#

companyId (string, required): The unique identifier of the company.
Example: COM-0MBBRJ0HDSDJG
countryId (string, required): The unique identifier of the company.
Example: CON-0NBBRJ0HDS00G

Headers:#

Authorization (string, required): The authorization token in the format Bearer <your_token>.
Content-Type (string, required): The content type of the request, should be application/json.

Body Parameters:#

checkpoint_name (string, required): The name of the checkpoint to track (e.g., session-ended).
customer_identifier (string, required): The unique identifier of the customer (such as email or UUID).
provider (string, required): The AI service provider used (e.g., OPENAI, ANTHROPIC).
model (string, required): The AI model used (e.g., GPT_4, CLAUDE_3_OPUS).
input_token (integer, required): The number of tokens sent to the model.
output_token (integer, required): The number of tokens received from the model.

Request Example#


Response#

Success (200)#

Example 1 (Detailed usage tracking response)#

{
    "status": true,
    "value": {
        "tsid": "CHU-0N59AAHJES5JM",
        "checkpoint_tsid": "CHK-0M7EC3MNZFK1H",
        "customer_tsid": "CUS-0JESSN3EJ60QE",
        "company_tsid": "COM-0FNWT0H89QS36",
        "country_tsid": "CON-0AZZVPQHM475V",
        "plan_tsid": "PLV-0N597PXEV0AP5",
        "input_token": 100,
        "output_token": 200,
        "provider": "OPENAI",
        "model": "GPT_4",
        "input_token_cost": 0.001,
        "output_token_cost": 0.004,
        "credits": 5.0,
        "usage_time": 1759645809044,
        "created_at": 1759645809051,
        "updated_at": 1759645809051,
        "meter_entitlements": [
            {
                "entitlement": 1990,
                "meter_tsid": "MTR-0MB8WXFSD5YVW"
            },
            {
                "entitlement": 990,
                "meter_tsid": "MTR-0MB95BFFX5MY2"
            }
        ]
    }
}

Error Responses#

Unauthorized (401)#

{
    "success": false,
    "message": "Unauthorized access. Invalid token."
}

Bad Request (400)#

{
    "success": false,
    "message": "Invalid request parameters."
}

Not Found (404)#

{
    "success": false,
    "message": "Company not found."
}

Notes#

Use meaningful checkpoint_name values to categorize different stages (e.g., session-started, session-ended, etc.).
Ensure that input_token and output_token are integers.
You can use extra_params to include trace IDs, prompt categories, or other internal metadata.
Authentication is required using a valid Bearer token.

Contact#

For any issues, contact support at support@stykite.com.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params

Header Params

Body Params text/plain
Example
Example:{ "checkpoint_name": "session-ended", "customer_identifier": "onkar@stykite.com", "provider": "OPENAI", "model": "GPT_4", "input_token": 100, "output_token": 200 }

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sandbox.api.stykite.com/v1/company//country//checkpoint/usage' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "checkpoint_name": "session-ended",
    "customer_identifier": "onkar@stykite.com",
    "provider": "OPENAI",
    "model": "GPT_4",
    "input_token": 100,
    "output_token": 200
}'

Responses

🟢200Success
application/json
Body

Example
{}
Modified at 2025-12-23 05:00:05
Previous
Update Subscription
Next
Subscriptions & Plans
Built with