# 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_`: ```bash Authorization: Bearer aj_your_api_key_here ``` --- ## 📋 Available Endpoints ### 1. Chat Completions (OpenAI-compatible) ```bash POST /v1/chat/completions ``` **Example Request:** ```bash 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:** ```json { "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 ```bash POST /v1/completions ``` **Example:** ```bash 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 ```bash GET /v1/models ``` **Example:** ```bash curl "https://kamesh14151-aj-studioz-api.hf.space/v1/models" \ -H "Authorization: Bearer aj_test_key_123456789" ``` --- ## 🐍 Python SDK Examples ### Using OpenAI Python Library ```python 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 ```python 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 ```javascript 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 ```javascript 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_ ``` **Examples of valid keys:** - `aj_test_key_123456789` - `aj_prod_a1b2c3d4e5f6` - `aj_dev_mycompany_2024` **Invalid keys will return:** ```json { "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:** ```json { "id": "chatcmpl-...", "object": "chat.completion", "created": 1730505600, "model": "aj-mini", "choices": [...], "usage": { "prompt_tokens": 50, "completion_tokens": 100, "total_tokens": 150 } } ``` **Error Response:** ```json { "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 - **Website:** https://ajstudioz.co.in - **Documentation:** https://docs.ajstudioz.co.in (coming soon) - **API Status:** https://status.ajstudioz.co.in (coming soon) --- ## 📝 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**