Skip to main content
This guide explains how to connect Claude Code and Claude Desktop to a CoreWeave Inference endpoint, so you can run them against CoreWeave-hosted models: open-weight models from the Serverless Inference catalog, or your own Dedicated Inference deployment. You run a small local proxy that translates between the API format Claude uses and the OpenAI-compatible API that CoreWeave Inference serves, so the same setup works for either option with only a change of endpoint and credentials.

How it works

Claude Code is Anthropic’s agentic coding assistant, and Claude Desktop is Anthropic’s desktop chat application. Both send requests in Anthropic’s Messages API format. CoreWeave Inference serves models through an OpenAI-compatible API, the same interface that Serverless and Dedicated Inference expose for OpenAI client libraries and tooling. The two formats aren’t interchangeable. They differ in how the system prompt is carried, how tools are described, how tool results are returned, and how responses are shaped. Claude Code and Claude Desktop can’t call an OpenAI-compatible endpoint directly, so a lightweight proxy sits between Claude and your inference endpoint to:
  1. Accept Anthropic Messages API requests from Claude.
  2. Translate them into OpenAI-compatible chat completion requests.
  3. Forward the requests to CoreWeave Inference.
  4. Convert the responses back into Anthropic-compatible format.
  5. Return the results to Claude.
In other words, the proxy bridges an API-format gap, not a network gap. The endpoint is already reachable. It speaks a different protocol than Claude. You point Claude Code at the proxy with the ANTHROPIC_BASE_URL environment variable, and you point Claude Desktop at the proxy through its third-party inference settings.
This proxy is a minimal example that returns a single, complete JSON response rather than streaming. Claude Code requests streaming by default, and Anthropic’s gateway protocol states that inference responses must stream, since a gateway that buffers the full response before relaying it can stall the client. In practice the example works for short, interactive exchanges, but it can feel unresponsive or hit client timeouts on long outputs, and a future Claude Code release could stop accepting a non-streamed response. For anything beyond a quick trial, run a streaming-capable translation layer such as LiteLLM behind a production WSGI server. See Production considerations.

Serverless or Dedicated Inference

Both inference options work with the same proxy. The difference is the endpoint you target and the credential you use. For background on each option, see About Serverless Inference and About Dedicated Inference.
Both endpoints are already public and reachable. The proxy isn’t exposing them. It exists only to translate between Claude’s Anthropic Messages format and the OpenAI-compatible format the endpoints speak. If your client already speaks the OpenAI API, you can call the endpoint directly and skip this guide.

Prerequisites

  • A W&B account with W&B Inference access.
  • A W&B API key. Find your key at wandb.ai/authorize or under User Settings at wandb.ai/settings.
  • A Claude account with access to Claude Code (CLI) or Claude Desktop.
  • Python 3 with the flask and requests packages installed (pip install flask requests).

Set environment variables

The proxy reads its configuration from environment variables, and Claude Code reads two of its own. Set the proxy variables in the terminal where you run the proxy, and set the Claude Code variables in the separate terminal where you start claude. The proxy doesn’t authenticate clients, so ANTHROPIC_API_KEY can be any non-empty value. Claude Code sends it, but the proxy ignores it and authenticates to CoreWeave with CW_API_TOKEN instead. The following variables are optional: Set the proxy variables for your inference option:
Verify that the endpoint variable is set:

Verify connectivity

Before configuring Claude, confirm that your endpoint is reachable and that your credential works.
List the available models to validate your credential and choose a model to serve:
The response lists the model IDs available in the W&B Inference catalog. Replace [MODEL-NAME] with a model ID from the response, for example moonshotai/Kimi-K2.7-Code, then set and confirm it:
For the current list of models, see the W&B Inference models documentation.

Create the translation proxy

Create a file named openai_to_anthropic_proxy.py with the following contents. The proxy exposes the Anthropic Messages API endpoints that Claude calls (/v1/messages, /v1/messages/count_tokens, and /v1/models) and forwards translated requests to your CoreWeave endpoint. Expand the following panel to view the full proxy.

Run the proxy

The proxy reads all configuration from environment variables at startup, so set them in the same terminal before launching it. Run the proxy in its own dedicated terminal and leave it running. You use a separate terminal to start Claude in a later step.

Optional: disable tool calls

If your deployment doesn’t support tool calling, instruct the proxy to strip tools from Claude requests:
Agentic workflows may still attempt to invoke tools. When CW_USE_TOOLS=false, the proxy removes tool definitions and tool calls before requests reach the inference endpoint. For a fuller Claude experience, enable tool support whenever your deployment allows it. On Dedicated Inference, tool calling requires a model and deployment configured for it. See the enable-auto-tool-choice and tool-call-parser options in Models and deployments.

Start the proxy

Set the advertised model name if you plan to use Claude Desktop, then start the proxy:
On startup, the proxy prints its registered routes and then the Flask startup banner:
The proxy is now listening for Anthropic-compatible requests on http://127.0.0.1:4000.

Confirm the proxy is running

Query the proxy’s health endpoint to confirm it is up and reporting the configuration you expect:
The response reports the target model, the advertised model, and whether tool support is enabled:

Keep the proxy online across sessions

To avoid re-exporting variables each time, use a startup script or a terminal multiplexer.
Create start_proxy.sh:
Make it executable and run it:

Configure Claude Code

In a second terminal, separate from the one running the proxy, point Claude Code at the local proxy and start it:
Claude Code may display an unexpected model name. This is expected. Claude Code shows a standard Claude model name while the proxy routes requests to your CoreWeave model. Confirm the routing by watching the proxy logs.

Configure Claude Desktop

Claude Desktop connects to the proxy through its third-party inference settings. First enable Developer Mode for your operating system, which restarts the app and adds a Developer menu, then configure the gateway connection, which is the same on every platform.
  1. Launch Claude Desktop:
  2. In the menu bar, open Help > Troubleshooting, then select Enable Developer Mode.
With Developer Mode enabled, configure the gateway connection. These steps are the same on every platform:
  1. Open Developer > Configure third-party inference.
  2. Set the inference provider to Gateway and configure the connection:
    Claude Desktop third-party inference Connection panel set to Gateway with a static API key, base URL http://127.0.0.1:4000, and bearer auth scheme

    The gateway connection settings pointing at the local proxy

  3. Save the configuration, then click Test model discovery. A green result confirms that Claude Desktop reached the gateway and discovered the advertised model.
    Claude Desktop model discovery test returning a green result that found one model from the proxy

    A successful model discovery test against the proxy

  4. Start a new conversation.

Model name compatibility

Claude Desktop validates gateway model identifiers against Anthropic naming conventions, and it builds its model picker by calling the gateway’s GET /v1/models endpoint. The proxy satisfies this by advertising a Claude-style model name while forwarding requests to your CoreWeave model. Set the advertised name before starting the proxy:
The advertised model metadata is defined in the proxy’s /v1/models route, where you can customize the model name, context window, thinking support, vision capabilities, and tool calling support.

Validate

After configuration, verify that requests reach your CoreWeave endpoint.

Claude Code

Ask a question that doesn’t depend on the model identifying itself, such as Can you tell me what CoreWeave is?. Then confirm that the request appears in the proxy logs and receives a valid response.
Avoid asking the model which model it is. Open models often answer incorrectly even when routing works correctly, so the answer isn’t a reliable check.
A Claude Code CLI session answering a coding question routed through the proxy to CoreWeave Inference

Claude Code answering through the proxy

Claude Desktop

In Developer > Configure third-party inference, click Test model discovery. A green result confirms that the gateway is reachable. Then open a new conversation and submit a prompt. Confirm that:
  • Responses are generated successfully.
  • Requests appear in the proxy logs.
  • Inference traffic reaches your CoreWeave endpoint.
A Claude Desktop conversation generating a response routed through the proxy to CoreWeave Inference

Claude Desktop generating a response through the proxy

If both clients respond successfully, the integration is complete.

Troubleshooting

The following sections describe common issues and how to resolve them.

403 response with error code 1010

A 403 response with error code: 1010 is an edge security block triggered by the default User-Agent of the requests library. Set a custom User-Agent and restart the proxy:

Serverless authentication errors

If Serverless Inference returns an authentication error related to your organization, set your W&B team and project, then restart the proxy:

Endpoint or model changes

The proxy reads configuration only at startup. Whenever you change CW_GATEWAY_ENDPOINT, CW_API_TOKEN, CW_MODEL_NAME, or CW_USE_TOOLS, restart the proxy process. Restart your Claude Code session after the proxy restarts. Claude Desktop reconnects to the configured gateway automatically and typically doesn’t require a restart.

Production considerations

The example proxy is a single-process Flask development server that returns complete responses rather than streaming them. Before serving multiple users or production traffic:
  • Run the proxy behind a production-grade WSGI server.
  • Use a streaming-capable translation layer so Claude Code can stream responses.
  • Enable tool calling if your deployment supports it.
  • Customize the advertised model capabilities to match your model.

Clean up

To revert to a standard Claude configuration, unset the environment variables and stop the proxy. For Claude Desktop, turn off third-party inference in Developer > Configure third-party inference.
Last modified on July 9, 2026