Stykite
  1. Checkpoint
Stykite
  • Introduction
  • Pre-requisites: Account & API Keys
  • Integration
    • Self-Serve Integration on your SaaS/AI App
    • Usage-Based Billing
    • 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
      • 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}/checkpoint/usage

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

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.
session_id (string, optional): The unique session identifier.
extra_params (object, optional): Any additional custom metadata as key-value pairs.

Request Example#

Response#

Success (200)#

{
    "success": true,
    "message": "Checkpoint usage recorded successfully."
}

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, "session_id": "1234", "extra_params": { "key1": "value1" } }

Request 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//checkpoint/usage' \
--header 'Authorization: Bearer ' \
--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,
    "session_id": "1234",
    "extra_params": {
        "key1": "value1"
    }
}'

Responses

🟢200Success
application/json
Body

Example
{}
Modified at 2025-08-02 16:48:05
Previous
Update Subscription
Next
Subscriptions & Plans
Built with