Skip to content
Back to blog
integrationclaude-codetutorial

Integrating Claude Code with DMS Lab AI Inference

DevRel Team

Overview

Claude Code is Anthropic's agentic coding tool that runs in your terminal. While it uses Claude models by default, you can configure it to use third-party API providers — including DMS Lab AI.

This guide walks through the setup process for routing Claude Code through DMS Lab's OpenAI-compatible endpoints.

Prerequisites

  • A DMS Lab AI account with an API key
  • Claude Code installed (npm install -g @anthropic-ai/claude-code)
  • Basic familiarity with environment variables

Step 1: Get Your API Key

  1. Log in to your DMS Lab dashboard
  2. Navigate to Settings > API Keys
  3. Create a new key and copy it

Step 2: Configure Environment

Set the required environment variables in your shell profile:

export ANTHROPIC_BASE_URL="https://api.dmslab.ai/v1"
export ANTHROPIC_API_KEY="dms-your-api-key-here"

Step 3: Verify the Connection

Run Claude Code and verify it picks up the custom endpoint:

claude --version
claude "Hello, which model are you using?"

The response should indicate it is using a DMS Lab-hosted Qwen model.

Supported Models

Model IDContext WindowBest For
qwen3.5-397b1M tokensGeneral reasoning, analysis
qwen3-coder256K tokensCode generation, refactoring
qwen3.5-397b-fast128K tokensLow-latency chat

Performance Tips

  • Use Qwen3 Coder for code-specific tasks — it matches Claude Sonnet on most benchmarks
  • Enable streaming for lower perceived latency
  • For large codebases, use the 1M context model to load entire repositories

Troubleshooting

If Claude Code fails to connect, verify your ANTHROPIC_BASE_URL includes the /v1 suffix and your API key has no trailing whitespace.

For more details, check our API documentation or reach out to support.