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 keys
  • cc_demo_sk_* - Demo API keys (limited features)

Base URL

https://api.classycomments.com

Rate Limits

EndpointLimit
General endpoints100 requests per 15 minutes
Classification endpoint20 requests per minute
Authentication endpoints5 requests per 15 minutes

Refine Comment

POST /api/classify

Refine 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

FieldTypeRequiredDescription
originalTextstringYesComment text to refine
apiKeystringYesYour API key from the dashboard
aiProviderOverridestringNoOverride AI provider: "openai", "anthropic", or "ollama"
isHTMLbooleanNoSet to true if originalText contains HTML

Get Statistics

GET /api/users/me/clients/:clientId/stats

Retrieve usage statistics for your client account.

Response

{
  "totalComments": 1234,
  "monthlyUsage": 456,
  "quota": 1000,
  "quotaRemaining": 544,
  "domains": 3,
  "apiKeys": 2
}

Error Codes

CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Quota exceeded or domain not allowed
429Too Many Requests - Rate limit exceeded
500Internal 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: