Skip to main content

OpenHands CLI

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.

Use OpenHands CLI with Divyam in your project.

1. Install OpenHands CLI​

Follow the official installation instructions.

Start the CLI in your project folder:

openhands
Saved agent connection

Saving these values changes the saved local agent's main and condenser LLM connections to Divyam. Later launches read them from ~/.openhands/agent_settings.json. The openai/ prefix selects LiteLLM's OpenAI-compatible adapter. This configures the agent without registering a separate provider named Divyam.

In Settings, choose Advanced under Settings Mode and enter:

divyam-as/

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

  • Custom Model: openai/divyam-as/gpt-6-sol
  • Base URL: https://api.preview.divyam.ai/v1
  • API Key: your Divyam API key

Choose Save, then press Ctrl+C before sending a task. If OpenHands is already configured, open /settings first.

2. Set message handling​

Merge these fields into ~/.openhands/agent_settings.json, preserving its other fields:

{
"llm": {
"reasoning_effort": null,
"force_string_serializer": true
},
"condenser": {
"llm": {
"reasoning_effort": null,
"force_string_serializer": true
}
}
}

force_string_serializer sends command results as text. The Settings form saves the connection. Keep these serializer and reasoning overrides for both model sections.

3. Start your conversation​

Reopen the normal terminal UI from your project folder:

openhands
In OpenHands CLI's composer
Hello, what are your capabilities?
Paste this message, then send it.
Images

For an image-capable model, set llm.force_string_serializer to false in ~/.openhands/agent_settings.json, then reopen OpenHands and ask it to view your image file. Keep condenser.llm.force_string_serializer set to true.

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.