aj-studioz-api / API-GUIDE.md
AJ STUDIOZ
Updated to use AJ-mini model based on DeepSeek-R1 1.5B
7603b27

AJ STUDIOZ API - Quick Start Guide

πŸš€ OpenAI-Compatible API with aj_ Keys

AJ STUDIOZ API is enterprise-grade AI with Claude-like thoughtfulness and full OpenAI compatibility.

Base URL

Production: https://api.ajstudioz.co.in
Development: https://kamesh14151-aj-studioz-api.hf.space

Authentication

All API requests require an API key starting with aj_:

Authorization: Bearer aj_your_api_key_here

πŸ“‹ Available Endpoints

1. Chat Completions (OpenAI-compatible)

POST /v1/chat/completions

Example Request:

curl -X POST "https://kamesh14151-aj-studioz-api.hf.space/v1/chat/completions" \
  -H "Authorization: Bearer aj_test_key_123456789" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aj-mini",
    "messages": [
      {"role": "system", "content": "You are a helpful AI assistant."},
      {"role": "user", "content": "Explain quantum computing in simple terms."}
    ],
    "max_tokens": 500,
    "temperature": 0.3
  }'

Example Response:

{
  "id": "chatcmpl-abc123def456",
  "object": "chat.completion",
  "created": 1730505600,
  "model": "aj-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Quantum computing is a revolutionary approach to computation..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 150,
    "total_tokens": 175
  }
}

2. Text Completions

POST /v1/completions

Example:

curl -X POST "https://kamesh14151-aj-studioz-api.hf.space/v1/completions" \
  -H "Authorization: Bearer aj_test_key_123456789" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aj-mini",
    "prompt": "Write a Python function to calculate fibonacci:",
    "max_tokens": 300,
    "temperature": 0.3
  }'

3. List Models

GET /v1/models

Example:

curl "https://kamesh14151-aj-studioz-api.hf.space/v1/models" \
  -H "Authorization: Bearer aj_test_key_123456789"

🐍 Python SDK Examples

Using OpenAI Python Library

from openai import OpenAI

# Initialize client with AJ STUDIOZ API
client = OpenAI(
    api_key="aj_test_key_123456789",
    base_url="https://kamesh14151-aj-studioz-api.hf.space/v1"
)

# Chat completion
response = client.chat.completions.create(
    model="aj-mini",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "What is machine learning?"}
    ],
    max_tokens=500,
    temperature=0.3
)

print(response.choices[0].message.content)

Using Requests

import requests

headers = {
    "Authorization": "Bearer aj_test_key_123456789",
    "Content-Type": "application/json"
}

data = {
    "model": "aj-mini",
    "messages": [
        {"role": "user", "content": "Explain neural networks"}
    ],
    "max_tokens": 500
}

response = requests.post(
    "https://kamesh14151-aj-studioz-api.hf.space/v1/chat/completions",
    headers=headers,
    json=data
)

print(response.json()["choices"][0]["message"]["content"])

🌐 JavaScript/Node.js Examples

Using OpenAI Node SDK

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'aj_test_key_123456789',
  baseURL: 'https://kamesh14151-aj-studioz-api.hf.space/v1'
});

async function chat() {
  const response = await client.chat.completions.create({
    model: 'aj-mini',
    messages: [
      { role: 'user', content: 'Tell me about AI safety' }
    ],
    max_tokens: 500,
    temperature: 0.3
  });
  
  console.log(response.choices[0].message.content);
}

chat();

Using Fetch

const response = await fetch('https://kamesh14151-aj-studioz-api.hf.space/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer aj_test_key_123456789',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'aj-mini',
    messages: [
      { role: 'user', content: 'Explain transformers' }
    ]
  })
});

const data = await response.json();
console.log(data.choices[0].message.content);

πŸ”‘ API Key Format

All API keys must follow this format:

aj_<your_unique_key>

Examples of valid keys:

  • aj_test_key_123456789
  • aj_prod_a1b2c3d4e5f6
  • aj_dev_mycompany_2024

Invalid keys will return:

{
  "error": {
    "message": "Invalid API key. Your API key should start with 'aj_'",
    "type": "invalid_request_error",
    "code": "invalid_api_key"
  }
}

πŸ“Š Response Format

All responses follow OpenAI's format for seamless integration:

Success Response:

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1730505600,
  "model": "aj-mini",
  "choices": [...],
  "usage": {
    "prompt_tokens": 50,
    "completion_tokens": 100,
    "total_tokens": 150
  }
}

Error Response:

{
  "error": {
    "message": "Error description",
    "type": "error_type",
    "code": "error_code"
  }
}

🎯 Model Parameters

Parameter Type Default Description
model string "aj-mini" Model to use
messages array required Chat messages
max_tokens integer 2000 Max completion length
temperature float 0.3 Sampling temperature (0-2)
stream boolean false Stream responses

🏒 Enterprise Features

βœ… OpenAI-Compatible - Drop-in replacement for OpenAI API
βœ… Claude-like Responses - Thoughtful, well-structured answers
βœ… Secure Authentication - API key validation with aj_ prefix
βœ… Rate Limiting - Production-ready throttling (coming soon)
βœ… Usage Analytics - Track API consumption (coming soon)
βœ… Custom Domain - api.ajstudioz.co.in (coming soon)


πŸ†˜ Support


πŸ“ Rate Limits (Coming Soon)

Tier Requests/min Tokens/day
Free 60 50,000
Pro 600 1,000,000
Enterprise Custom Custom

Made with ❀️ by AJ STUDIOZ