API Reference {#api-reference}

Welcome to the HelpingAI API reference. This comprehensive guide covers all endpoints, parameters, and features available in our emotionally intelligent AI platform.

Base URL {#base-url}

All API requests should be made to:

https://api.helpingai.co/v1

Authentication {#authentication}

HelpingAI uses API keys for authentication. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Get your API key from the HelpingAI Dashboard.

Endpoints Overview {#endpoints-overview}

Chat Completions {#chat-completions}

The primary endpoint for generating conversational responses with emotional intelligence.

POST/v1/chat/completions

Generate chat completions with emotional intelligence

Key Features:

  • Emotional intelligence built-in
  • Chain of Recursive Thoughts with hideThink parameter
  • Streaming support
  • Tool calling capabilities
  • OpenAI API compatibility

View Chat Completions Documentation →

Models {#models}

Retrieve information about available models and their capabilities.

GET/v1/models

List all available models

GET/v1/models/{model_id}

Get information about a specific model

Available Models:

  • Dhanishtha-2.0-preview - Our flagship model with emotional intelligence

View Models Documentation →

Request Format {#request-format}

All requests should include:

  1. Content-Type: application/json
  2. Authorization: Bearer YOUR_API_KEY
  3. Request Body: Valid JSON (for POST requests)

Example Request {#example-request}

Bash
curl -X POST https://api.helpingai.co/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "Dhanishtha-2.0-preview",
    "messages": [
      {"role": "user", "content": "I'm feeling overwhelmed today"}
    ]
  }'

Response Format {#response-format}

All successful responses return JSON with appropriate HTTP status codes:

  • 200: Success
  • 400: Bad Request - Invalid parameters
  • 401: Unauthorized - Invalid API key
  • 429: Too Many Requests - Rate limit exceeded
  • 500: Internal Server Error

Success Response {#success-response}

JSON
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1677652288,
  "model": "Dhanishtha-2.0-preview",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "I understand you're feeling overwhelmed today..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 15,
    "completion_tokens": 45,
    "total_tokens": 60
  }
}

Error Response {#error-response}

JSON
{
  "error": {
    "message": "Invalid API key provided",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}

Rate Limits {#rate-limits}

Rate limits vary by subscription tier:

TierRequests/minuteTokens/minute
Free6010,000
Pro3,000500,000
EnterpriseCustomCustom

Rate limit headers are included in responses:

  • X-RateLimit-Limit: Request limit per minute
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Time when rate limit resets

Unique Features {#unique-features}

Emotional Intelligence {#emotional-intelligence}

HelpingAI automatically detects and responds to emotional cues in user messages:

JSON
{
  "messages": [
    {"role": "user", "content": "I just got rejected from my dream job and I'm devastated"}
  ]
}

Response includes empathetic understanding and supportive language.

Chain of Recursive Thoughts {#chain-of-recursive-thoughts}

Control AI reasoning visibility with the hideThink parameter:

JSON
{
  "model": "Dhanishtha-2.0-preview",
  "messages": [{"role": "user", "content": "Solve this complex problem"}],
  "hideThink": false
}

When hideThink=false, responses include <think>...</think> tags showing the AI's reasoning process.

Tool Calling {#tool-calling}

Execute functions and access external data:

JSON
{
  "model": "Dhanishtha-2.0-preview",
  "messages": [{"role": "user", "content": "What's the weather in Tokyo?"}],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "Get current weather",
        "parameters": {
          "type": "object",
          "properties": {
            "location": {"type": "string"}
          }
        }
      }
    }
  ]
}

Streaming {#streaming}

Get real-time responses as they're generated:

JSON
{
  "model": "Dhanishtha-2.0-preview",
  "messages": [{"role": "user", "content": "Tell me a story"}],
  "stream": true
}

SDKs and Libraries {#sdks-and-libraries}

Official SDKs {#official-sdks}

  • Python: pip install helpingai
  • JavaScript: npm install helpingai

OpenAI Compatibility {#openai-compatibility}

Use existing OpenAI libraries by changing the base URL:

Python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.helpingai.co/v1",
    api_key="YOUR_API_KEY"
)

Error Handling {#error-handling}

Always implement proper error handling:

Python
try:
    response = client.chat.completions.create(
        model="Dhanishtha-2.0-preview",
        messages=[{"role": "user", "content": "Hello"}]
    )
except Exception as e:
    print(f"Error: {e}")

Common Error Codes {#common-error-codes}

CodeDescriptionSolution
invalid_api_keyAPI key is invalidCheck your API key
insufficient_quotaUsage quota exceededUpgrade plan or wait
model_not_foundModel doesn't existUse valid model name
rate_limit_exceededToo many requestsImplement rate limiting
invalid_request_errorRequest format invalidCheck request structure

Best Practices {#best-practices}

  1. Use Appropriate Models: Choose the right model for your use case
  2. Handle Errors Gracefully: Implement comprehensive error handling
  3. Monitor Usage: Track token consumption and costs
  4. Optimize Prompts: Craft clear, contextual prompts
  5. Respect Rate Limits: Implement proper rate limiting
  6. Secure API Keys: Never expose keys in client-side code

Webhooks (Coming Soon) {#webhooks-coming-soon}

Webhook support for real-time notifications about:

  • Completion status
  • Usage alerts
  • Model updates

Changelog {#changelog}

v1.0.0 (Current) {#v100-current}

  • Initial release with Dhanishtha-2.0-preview
  • Chat completions with emotional intelligence
  • Chain of Recursive Thoughts with hideThink
  • Tool calling support
  • Streaming responses
  • OpenAI API compatibility

Support {#support}

Need help with the API?

  • Documentation: Comprehensive guides and examples
  • Discord: Join our developer community
  • Email: support@helpingai.co
  • Status: status.helpingai.co

Next Steps {#next-steps}