Spaces:
Sleeping
Sleeping
| # 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_<your_unique_key> | |
| ``` | |
| **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** | |