Looking for OpenCode? It now has its own page: OpenCode.
Prerequisites
- Goose Desktop or the Goose CLI installed.
- A NEAR AI Cloud API key from the NEAR AI Cloud Dashboard.
NEARAI_API_KEY. Export it, or let Goose store it when you configure the provider:
Base URL
The NEAR AI Cloud provider already targets the gateway:/chat/completions; Goose adds the path when it calls the API.
Model ID
Use the gateway model ID exactly as/v1/models reports it:
Retired NEAR AI model IDs are kept as aliases onto their successor, so an older ID such as
z-ai/glm-5.2 still resolves today. Prefer the canonical ID from /v1/models; an alias can be repointed without notice.Configure
Goose Desktop
- Open Goose.
- Open the sidebar, then Settings.
- Open the Models tab.
- Click Configure providers.
- Select NEAR AI Cloud.
- Enter your NEAR AI Cloud API key and submit.
- Click Switch models, then pick a NEAR AI Cloud model.
Goose CLI
Run:- Configure Providers
- NEAR AI Cloud
- Enter your API key, or skip the prompt if
NEARAI_API_KEYis already exported. - Select a model.
Config file
Goose keeps provider settings in~/.config/goose/config.yaml on macOS and Linux, or %APPDATA%\Block\goose\config\config.yaml on Windows. Current versions use nested active_provider and providers keys:
config.yaml
goose configure or the Desktop settings over editing this file, so Goose writes the shape its current version expects.
Restart Goose after changing the provider or model.
Refresh models
Goose queries NEAR AI Cloud for its model list, so new models normally appear on their own. If the picker looks stale:- Confirm the model exists:
curl https://cloud-api.near.ai/v1/models. - Re-save the NEAR AI Cloud provider in Desktop settings, or re-run
goose configure, so Goose requests the list again. - Restart Goose.
- If it still does not appear, use Use custom model in Desktop or set the model directly in
config.yaml.
Quick test
Verify the key, base URL, and model against the API before debugging Goose:max_tokens generous on reasoning models. GLM 5.3 Flash spends its first tokens on reasoning_content, so a tight limit returns "content": null with "finish_reason": "length" and looks like a failure when the request actually succeeded.
Troubleshooting
Related guides
- OpenCode
- Model Discovery and Refresh
- OpenAI Compatibility
- Available Models
- Cline, Roo Code, and Kilo Code
Sources Checked
Sources checked on 2026-09-22. The Goose steps come from Goose’s published documentation and repository; they were not run against a local Goose install.- Goose providers — NEAR AI Cloud provider and
NEARAI_API_KEY - Goose configuration files —
config.yamllocation,active_provider/providersshape, legacy key migration documentation/docs/getting-started/providers.md— provider table entry- NEAR AI Cloud
GET /v1/modelsandPOST /v1/chat/completions