Skip to main content

Qwen Code

Connect Qwen Code to Divyam for file edits and project commands.

Before you start

You need a Divyam account and an API key. If you don't have them yet, follow Getting Started first.

Replace the shortened divyam-sw-v1-... shown in examples with your complete API key.

The examples use divyam-as/gpt-6-sol. For another model, select its current ID in your harness or copy it from Models and pricing, and check its context limit and supported features.

1. Install Qwen Code​

Follow the official installation instructions.

Set your key in the shell you will use to start the app:

export DIVYAM_API_KEY="divyam-sw-v1-..."

2. Configure Divyam​

divyam-as/

Model ID: divyam-as/gpt-6-sol. Context window: 1,050,000 tokens. Models and pricing

Merge these settings into ~/.qwen/settings.json:

{
"security": {
"auth": {
"selectedType": "openai"
}
},
"model": {
"name": "divyam-as/gpt-6-sol"
},
"modelProviders": {
"openai": [
{
"id": "divyam-as/gpt-6-sol",
"baseUrl": "https://api.preview.divyam.ai/v1",
"envKey": "DIVYAM_API_KEY",
"generationConfig": {
"contextWindowSize": 200000,
"toolResultContentFormat": "string",
"samplingParams": {
"max_tokens": 8192
}
}
}
]
}
}

The model uses your exported key. Keep toolResultContentFormat: "string" so Divyam receives file and command results as text. The generation settings above keep the context limit, output budget and tool-result format together.

3. Send your first prompt​

Start Qwen Code from the shell where you exported the key:

qwen
In Qwen Code's composer
Hello, what are your capabilities?
Paste this message, then send it.

Attach a local image with @path/to/image.png in your prompt. Run /compress to condense earlier messages.

Check your requests​

Open the Divyam console and select Logs. Your requests appear there within a few seconds, newest first, with their status, token counts and latency. Usage and Credits & Billing catch up within a few minutes.

Local cost estimates

Some clients display zero when model prices are missing. Check Credits & Billing for Divyam charges. Local dollar limits depend on the client's price and usage data.

For filters, cached-token counts and the requested-versus-routed view, see Logs and usage.