Skip to main content
Goose is an open-source AI agent from Block that runs as a desktop app and a CLI. It ships a first-class NEAR AI Cloud provider, described in its own docs as “TEE-backed private inference through an OpenAI-compatible API with dynamic model discovery.” Dynamic discovery is the part that matters day to day: Goose asks the gateway for its model list instead of reading a static catalog, so a newly released NEAR AI model shows up in the picker without a config change.
Looking for OpenCode? It now has its own page: OpenCode.

Prerequisites

Goose reads the key from 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:
You do not set this by hand when using the built-in provider. Do not append /chat/completions; Goose adds the path when it calls the API.

Model ID

Use the gateway model ID exactly as /v1/models reports it:
Because Goose discovers models dynamically, the picker should already offer the current list. See Model Discovery and Refresh if you need to confirm an ID.
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

  1. Open Goose.
  2. Open the sidebar, then Settings.
  3. Open the Models tab.
  4. Click Configure providers.
  5. Select NEAR AI Cloud.
  6. Enter your NEAR AI Cloud API key and submit.
  7. Click Switch models, then pick a NEAR AI Cloud model.
If the model you want is not in the dropdown, choose Use custom model and type the model ID.

Goose CLI

Run:
Then select:
  1. Configure Providers
  2. NEAR AI Cloud
  3. Enter your API key, or skip the prompt if NEARAI_API_KEY is already exported.
  4. 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
Prefer goose configure or the Desktop settings over editing this file, so Goose writes the shape its current version expects.
Older guides show flat GOOSE_PROVIDER and GOOSE_MODEL keys at the root of config.yaml. Goose still reads that legacy form and migrates it when it next updates provider settings, but it is not the current format. The same two names remain valid as environment variables, where they override the config file for that process:
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:
  1. Confirm the model exists: curl https://cloud-api.near.ai/v1/models.
  2. Re-save the NEAR AI Cloud provider in Desktop settings, or re-run goose configure, so Goose requests the list again.
  3. Restart Goose.
  4. 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:
Keep 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

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.