Skip to content

SucceedAI/ai-proxy-server

Repository files navigation

AI Proxy Server for Secure Client Applications

SucceedAI Proxy API securely connects the SucceedAI macOS app to AI provider APIs while keeping private API keys off the client.

Supported providers 🚀

  • OpenAI (default)
  • Meta Llama
  • Mistral AI
  • Claude (Anthropic)

Provider and security settings are documented in .env.dist.

Get Started

Requires Node.js 22.18 or newer.

  1. Copy .env.dist to .env and add your credentials.
  2. Run npm install.
  3. Run npm run dev to start the server in watch mode.

Other Commands

  • npm start: start the server normally.
  • npm run prod: start in production mode.
  • npm run build: validate the TypeScript build.
  • npm run typecheck: check TypeScript without running the server.
  • npm test: run the tests.
  • npm run prettier:check / npm run prettier:fix: check or fix formatting.

Railway Deployment

Railway uses the included railway.json configuration:

  • Build command: npm ci && npm run build
  • Start command: npm start
  • Health check: /v1/health
  • Restart policy: ON_FAILURE

Recommended setup:

railway variables set NODE_ENV=production
railway variables set JWT_SECRET=<same-token-used-in-the-macos-app>
railway variables set OPENAI_API_KEY=<openai-api-key>
railway variables set OPENAI_MODEL=gpt-5.2
railway up

Use .env.railway.example as the deployment checklist. Do not commit .env.

Security

  • JWT_SECRET must not be empty in Railway.
  • OPENAI_API_KEY must exist only in Railway or local .env.
  • License checks are optional and disabled by default.
  • When enabled, requests must include License: <license-id>:<license-key>.

Author

Pierre-Henry Soria

Made with ❤️ by Pierre-Henry Soria, a passionate product engineer and problem-solver who builds and ships software, with a strong interest in open-source ecosystems and data science. Based in Sydney 🦘, he enjoys nature 🌳, non-fiction, journaling, life optimisation, minimalism, and self-sufficiency. He also has a soft spot for Roquefort 🧀, a ristretto or almond flat white ☕️, and dark chocolate.

@phenrysay BlueSky pH-7 YouTube Video

Presentation Video

Watch the SucceedAI presentation video

About the Project

Succeed AI is part of the challenge #AI-Free-Projects, a group of 7 artificial intelligence projects I have engaged to open source and transparently release on GitHub / YouTube with at least 20-hour/week commitment. Hope you enjoy 🤗

Feel free to connect, and reach me at my LinkedIn Profile 🚀

License

Distributed under the MIT license 🎉 Wish you happy, happy coding! 🤠

About

Simple backend proxy API to handle requests between your macOS SwiftUI app and the Mistral AI API (or another third-party AI API)

Topics

Resources

License

Stars

8 stars

Watchers

0 watching

Forks

Sponsor this project

  •  

Contributors