Spaces:
Sleeping
Sleeping
AJ STUDIOZ
Fixed: Use text_generation instead of chat_completion + Added Anthropic Claude API support
dfa2ec3 | title: AJ STUDIOZ API | |
| emoji: π€ | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: docker | |
| pinned: false | |
| license: mit | |
| # AJ STUDIOZ API - Enterprise AI Platform | |
| **AJ-Mini v1.0** - Your AI assistant powered by Qwen 2.5 Coder 7B with AJ STUDIOZ branding, Claude API compatibility, and powerful coding abilities. | |
| ## π Features | |
| - **AJ-Mini Model** - Based on Qwen 2.5 Coder 7B (Best for coding & all tasks) | |
| - **Anthropic Claude Compatible** - Drop-in replacement for Claude API | |
| - **OpenAI Compatible API** - Also works with OpenAI format | |
| - **Advanced Code Generation** - Excellent at programming in all languages | |
| - **Multi-language Support** - Python, JavaScript, Java, C++, and more | |
| - **Streaming Support** - Real-time response streaming | |
| - **Enterprise Security** - API key authentication | |
| - **24/7 Availability** - Always online on Hugging Face Spaces | |
| - **π LIFETIME FREE** - No rate limits, no usage caps, free forever | |
| - **Unlimited Requests** - Use as much as you need | |
| ## π Authentication | |
| ### Anthropic Claude Format (Recommended for Claude users) | |
| ```bash | |
| x-api-key: sk-ant-your_secret_key_here | |
| ``` | |
| ### OpenAI Format (For OpenAI users) | |
| ```bash | |
| Authorization: Bearer aj_your_secret_key_here | |
| ``` | |
| **Both formats work!** Use whichever you prefer. | |
| ## π‘ API Endpoints | |
| ### 1. Anthropic Claude Messages (NEW! π) | |
| **Exact same format as Claude API:** | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/v1/messages \ | |
| --header "x-api-key: sk-ant-api03-YourKeyHere" \ | |
| --header "anthropic-version: 2023-06-01" \ | |
| --header "content-type: application/json" \ | |
| --data '{ | |
| "model": "claude-sonnet-4-20250514", | |
| "max_tokens": 1024, | |
| "messages": [ | |
| {"role": "user", "content": "Write a Python function to sort a list"} | |
| ] | |
| }' | |
| ``` | |
| **Response format (Claude-compatible):** | |
| ```json | |
| { | |
| "id": "msg_abc123...", | |
| "type": "message", | |
| "role": "assistant", | |
| "content": [ | |
| { | |
| "type": "text", | |
| "text": "Here's a Python function..." | |
| } | |
| ], | |
| "model": "claude-sonnet-4-20250514", | |
| "stop_reason": "end_turn", | |
| "usage": { | |
| "input_tokens": 15, | |
| "output_tokens": 50 | |
| } | |
| } | |
| ``` | |
| ### 2. OpenAI Chat Completions | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/v1/chat/completions \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: Bearer aj_your_key" \ | |
| -d '{ | |
| "model": "aj-mini", | |
| "messages": [{"role": "user", "content": "Hello AJ!"}], | |
| "stream": false | |
| }' | |
| ``` | |
| ### 2. OpenAI Chat Completions | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/v1/chat/completions \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: Bearer aj_your_key" \ | |
| -d '{ | |
| "model": "aj-mini", | |
| "messages": [{"role": "user", "content": "Explain async/await in JavaScript"}], | |
| "stream": false | |
| }' | |
| ``` | |
| ### 3. Text Completions | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/v1/completions \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: Bearer aj_your_key" \ | |
| -d '{ | |
| "model": "aj-mini", | |
| "prompt": "Write a poem about AI", | |
| "max_tokens": 500 | |
| }' | |
| ``` | |
| ### 3. Text Completions | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/v1/completions \ | |
| -H "Content-Type: application/json" \ | |
| -H "Authorization: Bearer aj_your_key" \ | |
| -d '{ | |
| "model": "aj-mini", | |
| "prompt": "Write a REST API in Node.js", | |
| "max_tokens": 500 | |
| }' | |
| ``` | |
| ### 4. Simple Chat Interface | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/chat \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"message": "Hello AJ!"}' | |
| ``` | |
| ### 4. Simple Chat Interface | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/chat \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"message": "Create a React component for a login form"}' | |
| ``` | |
| ### 5. Direct Generation | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/api/generate \ | |
| -H "Content-Type: application/json" \ | |
| -d '{ | |
| "prompt": "Explain quantum computing", | |
| "max_tokens": 1000, | |
| "temperature": 0.3 | |
| }' | |
| ``` | |
| ## π― Model Information | |
| - **Name**: AJ-Mini v1.0 | |
| - **Base**: Qwen 2.5 Coder 7B Instruct | |
| - **Size**: 7 Billion parameters | |
| - **Context**: 32K tokens | |
| - **Specialties**: | |
| - π₯ Advanced code generation (Python, JS, Java, C++, Go, Rust, etc.) | |
| - π‘ Algorithm design and optimization | |
| - π Bug fixing and code review | |
| - π Technical documentation | |
| - π Teaching and explanations | |
| - π Multi-language support | |
| - **Temperature**: 1.0 (default, configurable) | |
| - **Developer**: AJ STUDIOZ | |
| - **Website**: https://ajstudioz.co.in | |
| ## π οΈ Integration Examples | |
| ### Python with Anthropic SDK | |
| ```python | |
| import anthropic | |
| client = anthropic.Anthropic( | |
| api_key="sk-ant-your-key-here", | |
| base_url="https://YOUR-SPACE.hf.space" | |
| ) | |
| message = client.messages.create( | |
| model="claude-sonnet-4-20250514", | |
| max_tokens=1024, | |
| messages=[ | |
| {"role": "user", "content": "Write a binary search function in Python"} | |
| ] | |
| ) | |
| print(message.content[0].text) | |
| ``` | |
| ### Python with OpenAI SDK | |
| ```python | |
| from openai import OpenAI | |
| client = OpenAI( | |
| base_url="https://YOUR-SPACE.hf.space/v1", | |
| api_key="aj_your_key_here" | |
| ) | |
| response = client.chat.completions.create( | |
| model="aj-mini", | |
| messages=[{"role": "user", "content": "Hello!"}] | |
| ) | |
| print(response.choices[0].message.content) | |
| ``` | |
| ### Python with OpenAI SDK | |
| ```python | |
| from openai import OpenAI | |
| client = OpenAI( | |
| base_url="https://YOUR-SPACE.hf.space/v1", | |
| api_key="aj_your_key_here" | |
| ) | |
| response = client.chat.completions.create( | |
| model="aj-mini", | |
| messages=[{"role": "user", "content": "Explain decorators in Python"}] | |
| ) | |
| print(response.choices[0].message.content) | |
| ``` | |
| ### cURL with Anthropic Format | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/v1/messages \ | |
| --header "x-api-key: sk-ant-your-key" \ | |
| --header "anthropic-version: 2023-06-01" \ | |
| --header "content-type: application/json" \ | |
| --data '{ | |
| "model": "claude-sonnet-4-20250514", | |
| "max_tokens": 2048, | |
| "messages": [ | |
| { | |
| "role": "user", | |
| "content": "Write a function to calculate Fibonacci numbers with memoization" | |
| } | |
| ] | |
| }' | |
| ``` | |
| ### JavaScript/Node.js | |
| ```javascript | |
| const response = await fetch('https://YOUR-SPACE.hf.space/chat', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ message: 'Hello AJ!' }) | |
| }); | |
| const data = await response.json(); | |
| console.log(data.reply); | |
| ``` | |
| ## π Response Format | |
| All responses include AJ STUDIOZ branding: | |
| ```json | |
| { | |
| "reply": "Response content...", | |
| "model": "AJ-Mini v1.0", | |
| "provider": "AJ STUDIOZ" | |
| } | |
| ``` | |
| ## π Security Features | |
| - API key validation (must start with `aj_`) | |
| - CORS enabled for web applications | |
| - **NO rate limiting** - Unlimited requests forever | |
| - **100% FREE** - No hidden costs or premium tiers | |
| - Secure token handling | |
| ## π Pricing | |
| **LIFETIME FREE** | |
| - β Unlimited API calls | |
| - β No rate limits | |
| - β No usage caps | |
| - β No credit card required | |
| - β 24/7 availability | |
| - β Full OpenAI compatibility | |
| - β Enterprise features included | |
| *Forever free. Always available. Built by AJ STUDIOZ.* | |
| ## π Status & Health | |
| Check API health: | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/health | |
| ``` | |
| Get model information: | |
| ```bash | |
| curl https://YOUR-SPACE.hf.space/ | |
| ``` | |
| --- | |
| **Developed by AJ STUDIOZ** π | |
| Enterprise-grade AI solutions with professional support | |