Implementation Principle
- Register on the Replit platform using the registration link, bind a card and get a free one-month membership.
- Send a prompt to Replit to automatically build an API website; the generated site will provide a Base Url and key, which you can use directly in AI development tools like Cursor, Cherry Studio, etc.
Steps
1. Register a Replit Account
Link 1: https://replit.com/stripe-checkout-by-price/core_1mo_20usd_monthly_feb_26?coupon=AGENT4EFC3DBDEEF99
Link 2: https://replit.com/stripe-checkout-by-price/core_1mo_20usd_monthly_feb_26?coupon=AGENT42AF9E7485EB9
Note: You must use one of the links above to activate the membership for free. It should look like this:
Card binding: I used a virtual card from Bybit.
If you don’t have one, you can use my referral link to register: Crypto Card | Bybit Card With Up to 10% Cashback
2. Send the Prompt to Auto-Create the API Website
- Send the entire prompt below to Replit and wait about 2 minutes.
- Important: During the build process, you’ll be prompted to enter an API KEY. Define a 16-character string of your choice and save it—you’ll need it later.
Goal: Set up an OpenAI-compatible reverse proxy API in a Replit pnpm monorepo and publish it.
[Environment Setup] 1. Add OpenAI and Anthropic AI integrations in Replit Integrations 2. Set Secrets: PROXY_API_KEY (any string to be used as Bearer Token), SESSION_SECRET
[API Server Edits] File: artifacts/api-server/src/routes/proxy.ts - Create GET /v1/models to return the model list (gpt-5.2, gpt-5-mini, gpt-5-nano, o4-mini, o3, claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5) - Create POST /v1/chat/completions: - Verify Authorization: Bearer ${PROXY_API_KEY}, return 401 on failure - Route by model prefix: gpt/o → OpenAI client, claude → Anthropic client - For Anthropic, convert format: extract system messages, messages keep only user/assistant - Support stream=true: set Content-Type: text/event-stream, X-Accel-Buffering: no, res.flushHeaders() - OpenAI streaming: forward chunk directly, call res.flush() after each - Anthropic streaming: convert content_block_delta to OpenAI chunk format, call res.flush() after each - Send keepalive (": keepalive\n\n") every 5s, on req.on("close") clearInterval, use try/finally to prevent 500s - Non-stream: wait for full response and return OpenAI format JSON - Express body limit = 50mb File: artifacts/api-server/src/app.ts - app.use("/v1", proxyRouter) File: artifacts/api-server/.replit-artifact/artifact.toml - Add "/v1" to paths array
[Frontend Portal] Use createArtifact({ artifactType: "react-vite", slug: "api-portal", previewPath: "/", title: "API Portal" }) to create artifact App.tsx functionality: - fetch(`${window.location.origin}/api/healthz`) to check online status - Show Base URL, /v1/models, /v1/chat/completions, API Key instructions - Copy button - 4-step CherryStudio setup guide - Model list - Dark theme
[Deploy] - Launch two workflows: api-server and api-portal - presentArtifact({ artifactId: "artifacts/api-portal" }) - suggestDeploy() - After deployment, the domain is the Base URL for CherryStudio
3. One-click Deploy the Generated Website
Click the deploy button in the chat window and wait for deployment to complete.
4. Check API Status
Once deployment succeeds, the page will display the access address: https://xxx--username.replit.app
5. Connect with Dev Tools
The call address is the Base URL.
The API is your custom API key from above.
Now you can enjoy playing around with it!!!





