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
- Log in to your DMS Lab dashboard
- Navigate to Settings > API Keys
- 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 ID | Context Window | Best For |
|---|---|---|
qwen3.5-397b | 1M tokens | General reasoning, analysis |
qwen3-coder | 256K tokens | Code generation, refactoring |
qwen3.5-397b-fast | 128K tokens | Low-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_URLincludes the/v1suffix and your API key has no trailing whitespace.
For more details, check our API documentation or reach out to support.
