metadata
title: Scira AI Reverse API
emoji: π€
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
license: mit
app_port: 7860
Scira AI Reverse API
A FastAPI server that provides OpenAI-compatible endpoints for Scira AI with advanced rate limiting bypass features.
π Features
- β Full OpenAI Compatibility - Drop-in replacement for OpenAI API
- β Streaming Support - Real-time SSE responses
- β Function Calling - Complete tool calling support
- β Rate Limiting Bypass - Proxy rotation and header spoofing
- β FastAPI Framework - High performance async API
π‘ API Endpoints
OpenAI-Compatible
POST /v1/chat/completions- Chat completions with streamingGET /v1/models- List available models
Legacy Scira
POST /api/search- Direct Scira API compatibilityGET /health- Health checkGET /- API information
π§ Usage
Basic Chat
curl -X POST "https://your-space.hf.space/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "scira-5-mini",
"messages": [
{"role": "user", "content": "Hello!"}
]
}'
Streaming
curl -X POST "https://your-space.hf.space/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "scira-5-mini",
"messages": [
{"role": "user", "content": "Tell me a story"}
],
"stream": true
}'
Function Calling
curl -X POST "https://your-space.hf.space/v1/chat/completions" \
-H "Content-Type: application/json" \
-d '{
"model": "scira-5-mini",
"messages": [
{"role": "user", "content": "What is the weather?"}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
},
"required": ["location"]
}
}
}
]
}'
π Configuration
The API uses environment variables for configuration. Set these in your Hugging Face Space settings:
SCIRA_SESSION_TOKEN- Your Scira session tokenSCIRA_POSTHOG_TOKEN- Your PostHog tokenPROXY_HOST- Proxy host (optional)PROXY_USERNAME- Proxy username (optional)PROXY_PASSWORD- Proxy password (optional)
π‘οΈ Rate Limiting Features
- Proxy Rotation - Residential proxy support
- Header Spoofing - Randomized User-Agent and browser headers
- IP Spoofing - X-Forwarded-For randomization
- Request Throttling - Random delays between requests
π Supported Parameters
All OpenAI parameters are supported:
model,messages,max_tokenstemperature,top_p,presence_penaltystream,tools,tool_choicestop,frequency_penalty,logit_bias
π Integration
Python with OpenAI Library
import openai
openai.api_base = "https://your-space.hf.space/v1"
openai.api_key = "dummy"
response = openai.ChatCompletion.create(
model="scira-5-mini",
messages=[{"role": "user", "content": "Hello!"}]
)
JavaScript
const response = await fetch('https://your-space.hf.space/v1/chat/completions', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'scira-5-mini',
messages: [{role: 'user', content: 'Hello!'}]
})
});
β οΈ Important Notes
- This is for educational and research purposes
- Configure valid session tokens for proper functionality
- Respect Scira AI's terms of service
- Rate limiting helps avoid detection but doesn't guarantee it
π License
MIT License - See LICENSE file for details.