Skip to main content
Cline, Roo Code, and Kilo Code can use NEAR AI Cloud through OpenAI-compatible provider settings. They share the same gateway base URL and model IDs, but their model refresh behavior differs. Use these values unless you have a tool-specific reason to choose a different model:

Prerequisites

  • A NEAR AI Cloud API key stored in the tool’s secret field, keychain, or an environment variable such as NEARAI_API_KEY.
  • A Cline, Roo Code, or Kilo Code install that supports custom OpenAI-compatible providers.
  • The current model ID from Model Discovery if you are not using z-ai/glm-5.2.

Base URL

For provider configuration fields, use the gateway base URL:
Do not paste the full chat completions request URL into a base URL field. The tools append the request path themselves.

Model ID

Use z-ai/glm-5.2 as the model ID. Copy model IDs exactly as returned by:

Configure Cline

In Cline settings, configure the provider with: After saving, run a small prompt in Cline. If the model is not listed, enter the model ID manually. Cline’s OpenAI Compatible provider also has a collapsible Model Configuration section. It is optional for basic chat, but recommended so Cline budgets context correctly instead of using its generic defaults (context window 128000, max output unset): set Context Window Size to 500000 and Max Output Tokens to 131072 (from /v1/models). To use GLM 5.2’s thinking, set the Reasoning Effort selector (low/medium/high).

Configure Roo Code

In Roo Code settings, configure the provider with: Roo Code requires native OpenAI tool calling. If the selected model or provider path does not support OpenAI-compatible tool calls, Roo Code will fail tool-use workflows even if basic chat requests work. Choose a NEAR AI Cloud model whose /v1/models record includes tool support when you need Roo Code’s coding-agent tools. GLM 5.2 lists tools in /v1/models, and Roo forwards the OpenAI tools array to OpenAI-compatible endpoints regardless of any per-model flag, so no extra capability toggle is needed for tool use. Roo Code’s OpenAI Compatible provider also exposes custom-model fields under Model Configuration. They are optional, but recommended for correct context budgeting: set Context Window Size to 500000 and Max Output Tokens to 131072 (from /v1/models). To use GLM 5.2’s thinking, check Enable Reasoning Effort and pick a level (low/medium/high/xhigh).

Configure Kilo Code

Kilo Code supports a custom provider flow. In the Providers tab, add a custom provider with: When the base URL is valid, Kilo can auto-fetch models from NEAR AI Cloud’s OpenAI-compatible /v1/models endpoint. If auto-fetch does not show the model, add z-ai/glm-5.2 manually with display name GLM 5.2. If you use Kilo’s config file for a manual model, keep the provider ID and model ID aligned:
Use fresh limits from /v1/models if NEAR AI Cloud changes model metadata.

Refresh models

When NEAR releases a new model:
  1. Run curl https://cloud-api.near.ai/v1/models and copy the new id.
  2. In Cline, paste the ID into the OpenAI Compatible model field if the picker does not show it.
  3. In Roo Code, paste the ID into the OpenAI Compatible model field and confirm the model supports native OpenAI tool calling before using agent workflows.
  4. In Kilo Code, re-save the nearai provider so it auto-fetches from /v1/models; if the model is still missing, add the ID manually in the provider’s model list or kilo.jsonc.

Quick test

Before debugging tool settings, verify the NEAR AI Cloud gateway and model:
Then test a chat completion:

Troubleshooting

Sources Checked

Sources checked on 2026-06-23: Cline OpenAI Compatible provider docs, Roo Code OpenAI Compatible provider docs, Kilo Code OpenAI Compatible provider docs, Kilo Code custom models docs, and NEAR AI Cloud /v1/models.