Skip to content

mstroshin/Xcode26OpenRouterProxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

OpenRouter Xcode Proxy

A Swift Vapor-based proxy server for OpenRouter API that provides OpenAI-compatible endpoints for Xcode Intelligence.

Features

  • Proxy requests to OpenRouter API
  • OpenAI-compatible API format
  • Model filtering support
  • Streaming responses
  • SSL verification control
  • CLI interface
  • Request logging

Installation

  1. Ensure you have Swift 5.9+ installed
  2. Clone the repository
  3. Build the project:
swift build

Usage

Run the proxy server with default settings:

swift run OpenRouterXcodeProxy

Command Line Options

  • --port, -p: Port to run the server on (default: 8080)
  • --model-filter-file: Path to model filter file
  • --disable-ssl-verify: Disable SSL verification

Examples

# Run on custom port
swift run OpenRouterXcodeProxy --port 3000

# Use model filter file
swift run OpenRouterXcodeProxy --model-filter-file ./allowed-models.txt

# Disable SSL verification
swift run OpenRouterXcodeProxy --disable-ssl-verify

Model Filtering

Create a text file with one model ID per line to filter available models:

openai/gpt-4
anthropic/claude-3-sonnet
meta-llama/llama-2-70b-chat

API Endpoints

Get Models

GET /v1/models

Returns available models in OpenAI format.

Chat Completions

POST /v1/chat/completions

Proxies chat completion requests to OpenRouter with full streaming support.

Environment Variables

  • MODEL_FILTER_FILE: Path to model filter file
  • DISABLE_SSL_VERIFY: Set to "true" to disable SSL verification
  • PORT: Server port (can also be set via command line)

Requirements

  • Swift 5.9+
  • macOS 10.15+
  • Internet connection for OpenRouter API access

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages