Knowledge Base Sections ▾

Navigation

▸ Start here By roles

Categories

Tools 52
Glossary 12

Tools

OpenHands + JoinGonka Gateway: agent on your own endpoint

OpenHands is an open platform for autonomous development: the agent reads the repository itself, runs commands, edits files, and drives a task to completion, while you set the goal and verify the result. In 2026, its primary interface is Agent Canvas, a browser-based console used to initiate conversations with the agent and automation on your own machine, in Docker, on a server, or in the OpenHands cloud. The code is open-source under the MIT license.

OpenHands does not force a specific model: the entire LLM interaction layer is built on LiteLLM, so any OpenAI-compatible endpoint works for the agent. For JoinGonka Gateway, this requires three fields in the settings: Custom Model — openai/deepseek-ai/DeepSeek-V4-Flash-0731, Base URL — https://gate.joingonka.ai/v1, and API Key — your jg-… key. No separate installer is needed: everything is done in the interface in a couple of minutes.

An autonomous agent is the hungriest consumer of tokens: each step carries a system prompt, history, and tool results, and there are dozens of steps in a task. The OpenHands documentation explicitly warns that the agent sends many requests to the model, so keep an eye on consumption. Through the gateway, a million input tokens cost $0.0069 — the same for DeepSeek V4 Flash, GLM-5.3 Flash, and MiniMax M2.7 — so long runs stop being a budget concern. After verifying your email address, 3M free tokens will be credited to your account: this is enough to run the agent on a real task and see your actual consumption.

Which OpenHands do you have: four interfaces and a key

The project currently has several interfaces, and where you look for model settings depends on which one you are running. The values themselves are the same everywhere; only the path to them differs.

InterfaceHow to launchWhere to set the modelStatus as of September 2026
Agent Canvasnpx @openhands/agent-canvas or npm install -g @openhands/agent-canvas and command agent-canvas; opens at http://localhost:8000Settings > LLM, Advanced tabThe project's primary interface
OpenHands CLIuv tool install openhands --python 3.12, then openhandsFirst-run wizard, Ctrl+P → Settings, ~/.openhands/agent_settings.json fileFunctional, but marked as not actively developed in the README
Legacy web interface in Dockeropenhands serve or docker run from the documentation; port 3000Settings → LLM tab → Advanced toggleReferred to as Local GUI (Legacy) in the documentation
OpenHands CloudThe project's managed cloudSame LLM settings pageAccording to documentation, custom LLM is set the same way; we have not tested this path

Agent Canvas requires Node.js and uv — the agent's local server runs on it (details in the setup guide). The guide mentions Node.js 22.12 or newer, but the package itself starting from version 1.17 requires Node.js 24 or newer — install 24 to avoid an incompatible version warning. There is also a container option: the ghcr.io/openhands/agent-canvas image provides the interface at http://localhost:8000/canvas and sees only the directories you have mounted.

JoinGonka Key. Register at gate.joingonka.ai/register, verify your email, and create a key with the jg- prefix in the "API Keys" section. One key and one balance work for all models in the network. The OpenHands installer @joingonka/setup does not list this in its tools, and that is not an oversight: its settings live in the interface and the secure backend storage, not in a text config file that can be edited externally.

Connecting to Agent Canvas: three fields on the Advanced tab

Step 1. Launch Agent Canvas and open Settings > LLM. The first-run wizard suggests the native OpenHands provider — you can skip this step, as you can easily return to the settings later.

Step 2. Click Add LLM Profile and go to the Advanced tab: the Basic tab only offers providers and models from the built-in list.

Step 3. Fill in three fields:

FieldValue
Custom Modelopenai/deepseek-ai/DeepSeek-V4-Flash-0731
Base URLhttps://gate.joingonka.ai/v1
API Keyyour jg-… key

Step 4. Save the profile. Before saving, Canvas verifies the configuration with a backend request: if the key is rejected or the model is unavailable, the profile will not be saved, and you will see an error message.

Step 5. Start a new conversation and send a short message. Conversations already open will continue using the model they were started with.

Why openai/. LiteLLM determines the provider by the model prefix. The openai/ prefix does not mean "OpenAI model," but rather "communicate with the server via the OpenAI Chat Completions protocol." Only the first segment is stripped, so the gateway receives the actual identifier — deepseek-ai/DeepSeek-V4-Flash-0731. OpenHands documentation shows the same scheme using openai/qwen/qwen3.6-35b-a3b as an example. Without the prefix, LiteLLM will refuse to work, returning an LLM Provider NOT provided message.

Why /v1 and nothing more. LiteLLM accesses the server via the official OpenAI client, which automatically appends /chat/completions. Therefore, the address must end with /v1: without the suffix, the request will miss the API; with an extra tail, it will hit a non-existent path. Another Canvas requirement: the address must be accessible from the backend, not just from the browser. The gateway is a public HTTPS address; it is visible from the Docker container just as it is from the host. Techniques like host.docker.internal are only needed for models running on your own machine.

Profiles for all three models. Create a profile for each network model and give them short names — for example deepseek, glm, and minimax (the documentation mentions a limit of ten profiles). You can switch between them directly in the conversation without losing context: by using the profile selection button in the input field or the /model glm command; /model without arguments will display the list. To avoid inserting the key into every profile, you can save it once in the Provider Connections block — it is available on the local backend.

Legacy interface in Docker. The fields are the same: Settings → LLM tab → enable Advanced → Custom Model, Base URL, API Key → Save Changes.

Terminal and automation: CLI, environment variables, SDK

The CLI installs with a single command via uv and on first launch walks you through model setup itself; you can return to it later with Ctrl+P → Settings:

uv tool install openhands --python 3.12
openhands

For scripts, environment variables are more convenient. An important detail: by default the CLI ignores them and applies them only with the --override-with-envs flag — for a single run, saving nothing:

export LLM_MODEL="openai/deepseek-ai/DeepSeek-V4-Flash-0731"
export LLM_BASE_URL="https://gate.joingonka.ai/v1"
export LLM_API_KEY="jg-your-key"

openhands --override-with-envs

The same set works without an interface — for CI and batch tasks:

openhands --headless --override-with-envs -t "Read calc.py and tell me in one sentence whether it has a bug."

In headless mode the agent always acts with auto-approval, so run it where it's allowed to do everything: in a separate directory or container. The --json flag turns the output into a stream of JSONL events — convenient for parsing in a pipeline. That's exactly how we tested the setup on September 21, 2026 on CLI 1.16.0: the CLI header prints Agent initialized with model: openai/deepseek-ai/DeepSeek-V4-Flash-0731, then the agent reads the file and answers substantively.

MethodWhere it appliesIs it saved
Settings > LLM in Agent Canvasall new conversations on this backendyes, in the backend storage (~/.openhands)
The wizard and Ctrl+P → Settings in the CLIall CLI runsyes, in ~/.openhands/agent_settings.json
LLM_MODEL, LLM_BASE_URL, LLM_API_KEY with the --override-with-envs flaga single CLI runno
config.tomlthe older V0 line and development moderelegated to Legacy in the docs; in Agent Canvas and CLI 1.x, settings are set by the methods above

Saved CLI settings live in ~/.openhands/agent_settings.json: the model there is changed by editing three fields of the llm block — model, api_key, and base_url. Don't create the file from scratch: the first-launch wizard also writes the agent's other settings there, including history compression, without which a long conversation will hit the context window.

If you're embedding the agent into your own code, the OpenHands SDK takes the same three values:

from pydantic import SecretStr
from openhands.sdk import LLM

llm = LLM(
    model="openai/deepseek-ai/DeepSeek-V4-Flash-0731",
    base_url="https://gate.joingonka.ai/v1",
    api_key=SecretStr("jg-your-key"),
)

Which model to choose for long autonomous runs

All models in the network have the same price, so the choice comes down to behavior. Two numbers are critical for an autonomous agent. Context window: every step re-sends the history, and the larger the window, the longer the agent can work without data loss. Response ceiling: the step where an agent writes a large file in full must fit within a single response. The table below shows the results of our test running the same task (reading a file and finding an error) via OpenHands CLI 1.16.0 with SDK 1.21.0.

ModelCustom Model for OpenHandsContextResponse ceilingBehavior in OpenHands
DeepSeek V4 Flashopenai/deepseek-ai/DeepSeek-V4-Flash-0731380K32768Read the file and answered to the point, without unnecessary text. Long context and the highest response ceiling in the network make it the default choice for multi-hour tasks
GLM-5.3 Flashopenai/zai-org/GLM-5.3-Flash390K8192Reasons before answering; completed the tool loop cleanly. A profile for planning and parsing complex logic, with the caveat that part of the response is used for reasoning
MiniMax M2.7openai/MiniMaxAI/MiniMax-M2.7200K8192Solved the task, but showed its thought process aloud in the final message. The model has the largest capacity in the network — a backup profile for peak hours and conversation headers

The recommended workflow for long-running tasks follows the OpenHands documentation advice: plan with one model, execute with another. Start the conversation on the glm profile and request a plan without file modifications; then send /model deepseek and give the execution command. History, files, and task state are preserved when switching. Keep the minimax profile as a third option: it is convenient to switch to it when the other two run out of capacity during peak hours, and you can also assign it to generate conversation headers in Settings > Application.

History compression. Even a window of hundreds of thousands of tokens is finite during multi-hour tasks. In OpenHands, this is handled by a condenser: it collapses old events into a brief summary, which, according to the documentation, reduces latency and token consumption in long conversations. In Agent Canvas, it is configured in the Settings > Condenser section; in our CLI run, it enabled itself automatically with a threshold of 80 events.

Model limits. OpenHands retrieves the context window and response ceiling from the LiteLLM directory, which does not contain Gonka network identifiers (we checked on LiteLLM 1.81), so the agent does not have its own pre-set values for these models. This does not interfere with operation: the gateway applies the response ceiling itself, according to the table above. If you want to set limits explicitly, these are the max_input_tokens and max_output_tokens fields in the SDK, and in Canvas, the All tab opens the full set of profile fields. Details about the default model are available in the DeepSeek V4 Flash overview.

Verification and common errors

You can verify that requests are actually going through the gateway from two sides. From the OpenHands side: start a new conversation and give a short task, like "read the README and summarize in one sentence": the agent must call a tool and respond. From the gateway side: go to your dashboard, "Usage" section: the request will appear in the "By model" breakdown, and the last request time will update in the "By keys" section. If it's empty, the conversation is taking place on another profile: check which one is marked as active.

What you seeWhat it meansWhat to do
LLM Provider NOT providedThe model field is missing the provider prefixEnter openai/ before the identifier: openai/deepseek-ai/DeepSeek-V4-Flash-0731
Profile won't save, Canvas shows backend errorCanvas verified the configuration with a live request and received a rejectionThe error text is one of the lines below: fix the key, address, or model and save again
AuthenticationError … Invalid API keyThe gateway responded with 401: key not acceptedPaste the entire key without extra spaces; check in the dashboard that it hasn't been revoked
405 Not Allowed and an nginx HTML pageThe Base URL is missing the /v1 suffixThe address must be exactly https://gate.joingonka.ai/v1
404 … Invalid URL (POST /v1/v1/chat/completions)The Base URL has an extra tail: a second /v1 or the full /chat/completions pathLeave only /v1 — LiteLLM appends the path itself
400 … Model "…" not found. Available: …The identifier after openai/ does not match any network modelThe gateway lists available models itself; full list — GET https://gate.joingonka.ai/v1/models
429The key has exhausted its per-minute request limit, or the model is at peak capacityOpenHands retries the request with an increasing backoff. If it takes too long, switch the profile with the /model command; network status is visible on the status page
402Insufficient funds on balanceTop up your account in the "Billing" section; the key remains active
Agent acts like a chatbot: does not touch files, confuses tool callsThe model cannot handle the agent loop; OpenHands documentation advises changing the model in this caseSwitch to the DeepSeek V4 Flash profile — in our test run, it passed the agent loop without issues

According to OpenHands documentation, the number of retries and pauses between them during 429 errors are configured via LLM_NUM_RETRIES, LLM_RETRY_MIN_WAIT, and LLM_RETRY_MAX_WAIT variables. Default values in documentation and SDK differ, so rely on the actual ones: in the CLI 1.16.0 conversation state, we observed 5 attempts with pauses ranging from 8 to 64 seconds.

How much it costs and what to consider

Via JoinGonka Gateway, tokens cost $0.0069 per million for input and $0.021 per million for output — the price is identical for all network models and is pulled onto this page from a live source.

ScenarioConsumptionVia Gateway
One-time task: analyze a file, apply a fixtens of thousands of tokensfractions of a cent
Autonomous feature development20-50M tokenstens of cents
24h of background automations~150M tokensabout a dollar

Estimates in the right column are based on September 2026 prices; how agent economics works is explained in detail in the article about the cheapest API for AI agents.

Spending cap. OpenHands advises setting spending limits — the gateway has this built into the payment model: the balance is prepaid, and the agent will not spend more than what is on the account. Remaining balance and daily consumption are visible in the dashboard. For CI and background automations, create a separate key so their consumption doesn't mix with yours; sub-keys with daily limits are described in the article about Management Keys.

Trust boundary. Agent Canvas, launched via npm, runs with your user permissions and can see the entire file system. For third-party code, use the Docker version: the agent will only see the mounted directory. This is a property of OpenHands itself; it does not depend on the model provider.

Correspondence stays with you. OpenHands stores conversation history locally in ~/.openhands and sends it to the model at each step; the gateway does not store the correspondence — your prompts and code are not retained after the response.

If the task includes images — interface screenshots, diagrams — create a separate profile for it with a vision-capable model: Gonka network models are text-only. This is not a limitation for code, commands, and files.

OpenHands connects to JoinGonka Gateway using three fields: Custom Model openai/deepseek-ai/DeepSeek-V4-Flash-0731, Base URL https://gate.joingonka.ai/v1, and the jg-… key. In Agent Canvas, this is under the Advanced tab in Settings > LLM; in the CLI, use the configuration wizard or set LLM_MODEL, LLM_BASE_URL, and LLM_API_KEY environment variables with the --override-with-envs flag; config.toml remains from the previous series. The openai/ prefix selects the protocol, not the vendor, and the /v1 suffix is mandatory. Live runs confirmed the agentic loop on all three network models: by default, use DeepSeek V4 Flash with 380K context and up to 32768 tokens for the response, GLM-5.3 Flash for planning, and MiniMax M2.7 as a backup profile for peak hours.

Want to learn more?

Explore other sections or start earning GNK right now.

Get key and free tokens →