API Reference
Complete REST API documentation for Classy Comments
Authentication
API requests require an API key. Pass it in the request body as apiKey.
curl https://api.classycomments.com/api/classify \
-H "Content-Type: application/json" \
-d '{"originalText": "THIS IS GREAT!!!", "apiKey": "cc_live_sk_your_api_key_here"}'API Key Format
cc_live_sk_*- Production API keyscc_demo_sk_*- Demo API keys (limited features)
Base URL
https://api.classycomments.comRate Limits
| Endpoint | Limit |
|---|---|
| General endpoints | 100 requests per 15 minutes |
| Classification endpoint | 20 requests per minute |
| Authentication endpoints | 5 requests per 15 minutes |
Refine Comment
POST /api/classifyRefine a comment using AI. Returns the original and refined text.
Config comes from your dashboard
Refinement settings (formality, tone, etc.) are configured in your dashboard. The API automatically uses your saved settings based on your API key.
Request Body
{
"originalText": "THIS IS AWESOME!!! ur plugin is the best",
"apiKey": "cc_live_sk_your_api_key_here"
}Response
{
"success": true,
"originalText": "THIS IS AWESOME!!! ur plugin is the best",
"refinedText": "This is awesome! Your plugin is the best.",
"processingTimeMs": 1234,
"provider": "openai",
"changeScore": 0.42
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| originalText | string | Yes | Comment text to refine |
| apiKey | string | Yes | Your API key from the dashboard |
| aiProviderOverride | string | No | Override AI provider: "openai", "anthropic", or "ollama" |
| isHTML | boolean | No | Set to true if originalText contains HTML |
Get Statistics
GET /api/users/me/clients/:clientId/statsRetrieve usage statistics for your client account.
Response
{
"totalComments": 1234,
"monthlyUsage": 456,
"quota": 1000,
"quotaRemaining": 544,
"domains": 3,
"apiKeys": 2
}Error Codes
| Code | Description |
|---|---|
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Quota exceeded or domain not allowed |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Error Response Format
{
"success": false,
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}JavaScript Client
For client-side integration, use the @classy-comments/core package:
npm install @classy-comments/core
import { ClassyComments } from '@classy-comments/core'
import '@classy-comments/core/styles.css'
const classy = new ClassyComments({
apiBaseUrl: 'https://api.classycomments.com',
apiKey: 'cc_live_sk_your_api_key',
formalityLevel: 3,
tone: 'friendly',
profanityHandling: 'soften',
emojiHandling: 'remove',
capsCorrection: true,
punctuationCleanup: true
})
await classy.init()
// Process a comment
const result = await classy.processCommentManual('THIS IS GREAT!!!', {
onApprove: (refined) => {
// Handle approved text (e.g., update UI, send to server)
},
onCancel: () => {
// Handle cancellation
}
})Need Help?
For API support and questions: