Sign inSign up

shyurongli/zo2api

By shyurongli

•Updated 4 months ago

Zo Computer API proxy with OpenAI and Anthropic compatible endpoints.

Image
0

3.4K

shyurongli/zo2api repository overview

⁠zo2api Docker Image

Zo Computer API reverse proxy with OpenAI and Anthropic compatible endpoints.

This image runs zo2api, a lightweight Node.js gateway that forwards requests to api.zo.computer and exposes SDK-friendly API paths for OpenAI-style and Anthropic-style clients.

⁠Features

  • OpenAI compatible POST /v1/chat/completions
  • OpenAI compatible GET /v1/models
  • Anthropic compatible POST /v1/messages
  • Streaming and non-streaming responses
  • Tool/function call conversion
  • Proxy API key protection
  • Built-in unauthenticated health check at GET /healthz
  • Multi-arch Linux images for linux/amd64 and linux/arm64
  • Runs on macOS through Docker Desktop, including Intel Mac and Apple Silicon Mac

⁠Quick Start

docker run -d \
  --name zo2api \
  --restart unless-stopped \
  -p 8000:8000 \
  -e ZO_ACCESS_TOKEN=zo_sk_your_token_here \
  -e PROXY_API_KEY=sk-proxy-gateway-v1 \
  -e PROXY_PROMPT_OVERRIDE=true \
  -e PROXY_OUTPUT_SANITIZE=false \
  your-dockerhub-user/zo2api:latest

Check the service:

curl http://localhost:8000/healthz

⁠macOS Support

Docker Hub does not publish native macOS container images for this project. On macOS, run the Linux image through Docker Desktop.

Supported Mac setups:

  • Intel Mac uses the linux/amd64 image.
  • Apple Silicon Mac uses the linux/arm64 image.
  • Docker Desktop automatically selects the right platform for most users.

If you need to force a platform manually:

docker run --platform linux/arm64 -d \
  --name zo2api \
  -p 8000:8000 \
  -e ZO_ACCESS_TOKEN=zo_sk_your_token_here \
  -e PROXY_API_KEY=sk-proxy-gateway-v1 \
  your-dockerhub-user/zo2api:latest

List models:

curl http://localhost:8000/v1/models \
  -H "Authorization: Bearer sk-proxy-gateway-v1"

⁠Environment Variables

VariableRequiredDefaultDescription
ZO_ACCESS_TOKENYesNoneZo Computer access token used to call the upstream API.
PROXY_API_KEYNoRandom key on each startExternal API key accepted by this proxy. Set it explicitly for stable clients.
PORTNo8000HTTP port used by the server.
PROXY_PROMPT_OVERRIDENofalseEnables the request prompt wrapper in server.js.
PROXY_OUTPUT_SANITIZENofalseEnables response text sanitization in server.js.

⁠API Paths

MethodPathDescription
GET/healthzHealth check. Does not require authentication.
GET/v1/modelsLists upstream models in OpenAI-compatible format.
POST/v1/chat/completionsOpenAI-compatible chat completions endpoint.
POST/v1/messagesAnthropic-compatible messages endpoint.

All API paths except /healthz require the configured proxy API key.

⁠Image Tags

Every v* release tag publishes and updates these Docker tags:

v1.2.3
1.2.3
1.2
latest
sha-<short-sha>

The image includes version metadata:

  • /app/VERSION contains the release version without the leading v.
  • APP_VERSION is set inside the image.
  • OCI labels include org.opencontainers.image.version and org.opencontainers.image.ref.name.

⁠Docker Compose

For Compose deployment, use the repository docker-compose.yml and .env.example files:

cp .env.example .env
./scripts/deploy.sh

⁠Source

The source repository contains the Dockerfile, Compose file, release pipeline, and usage examples.

Tag summary

Content type

Image

Digest

sha256:56abbd677…

Size

54.8 MB

Last updated

4 months ago

docker pull shyurongli/zo2api