Skip to main content

Claude Code

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 Claude Code​

Follow the official Claude Code installation instructions.

2. Connect Divyam and open Claude Code​

Choose the model for your session:

divyam-as/

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

Connection scope

Both options redirect Claude Code's Anthropic Messages connection and background model to Divyam. The session command applies to one launch. Exported variables apply to later launches from the same terminal. Neither option edits your saved Anthropic connection settings or registers a named Divyam provider.

From your project folder, choose an option below in Bash or Zsh. Replace divyam-sw-v1-... with your complete Divyam API key.

claude --settings '{
"env": {
"ANTHROPIC_BASE_URL": "https://api.preview.divyam.ai",
"ANTHROPIC_API_KEY": "divyam-sw-v1-...",
"ANTHROPIC_AUTH_TOKEN": "",
"ANTHROPIC_MODEL": "divyam-as/gpt-6-sol",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "divyam-as/gpt-6-sol",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}'

This command sets the environment for this Claude Code launch.

Claude Code appends /v1/messages to the server origin above, so requests use the API at https://api.preview.divyam.ai/v1. Both options configure the same Divyam model for your conversation and background tasks.

Complete the first-run prompts, approve the API key when asked, and review the project trust prompt.

3. Start a coding task​

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

Review Claude Code's file and command approval prompts as you work.

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.