npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yadimon/claude-code-to-llm-server

v0.3.4

Published

Use Claude Code as a simple OpenAI-compatible Responses server

Downloads

636

Readme

@yadimon/claude-code-to-llm-server

OpenAI-compatible Responses server on top of @yadimon/claude-code-to-llm.

Install

npm install -g @yadimon/claude-code-to-llm-server

Or run it without installing globally:

npx @yadimon/claude-code-to-llm-server

Requirements:

  • Node.js >=20
  • installed claude CLI in PATH or CLAUDE_CODE_TO_LLM_CLI_PATH
  • valid Claude Code login on the machine

Default auth bundle:

  • ~/.claude.json
  • ~/.claude/.credentials.json

Endpoints

  • POST /v1/responses
  • GET /v1/models
  • GET /healthz

Start

npx @yadimon/claude-code-to-llm-server

Then call:

curl http://127.0.0.1:3000/healthz
curl http://127.0.0.1:3000/v1/models

Example response request:

curl http://127.0.0.1:3000/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "input": "Say hello in one short sentence."
  }'

Streaming example:

curl http://127.0.0.1:3000/v1/responses \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "stream": true,
    "input": "Count from 1 to 3."
  }'

Local development commands:

npm run start --workspace @yadimon/claude-code-to-llm-server
npm run start:mock --workspace @yadimon/claude-code-to-llm-server

Authentication

If you set CLAUDE_CODE_TO_LLM_SERVER_API_KEY, only POST /v1/responses requires a bearer token. GET /healthz and GET /v1/models stay public.

Example:

curl http://127.0.0.1:3000/v1/responses \
  -H "Authorization: Bearer your-token" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "input": "Hello"
  }'

Runtime Configuration

| Variable | Default | Description | |---|---|---| | CLAUDE_CODE_TO_LLM_SERVER_HOST | 127.0.0.1 | HTTP bind host. | | CLAUDE_CODE_TO_LLM_SERVER_PORT | 3000 | HTTP bind port. | | CLAUDE_CODE_TO_LLM_SERVER_DEFAULT_MODEL | claude-sonnet-4-6 | Fallback model when the request omits model. | | CLAUDE_CODE_TO_LLM_SERVER_MODELS | default model | Comma-separated allowlist of accepted models. | | CLAUDE_CODE_TO_LLM_SERVER_API_KEY | - | Bearer token accepted for POST /v1/responses. | | CLAUDE_CODE_TO_LLM_SERVER_MOCK_MODE | - | Enables the mock runner for local testing. | | CLAUDE_CODE_TO_LLM_SERVER_MOCK_RESPONSE | mock response | Mock response text returned by the mock runner. | | CLAUDE_CODE_TO_LLM_AUTH_PATH | ~/.claude.json | Path to the Claude Code session file. | | CLAUDE_CODE_TO_LLM_CREDENTIALS_PATH | ~/.claude/.credentials.json | Path to the Claude Code credentials file. | | CLAUDE_CODE_TO_LLM_SETTINGS_PATH | ~/.claude/settings.json when present | Optional settings file copied into the temporary Claude home. | | CLAUDE_CODE_TO_LLM_CLI_PATH | claude | Path to the Claude Code CLI binary. | | CLAUDE_CODE_TO_LLM_CONFIG_HOME | temp dir | Temporary Claude Code home directory for a run. | | CLAUDE_CODE_TO_LLM_WORKSPACE | temp dir | Workspace directory used for execution. | | CLAUDE_CODE_TO_LLM_REASONING_EFFORT | low | Default reasoning effort passed to the core runner. |

Behavior Notes

  • GET /healthz and GET /v1/models stay public even when bearer auth is configured.
  • POST /v1/responses validates requested models against CLAUDE_CODE_TO_LLM_SERVER_MODELS.
  • max_output_tokens and reasoning.effort are forwarded to the core runner.
  • Unsupported request fields such as tools, tool_choice, or input_image return 400.
  • The server owns prompt adaptation for instructions and multi-message dialog input before calling the raw core runner.
  • --search / webSearch: true is a server-wide policy: when enabled it allows the underlying claude CLI to use WebSearch for every request. There is no per-request opt-in (tools is rejected). Web-search usage is captured by the core runner but not surfaced in the OpenAI usage block.

Docker

Build from the repository root:

docker build -f packages/claude-code-to-llm-server/Dockerfile .
docker run -p 3000:3000 \
  -v ~/.claude.json:/root/.claude.json:ro \
  -v ~/.claude/.credentials.json:/root/.claude/.credentials.json:ro \
  claude-code-to-llm-server

Development

npm run build --workspace @yadimon/claude-code-to-llm-server
npm run lint --workspace @yadimon/claude-code-to-llm-server
npm run typecheck --workspace @yadimon/claude-code-to-llm-server