Skip to main content
NEAR AI Cloud exposes an OpenAI-compatible API, so Aider and Zed can use NEAR AI models with a base URL, an API key, and a model ID. Use the gateway by default: Create an API key from the NEAR AI Cloud Dashboard. Do not paste API keys into shared files, docs, issue comments, or screenshots.

Aider

Aider uses OpenAI-compatible endpoints through the standard OpenAI environment variables. Set them in the shell that starts Aider:
Then run Aider with the openai/ model prefix:
To refresh the model, update the command-line model string. For example, after confirming a new model ID from /v1/models, replace openai/z-ai/glm-5.2 with openai/<new-model-id>. If Aider warns that it does not recognize a new model, first confirm the model works with the curl smoke test below. Aider may need a model metadata update before it can infer limits for a newly released model.

Optional: set limits and enable reasoning for Aider

Aider does not auto-detect limits or reasoning for an unknown model ID, so it falls back to generic defaults and may print Warning ...: Unknown context window size and costs, using sane defaults. These steps are optional — basic chat and tool calls work without them — but they fix the warning and expose GLM 5.2’s thinking. Both files key on the exact --model string, so use openai/z-ai/glm-5.2. Set the limits in .aider.model.metadata.json and pass it with --model-metadata-file:
.aider.model.metadata.json
Allow the reasoning options in .aider.model.settings.yml and pass it with --model-settings-file:
.aider.model.settings.yml
accepts_settings only allow-lists the reasoning options for this model; it does not turn reasoning on by itself. To actually request reasoning you must also pass --reasoning-effort on the launch command, which Aider sends as extra_body.reasoning_effort for an openai/-prefixed model:
The model name in both files must match the --model string exactly, or the entries are ignored.

Zed

Zed supports custom OpenAI-compatible providers. Add NEAR AI Cloud to Zed from Agent Settings with agent: open settings, or add the provider to settings.json and keep the API key in Zed’s provider settings UI, the system keychain, or an environment variable. Do not store API keys in settings.json. For provider id nearai, Zed’s generated environment variable is:
Add this provider config to Zed’s settings.json:
settings.json
reasoning_effort is what makes Zed expose GLM 5.2’s thinking: if you omit it, Zed treats the model as non-thinking and shows no thinking toggle or effort variants in the agent panel. GLM 5.2 advertises reasoning in /v1/models, and it is a Z.AI model, for which Zed’s docs recommend xhigh. Valid values are none, minimal, low, medium, high, and xhigh. Tool calling does not need a flag here — Zed defaults openai_compatible model capabilities.tools to true. To refresh models in Zed, add or update entries in available_models, then restart Zed or reselect the provider in the model picker. If you used Agent Settings instead of editing JSON, open the NEAR AI provider entry and update the model ID and context window there. Use https://cloud-api.near.ai/v1 as the provider API URL. Do not paste the full chat-completions route into Zed’s API URL field.

Curl smoke test

Verify the model is listed:
Then verify a chat completion:
If you only set OPENAI_API_KEY for Aider, either export NEARAI_API_KEY="$OPENAI_API_KEY" before running the curl command or replace $NEARAI_API_KEY with $OPENAI_API_KEY in the Authorization header.

Troubleshooting

Sources Checked

Sources checked on 2026-06-23: