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

All API requests should be made to:

https://api.helpingai.co/v1

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

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

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

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

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

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

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

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

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

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

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

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

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

Official SDKs

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

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

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

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

  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)

Webhook support for real-time notifications about:

  • Completion status
  • Usage alerts
  • Model updates

Changelog

v1.0.0 (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

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