Transform scira's web service into an API service, The API supports access in the OpenAI format.
- π UserId Polling - userId polling with support for multiple userIds.
- π Automatic Conversation Management - Conversation can be automatically deleted after use
- π Streaming Responses - Get real-time streaming outputs
- π Proxy Support - Route requests through your preferred proxy
- π API Key Authentication - Secure your API endpoints
- π Automatic Retry - Feature to automatically retry requests when request fail
- Go 1.24+ (for building from source)
- Docker (for containerized deployment)
docker run -d \
-p 8080:8080 \
-e USERIDS=xxx,yyy \
-e APIKEY=sk-123 \
-e CHAT_DELETE=true \
-e HTTP_PROXY=http://127.0.0.1:7890 \
-e MODELS=gpt-4.1-mini,claude-3-7-sonnet,grok-3-mini,qwen-qwq \
-e RETRY=3 \
--name scira2api \
ghcr.io/coderzoe/scira2api:latestCreate a docker-compose.yml file:
version: '3'
services:
scira2api:
image: ghcr.io/coderzoe/scira2api:latest
container_name: scira2api
ports:
- "8080:8080"
environment:
- USERIDS=xxx,yyy # Required
- APIKEY=sk-123 # Optional
- CHAT_DELETE=true # Optional
- HTTP_PROXY=http://127.0.0.1:7890 # Optional
- MODELS=gpt-4.1-mini,claude-3-7-sonnet,grok-3-mini,qwen-qwq # Optional
- RETRY=3 # Optional
restart: unless-stopped
Then run:
docker-compose up -dOrοΌ
# Clone the repository
git clone https://github.com/coderZoe/scira2api.git
cd scira2api
# edit environment
vi docker-compose.yml
./deploy.sh# Clone the repository
git clone https://github.com/coderZoe/scira2api.git
cd scira2api
cp .env.example .env
vim .env
# Build the binary
go build -o scira2api .
./scira2apiYou can configure scira2api using a .env file in the application's root directory. If this file exists, it will be used instead of environment variables.
Example .env:
# Required, separate multiple userIds with English commas
USERIDS= xxx,yyy
# Optional, PORT. Default: 8080
PORT=8080
# Optional, API key for authenticating client requests (e.g., the key entered for openweb-ui requests). If empty, no authentication is required.
APIKEY=sk-xxx
# Optional, Proxy address. Default: No proxy is used.
HTTP_PROXY= http://127.0.0.1:7890
# Optional, List of models, separated by English commas.
MODELS=gpt-4.1-mini,claude-3-7-sonnet,grok-3-mini,qwen-qwq
# Optional, Number of retry attempts on request failure. 0 or 1 means no retry. Default: 0 (no retry). A different userId will be used for each retry.
RETRY=3
# Optional, Whether to delete chat history on the page. Default: false (do not delete).
CHAT_DELETE=trueA sample configuration file is provided as .env.example in the repository.
Include your API key in the request header:
# no need if you not config apiKey
Authorization: Bearer YOUR_API_KEYcurl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "gpt-4.1-mini",
"messages": [
{
"role": "user",
"content": "Hello, Man!"
}
],
"stream": true
}'Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ bycoderZoe