English | 中文
A middleware service for connecting to Augment API, providing OpenAI-compatible interfaces with support for Claude3.7、Claude4 model calls.
- Features
- Important Notice
- Supported Models
- Environment Variables
- Quick Start
- API Usage
- Admin Interface
- Batch Add Tokens
- Feedback
- Star History
- 🔄 OpenAI-compatible API interface
- 🤖 Support for Claude-Sonnet-3.7 model(In Chat Mode),Cluade-4-Sonnet(In Agent Mode)
- 📡 Support for streaming/non-streaming output
- 🎛️ Simple multi-token management interface
- 🗄️ Redis-based token storage
- 🔍 Batch token and tenant URL detection and updates
- 📥 API for batch token addition
Risk Warning: Using this project may result in your account being flagged, restricted, or banned. Use at your own risk!
- The system determines the usage mode based on the input model name. In
AGENT mode, all tool calls are blocked, using the model's native capabilities to respond, otherwise conversations may be interrupted by tool calls - Default concurrency control is applied, limiting each token to a maximum of
1 request every 3 seconds, with defaultBlock Tokencooldown rules - Augment's
Agentmode is very powerful. We recommend using the official plugin in your editor for an experience comparable toCursor
Model names ending with -chat use CHAT mode for responses
Model names ending with -agent use AGENT mode for responses
Other model names default to CHAT mode| Variable | Description | Required | Example |
|---|---|---|---|
| REDIS_CONN_STRING | Redis connection string | ✅ Yes | redis://default:password@localhost:6379 |
| ACCESS_PWD | Admin panel access password | ✅ Yes | your-access-password |
| AUTH_TOKEN | API access authentication token | ❌ No | your-auth-token |
| ROUTE_PREFIX | API request prefix | ❌ No | your_api_prefix |
| CODING_MODE | Debug mode switch | ❌ No | false |
| CODING_TOKEN | Debug token | ❌ No | empty |
| TENANT_URL | Debug tenant URL | ❌ No | empty |
| PROXY_URL | HTTP proxy address | ❌ No | http://127.0.0.1:7890 |
| REMOVE_FREE | Remove free accounts switch | ❌ No | false |
Tip: If the page fails to get tokens, you can set
CODING_MODE=trueand configureCODING_TOKENandTENANT_URLto use a specific token and tenant URL (limited to single token usage).
Since Augment doesn't automatically switch to Free plan after trial ends, causing conversations to respond with plan switching prompts, if you need to automatically remove these accounts, you can set REMOVE_FREE=true. The system will automatically identify and disable free accounts during batch detection.
If the response contains the following content:
- "Your subscription for account"
- "is inactive"
- "update your plan here to continue using Augment"
The token will be automatically marked as unavailable and will not participate in subsequent API call allocations.
This helps improve API success rates and stability, avoiding request failures due to free account limitations.
docker run -d \
--name augment2api \
-p 27080:27080 \
-e REDIS_CONN_STRING="redis://default:yourpassword@your-redis-host:6379" \
-e ACCESS_PWD="your-access-password" \
-e AUTH_TOKEN="your-auth-token" \
--restart always \
linqiu1199/augment2api- Clone the project
git clone https://github.com/linqiu1199/augment2api.git
cd augment2api- Configure environment variables
Create a .env file:
# Set Redis password (required)
REDIS_PASSWORD=your-redis-password
# Set admin panel access password (required)
ACCESS_PWD=your-access-password
# Set api authentication token (optional)
AUTH_TOKEN=your-auth-token- Start services
docker-compose up -dThis will start both Redis and Augment2Api services and automatically handle network connections between them.
- Visit
http://ip:27080/to access the admin login page, enter your access password to enter the admin panel - Click the
Add TOKENmenu
- Follow these steps to get tokens:
- Click to get authorization link
- Copy the authorization link and open it in browser
- Login with email (domain email also works)
- Copy the
augment codeto the authorization response input box, click get token - Token should appear normally in the TOKEN list
- Start conversation testing
Tips:
- If conversation returns 503 error, run
batch detectiononce to update tenant URLs before testing conversations (tenant URL error)- If conversation returns 401 error, run
batch detectiononce to disable invalid tokens before testing conversations (account banned)
curl -X GET http://localhost:27080/v1/modelscurl -X POST http://localhost:27080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "claude-3.7",
"messages": [
{"role": "user", "content": "Hello, please introduce yourself"}
]
}'Visit http://localhost:27080/ to open the admin login page. After logging in, you can interactively get and manage tokens.
curl -X POST http://localhost:27080/api/add/tokens \
-H "Content-Type: application/json" \
-d '[
{
"token": "token1",
"tenantUrl": "https://tenant1.com"
},
{
"token": "token2",
"tenantUrl": "https://tenant2.com"
}
]'curl -X POST http://localhost:27080/api/add/tokens \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-auth-token" \
-d '[
{
"token": "token1",
"tenantUrl": "https://tenant1.com"
},
{
"token": "token2",
"tenantUrl": "https://tenant2.com"
}
]' 
