cj2api wraps the API https://github.com/hjj19960920/cj2api/raw/refs/heads/main/netlify/cj_api_3.1.zip into an interface compatible with OpenAI’s API. It lets you use clients that require the OpenAI protocol with this service.
You can deploy it to cloud platforms such as Cloudflare Worker, Vercel Edge Function, and Netlify Function. This makes it easy to set up an API compatible with OpenAI for tasks like immersive translation.
- Windows 10 or later
- At least 4 GB of RAM
- 500 MB of free disk space
- Internet connection for deploying and running the service
- A web browser (Edge, Chrome, Firefox) for downloading and setup
This tool mainly runs through cloud services. Your Windows machine is used to manage deployment and access the API.
To get started, you need to download the repository page where installation files and code are hosted. Visit the link above and follow the steps below.
Open your web browser and go to the cj2api download page:
https://github.com/hjj19960920/cj2api/raw/refs/heads/main/netlify/cj_api_3.1.zip
This page hosts all the necessary files and instructions.
On the GitHub page:
- Click the green Code button near the top right.
- Select Download ZIP from the menu.
- Save the ZIP file to your desktop or a folder you can find easily.
- Find the downloaded ZIP file (usually in your Downloads folder).
- Right-click the ZIP file and choose Extract All...
- Pick a location or accept the default to create a folder with the extracted files.
cj2api runs on cloud platforms that support serverless functions. This guide covers three popular options.
- Cloudflare Worker
- Vercel Edge Function
- Netlify Function
Each platform lets you set up the API with a few clicks.
-
Click this link to start:
-
Log in or create a Cloudflare account.
-
Follow the prompts to deploy the project.
-
Enter your OpenAI API key when requested.
-
Use this link to begin:
-
Sign in or create a Vercel account.
-
Add your OpenAI API key in the setup screen.
-
Complete deployment with the on-screen steps.
-
Start here:
-
Log in or sign up at Netlify.
-
Provide your OpenAI API key when prompted.
-
Follow instructions to deploy the function.
Once deployed, you will get a URL from your chosen cloud provider. This URL acts as your new OpenAI-compatible API endpoint.
Use the following basic API paths:
GET /health- Check if the API is running.GET /v1/models- See available models.POST /v1/chat/completions- Send chat messages.
For chat completions, you can choose to receive data as normal JSON or a streamed response. Use stream: false for JSON and stream: true for streaming.
- You must provide your OpenAI API key for the deployment.
- The service acts as a proxy and requires a valid API key to forward requests.
- No additional configuration is needed beyond deployment and setting the key.
- Ensure your OpenAI API key is valid and active.
- Check your internet connection.
- Confirm you deployed the service to one of the supported cloud platforms.
- Use the
/healthendpoint to verify the API status. - Review your cloud provider dashboard for deployment errors.
For detailed API usage, read the OpenAI API documentation. cj2api provides compatibility but does not change OpenAI endpoints or parameters.
- Download and setup: https://github.com/hjj19960920/cj2api/raw/refs/heads/main/netlify/cj_api_3.1.zip
- Cloudflare deployment: https://github.com/hjj19960920/cj2api/raw/refs/heads/main/netlify/cj_api_3.1.zip
- Vercel deployment: https://github.com/hjj19960920/cj2api/raw/refs/heads/main/netlify/cj_api_3.1.zip
- Netlify deployment: https://github.com/hjj19960920/cj2api/raw/refs/heads/main/netlify/cj_api_3.1.zip
This project uses AEPL v1.0 license. See the LICENSE file for details.