Skip to content
by Unity Nodes
docs.near.aicloud › guides › integrations › continue

NEAR AI Cloud: Continue

Updated 02-11-2026

Configure Continue to use NEAR AI Cloud through its OpenAI-compatible provider.

Use Continue with NEAR AI Cloud by configuring Continue's OpenAI provider with the NEAR AI Cloud gateway base URL and a NEAR AI model ID.

Prerequisites

  • Continue for VS Code, JetBrains, or the Continue CLI.
  • A NEAR AI Cloud API key from the NEAR AI Cloud Dashboard.
  • A local Continue config.yaml.

Store the API key as a Continue secret instead of committing it to the config file. Continue supports apiKey: ${{ secrets.NEARAI_API_KEY }} in config.yaml; it resolves secrets from workspace .env files, .continue/.env, ~/.continue/.env, or process environment variables for the CLI.

For IDE extensions, prefer a .env file because the extension may not read your shell environment. Do not commit .env files.

NEARAI_API_KEY=your-near-ai-api-key

Base URL

Use the NEAR AI Cloud gateway base URL:

https://cloud-api.near.ai/v1

Do not append /chat/completions to apiBase. Continue adds the request path when it calls the OpenAI-compatible API.

Model ID

Use the NEAR AI Cloud gateway model ID:

z-ai/glm-5.2

Check Model Discovery and Refresh when you need the freshest model list.

Configure

Add a model entry like this to Continue's config.yaml:

name: NEAR AI Cloud
version: 0.0.1
schema: v1

models:
  - name: NEAR AI GLM 5.2
    provider: openai
    model: z-ai/glm-5.2
    apiBase: https://cloud-api.near.ai/v1
    apiKey: ${{ secrets.NEARAI_API_KEY }}
    capabilities:
      - tool_use
    contextLength: 500000
    defaultCompletionOptions:
      maxTokens: 131072
      reasoning: true

capabilities: [tool_use] is required for Agent mode. Continue only auto-detects native tool calling for a fixed list of model names (GPT, o-series, and a few others); for a custom model ID like z-ai/glm-5.2 it defaults to no tool support, so you must set tool_use explicitly or Agent mode falls back to a degraded prompt-based tool path instead of native function calling. GLM 5.2 advertises tools in /v1/models, so this is accurate, not aspirational.

The remaining fields are optional metadata that match the live /v1/models record. contextLength: 500000 and maxTokens: 131072 set the context and output budgets. defaultCompletionOptions.reasoning: true tells Continue to display and parse the model's thinking output — with provider: openai it is not added to the request, so it does not turn reasoning on. GLM 5.2 emits reasoning by default server-side, and this flag surfaces it in Continue's thinking pane. Basic chat works without these fields.

Reload Continue after saving the config. In VS Code, use the command palette and run Developer: Reload Window if the model list does not update.

Refresh models

Continue uses the model IDs in your config.yaml; it does not need to discover this model from a provider catalog. When NEAR AI Cloud releases a new model:

  1. Run curl https://cloud-api.near.ai/v1/models.
  2. Copy the new model's id.
  3. Replace or add the model: value in config.yaml.
  4. Reload Continue or restart the IDE if the model picker is stale.

Use the exact model ID from /v1/models. Do not invent aliases unless NEAR AI Cloud lists them.

Quick test

Before debugging Continue, verify the same key, base URL, and model with curl:

curl https://cloud-api.near.ai/v1/chat/completions \
  -H "Authorization: Bearer $NEARAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "z-ai/glm-5.2",
    "messages": [
      {
        "role": "user",
        "content": "Reply with only: near-ai-ok"
      }
    ],
    "max_tokens": 20
  }'

If curl fails, fix the NEAR AI Cloud key, model ID, or network path before changing Continue settings.

Troubleshooting

Symptom Likely cause Fix
model not listed Continue has not loaded the new config.yaml, the model picker is stale, or the model entry was not added to models. Confirm the YAML contains model: z-ai/glm-5.2, save the file, then reload the IDE or restart Continue.
401 The secret is missing, invalid, or not visible to the Continue process. Put NEARAI_API_KEY=... in a workspace .env, workspace .continue/.env, or ~/.continue/.env, then restart the IDE. For the CLI, export the variable before running cn.
Wrong base URL includes /chat/completions The full curl request URL was pasted into apiBase. Set apiBase: https://cloud-api.near.ai/v1. Use /chat/completions only in full request URLs such as the curl smoke test.
Continue calls /responses and the request fails Some OpenAI model families can make Continue use Responses features that require provider-side storage or built-in tools. NEAR AI Cloud supports only stateless Responses. Add useResponsesApi: false to the affected model entry only if logs show Continue is calling /responses; keep it out of the default config.

Example targeted fallback:

models:
  - name: NEAR AI GLM 5.2
    provider: openai
    model: z-ai/glm-5.2
    apiBase: https://cloud-api.near.ai/v1
    apiKey: ${{ secrets.NEARAI_API_KEY }}
    capabilities:
      - tool_use
    useResponsesApi: false

Sources Checked

Sources checked on 2026-06-23: