JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q68561F
  • License MIT

Turn JetBrains Junie AI into an OpenAI/Anthropic API compatible server. Usable with Claude Code!

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (junie-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Junie API Proxy

    [!WARNING] This is a reverse-engineered proxy of JetBrains Junie/Grazie AI API. It is not supported by JetBrains, and may break unexpectedly. Use at your own risk.

    [!WARNING] JetBrains Terms of Service: Use of JetBrains AI services is subject to the JetBrains AI Service Terms of Service. Excessive automated or scripted use may violate these terms and could result in suspension of your account or access.

    This proxy is intended for personal use with your own JetBrains/Junie subscription. Please use responsibly.


    A proxy for the JetBrains Junie/Grazie AI API that exposes it as an OpenAI and Anthropic compatible service. Use your Junie subscription with any tool that supports these APIs, including Claude Code.

    Features

    • OpenAI Compatibility: Exposes Junie AI as an OpenAI-compatible API (/v1/chat/completions, /v1/models)
    • Anthropic Compatibility: Exposes Junie AI as an Anthropic-compatible API (/v1/messages)
    • Claude Code Integration: Launch Claude Code with Junie as its backend via --claude-code flag
    • Multiple Auth Methods: JetBrains OAuth device flow or direct API key
    • Rate Limiting: Control API usage with --rate-limit and --wait options

    Quick Start

    npx junie-api

    That's it — the first run will guide you through JetBrains OAuth. The server starts on http://localhost:4141.

    With Claude Code

    npx junie-api --claude-code

    With an API key

    npx junie-api --auth-token YOUR_API_KEY

    Get your key from junie.jetbrains.com/cli.

    API Endpoints

    Endpoint Method Description
    POST /v1/chat/completions POST OpenAI-compatible chat completions
    GET /v1/models GET List available models
    POST /v1/messages POST Anthropic-compatible messages

    Claude Code Setup

    Use the --claude-code flag, or manually add to .claude/settings.json:

    {
      "env": {
        "ANTHROPIC_BASE_URL": "http://localhost:4141",
        "ANTHROPIC_AUTH_TOKEN": "dummy",
        "ANTHROPIC_MODEL": "google/gemini-2.5-pro",
        "ANTHROPIC_SMALL_FAST_MODEL": "google/gemini-2.5-flash",
        "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
      }
    }

    CLI Reference

    npx junie-api                          # Start server (default)
    npx junie-api start                    # Same as above
    npx junie-api start --port 8080 -v     # Custom port, verbose
    npx junie-api start --rate-limit 30 -w # Rate limit: 30s, wait
    npx junie-api start --claude-code      # With Claude Code setup
    npx junie-api auth                     # Authenticate only
    Option Description Default Alias
    --port Port to listen on 4141 -p
    --verbose Enable verbose logging false -v
    --auth-token Provide auth token directly none -a
    --show-token Show tokens on fetch/refresh false
    --rate-limit Rate limit in seconds none -r
    --wait Wait instead of error on rate limit false -w
    --claude-code Generate Claude Code launch command false -c

    Development

    npm install
    npm run build       # Build with tsdown
    npm test            # Run tests
    npm run dev         # Dev with --watch
    npm run typecheck   # TypeScript check

    Architecture

    Two routing paths:

    Anthropic Native Passthrough (/v1/messages with claude-* models)

    • Forwards requests to the upstream Anthropic-compatible endpoint
    • Sanitizes unknown fields before forwarding (e.g., context_management)
    • Streaming: pipes upstream SSE directly to client

    Translation Path (/v1/messages with non-Claude models, /v1/chat/completions)

    • Translates Anthropic format → OpenAI format → Grazie native protocol
    • Wraps in { profile, chat: { messages } } for the Grazie gateway
    • Translates responses back to the requested format

    License

    MIT