Track Checkpoint Usage API
Run in Apidog
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
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.
Request Provide your bearer token in the Authorization
header when making requests to protected resources. Example: Authorization: Bearer ********************
Example: {
"checkpoint_name": "session-ended",
"customer_identifier": "onkar@stykite.com",
"provider": "OPENAI",
"model": "GPT_4",
"input_token": 100,
"output_token": 200
}
Request Code Samples
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 application/json Generate Code
Modified at 2025-12-23 05:00:05