Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
831a91b
docs: refresh Cloud verification guides
hanakannzashi Aug 24, 2026
eaa281a
Clarify Compose Manager provenance checks
hanakannzashi Aug 24, 2026
f113c40
docs: split Cloud API and direct verification flows
hanakannzashi Aug 24, 2026
d7f0b31
docs: name the NEAR AI Cloud gateway
hanakannzashi Aug 24, 2026
5780840
docs: make verification guides task-oriented
hanakannzashi Aug 24, 2026
147a9d5
docs: refer to inference endpoints
hanakannzashi Aug 25, 2026
b5b5516
docs: remove redundant direct report caveat
hanakannzashi Aug 25, 2026
205fa56
docs: clarify safe provenance support details
hanakannzashi Aug 25, 2026
e68dd60
docs: remove unsupported provenance caveat
hanakannzashi Aug 25, 2026
e4aac76
docs: scope gateway model verification to NEAR
hanakannzashi Aug 25, 2026
4337b96
docs: clarify model-provider verification scope
hanakannzashi Aug 25, 2026
fd5dcf2
docs: simplify verification entry guidance
hanakannzashi Aug 25, 2026
9251018
docs: simplify model attestation navigation
hanakannzashi Aug 25, 2026
d68852c
docs: simplify verification prose
hanakannzashi Aug 25, 2026
cbefc6d
docs: align verification guides with latest flows
hanakannzashi Sep 2, 2026
9eb1b3a
docs: sync OpenAPI from staging
hanakannzashi Sep 4, 2026
8060809
docs: add verification SDK installation
hanakannzashi Sep 4, 2026
1be96bb
docs: align SDK verification flow
hanakannzashi Sep 4, 2026
c457fc7
docs: align manual verification flow
hanakannzashi Sep 4, 2026
204ee48
docs: complete verification guidance
hanakannzashi Sep 9, 2026
93474c4
docs: support multiple model attestations
hanakannzashi Sep 9, 2026
bb1d86b
docs: remove deployment control evidence
hanakannzashi Sep 9, 2026
4dc7ca3
docs: remove deprecated verifier reference
hanakannzashi Sep 10, 2026
3afac5a
docs: rename inference SDK packages
hanakannzashi Sep 17, 2026
f1a8bbc
docs: add inference SDK tutorial
hanakannzashi Sep 21, 2026
7dc9917
docs: separate Cloud and direct SDK usage
hanakannzashi Sep 21, 2026
548d92f
docs: split SDK endpoint guides
hanakannzashi Sep 21, 2026
7d80f15
docs: name Cloud SDK guide after gateway
hanakannzashi Sep 21, 2026
411450b
docs: remove direct SDK page icon
hanakannzashi Sep 21, 2026
b3220e9
docs: add SDK E2EE and OHTTP examples
hanakannzashi Sep 21, 2026
f929337
docs: separate SDK guides from verification
hanakannzashi Sep 22, 2026
b9f5eb7
Revert "docs: sync OpenAPI from staging"
hanakannzashi Sep 23, 2026
7d9e8ed
docs: mark direct endpoints experimental
hanakannzashi Sep 23, 2026
60e4431
docs: remove direct endpoint discovery
hanakannzashi Sep 23, 2026
59412ea
docs: keep OpenCode Gateway-only
hanakannzashi Sep 23, 2026
34af011
docs: address verification review
PierreLeGuen Sep 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/INTEGRATION_GUIDE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ Use the gateway base URL by default:
https://cloud-api.near.ai/v1
```

Only mention direct completions when the tool accepts arbitrary per-model base
URLs. Otherwise, link to Direct Completions instead of adding unverified config.
Use the Gateway in new integration guides. Do not add direct-completions
configuration or links; direct endpoints are experimental and are not
recommended for new integrations.

### Model ID

Expand Down Expand Up @@ -109,7 +110,6 @@ Link to canonical NEAR AI Cloud docs instead of repeating long explanations:

- OpenAI Compatibility: `/cloud/guides/openai-compatibility`
- Model Discovery: `/cloud/guides/integrations/model-discovery`
- Direct Completions: `/cloud/private-inference#direct-completions`
- Available Models: `/cloud/models`

### Sources Checked
Expand Down
209 changes: 110 additions & 99 deletions cloud/guides/e2ee-chat-completions.mdx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cloud/guides/fusion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Use `tool_choice: "required"` when you want Fusion to run immediately. If you om

| Field | Required | Description |
|-------|----------|-------------|
| `analysis_models` | Yes* | Panel models to ask before synthesis. Required unless the deployment configures `FUSION_DEFAULT_ANALYSIS_MODELS`. Model names may include or omit a leading `~`; NEAR AI strips it before direct endpoint lookup. |
| `analysis_models` | Yes* | Panel models to ask before synthesis. Required unless the deployment configures `FUSION_DEFAULT_ANALYSIS_MODELS`. Model names may include or omit a leading `~`; NEAR AI ignores the prefix when resolving the model. |
| `model` | No | Judge model. Defaults to the request `model` when omitted. |
| `max_tool_calls` | No | Maximum inner web-search tool calls for panel and judge requests. |
| `max_completion_tokens` | No | Token cap for panel and judge completions. |
Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/aider-zed.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ If you only set `OPENAI_API_KEY` for Aider, either export `NEARAI_API_KEY="$OPEN
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Continue](/cloud/guides/integrations/continue)
- [Cline, Roo Code, and Kilo Code](/cloud/guides/integrations/cline-roo-kilo)

Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/cline-roo-kilo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ Sources checked on 2026-06-23: Cline OpenAI Compatible provider docs, Roo Code O

- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Available Models](/cloud/models)
- [Continue](/cloud/guides/integrations/continue)
- [Aider and Zed](/cloud/guides/integrations/aider-zed)
Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/continue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ models:
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Cline, Roo Code, and Kilo Code](/cloud/guides/integrations/cline-roo-kilo)
- [Aider and Zed](/cloud/guides/integrations/aider-zed)

Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/cursor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ If curl works, test Cursor with a plain text Chat or Plan prompt. If Cursor fail

- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Available Models](/cloud/models)
- [Continue](/cloud/guides/integrations/continue)
- [Cline, Roo Code, and Kilo Code](/cloud/guides/integrations/cline-roo-kilo)
Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/dify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ If curl fails, fix the NEAR AI Cloud key, model ID, or base URL before changing
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Open WebUI](/cloud/guides/integrations/open-webui)
- [LibreChat](/cloud/guides/integrations/librechat)

Expand Down
2 changes: 1 addition & 1 deletion cloud/guides/integrations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Use the OpenAI client guide when you are configuring code directly. Use the inte

## Model Discovery

NEAR AI Cloud can add new models over time. Use the [Model Discovery guide](/cloud/guides/integrations/model-discovery) to check the current model list, choose between gateway and direct completions endpoints, and copy the right model ID into clients that do not refresh automatically.
NEAR AI Cloud can add new models over time. Use the [Model Discovery guide](/cloud/guides/integrations/model-discovery) to check the current Gateway model list and copy the right model ID into clients that do not refresh automatically.

```bash
curl https://cloud-api.near.ai/v1/models
Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/librechat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ If curl fails, fix the NEAR AI Cloud key, model ID, or network path before chang
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Open WebUI](/cloud/guides/integrations/open-webui)
- [Dify](/cloud/guides/integrations/dify)
- [LiteLLM Proxy](/cloud/guides/integrations/litellm)
Expand Down
1 change: 0 additions & 1 deletion cloud/guides/integrations/litellm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ If curl fails, fix the NEAR AI Cloud key, model ID, or network path before chang
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [LibreChat](/cloud/guides/integrations/librechat)
- [Open WebUI](/cloud/guides/integrations/open-webui)

Expand Down
58 changes: 3 additions & 55 deletions cloud/guides/integrations/model-discovery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Discover current NEAR AI Cloud models and refresh stale client mod
---


Use this guide when a client does not show a newly released NEAR AI Cloud model, or when you need to decide between the gateway model ID and a direct completions endpoint.
Use this guide when a client does not show a newly released NEAR AI Cloud model.

Most tools should use:

Expand Down Expand Up @@ -48,47 +48,14 @@ The response uses OpenAI-style model objects plus NEAR AI Cloud metadata. Import

As checked on 2026-06-23, the live GLM 5.2 gateway record reports `top_provider.context_length: 500000`, `top_provider.max_completion_tokens: 131072`, and `max_output_length: 131072`.

## Discover direct completions endpoints

Direct completions endpoints are listed at:

```bash
curl https://completions.near.ai/endpoints
```

To find the GLM 5.2 direct completions endpoint:

```bash
curl -fsSL https://completions.near.ai/endpoints \
| jq '.endpoints[] | select(.domain == "glm-5-2.completions.near.ai")'
```

As checked on 2026-06-23, that endpoint is:

```text
https://glm-5-2.completions.near.ai/v1
```

The endpoints registry (`GET https://completions.near.ai/endpoints`) lists both `z-ai/glm-5.2` and `zai-org/GLM-5.2-FP8` for this domain, but the endpoint's own `GET https://glm-5-2.completions.near.ai/v1/models` currently returns only `z-ai/glm-5.2`. Use `z-ai/glm-5.2`. The `zai-org/GLM-5.2-FP8` served name still resolves at the direct endpoint, but treat it as a fallback only when your client needs that exact served model name.

## Gateway vs direct completions

Use the gateway by default:
## Use the Gateway

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

The gateway is the best fit for most third-party clients because one base URL can reach the full NEAR AI Cloud model catalog, and clients that auto-fetch models can use `GET /v1/models`.

Use direct completions only when you intentionally want one model's TEE endpoint:

```text
https://glm-5-2.completions.near.ai/v1
```

Direct completions can reduce routing hops and exposes the model-specific route set described in [Private Inference - Direct Completions](/cloud/private-inference#direct-completions). It is not a replacement for the gateway model catalog in clients that expect one provider to list every model.

## Why client model lists go stale

Client model lists can become stale for three common reasons:
Expand All @@ -103,8 +70,6 @@ When NEAR releases a new model, check `https://cloud-api.near.ai/v1/models`, cop
z-ai/glm-5.2
```

If you are configuring a direct completions endpoint, also check `https://completions.near.ai/endpoints` and confirm the endpoint's `models` array includes the model name you plan to send.

## Tool behavior matrix

| Behavior | Tools | Refresh action |
Expand Down Expand Up @@ -137,40 +102,23 @@ curl https://cloud-api.near.ai/v1/chat/completions \
}'
```

Use the direct completions endpoint only after confirming it lists the model:

```bash
curl -fsS https://glm-5-2.completions.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
}'
```

## Troubleshooting

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| model not listed | The client cached an older model list, uses a catalog that has not updated, or requires manual config. | Run the `/v1/models` curl check, copy `z-ai/glm-5.2`, and paste it into the client's custom model field. Re-save, reconnect, or restart the client. |
| `401` | Missing, invalid, or expired NEAR AI Cloud API key. | Generate or copy a NEAR AI Cloud API key, store it in the client's secret field or environment variable, and retry without logging the key. |
| Wrong base URL includes `/chat/completions` | The client expects a base URL, but the full request endpoint was pasted. | Use `https://cloud-api.near.ai/v1` for gateway config, or `https://glm-5-2.completions.near.ai/v1` for direct completions config. Do not append `/chat/completions` to a base URL field. |
| Wrong base URL includes `/chat/completions` | The client expects a base URL, but the full request endpoint was pasted. | Use `https://cloud-api.near.ai/v1`. Do not append `/chat/completions` to a base URL field. |

## Related guides

- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Integrations Overview](/cloud/guides/integrations)

## Sources Checked

Sources checked on 2026-06-23:

- [NEAR AI Cloud models API](https://cloud-api.near.ai/v1/models)
- [NEAR AI Cloud direct completions endpoints](https://completions.near.ai/endpoints)
- [models.dev catalog](https://models.dev/)
1 change: 0 additions & 1 deletion cloud/guides/integrations/open-webui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ If either curl command fails, fix the NEAR AI Cloud key, model ID, or network pa
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [LibreChat](/cloud/guides/integrations/librechat)
- [Dify](/cloud/guides/integrations/dify)

Expand Down
26 changes: 2 additions & 24 deletions cloud/guides/integrations/opencode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: "Configure OpenCode to use NEAR AI Cloud as an OpenAI-compatible pr

[OpenCode](https://opencode.ai/) is a terminal coding agent that resolves its providers from the public [models.dev](https://models.dev/) catalog. NEAR AI Cloud is already in that catalog as the `nearai` provider, so in the common case you do not write a provider block at all: set an API key, point `model` at a NEAR AI model, and OpenCode handles the rest.

You only need a manual provider entry in two cases: the model you want is newer than the catalog, or you want to reach a model's TEE directly instead of going through the gateway. Both are covered below.
You only need a manual provider entry when the model you want is newer than the catalog or your OpenCode version predates the catalog's `nearai` entry. Both cases use the Gateway configuration below.

## Prerequisites

Expand All @@ -33,7 +33,7 @@ The catalog already sets the gateway base URL for the `nearai` provider:
https://cloud-api.near.ai/v1
```

You only set `options.baseURL` yourself when overriding it, for example to use a direct completions endpoint. Do not append `/chat/completions`; OpenCode adds the path when it calls the API.
You only set `options.baseURL` yourself in a full provider block. Do not append `/chat/completions`; OpenCode adds the path when it calls the API.

## Model ID

Expand Down Expand Up @@ -139,26 +139,6 @@ NEAR AI Cloud exposes 50+ models. OpenCode's documented `whitelist` and `blackli
}
```

### Direct completions

To bypass the gateway and connect straight to a model's TEE, override `baseURL` with that model's direct endpoint:

```json opencode.json
{
"$schema": "https://opencode.ai/config.json",
"model": "nearai/z-ai/glm-5.3-flash",
"provider": {
"nearai": {
"options": {
"baseURL": "https://glm-5-3-flash.completions.near.ai/v1"
}
}
}
}
```

A direct endpoint serves exactly one model, so this override applies to the whole `nearai` provider. If you switch between models, keep the gateway base URL instead. See [Direct Completions](/cloud/private-inference#direct-completions).

## Refresh models

OpenCode does not call NEAR AI Cloud's `/v1/models`. Its picker comes from the models.dev catalog, so a newly released NEAR AI model appears only after the catalog updates.
Expand Down Expand Up @@ -216,14 +196,12 @@ opencode run "Reply with only: near-ai-ok"
| OpenCode reports an unknown provider or model | The provider key must be `nearai`, and `model` must be `nearai/<model-id>` — including the slash inside the model ID, as in `nearai/z-ai/glm-5.3-flash`. |
| The model replies but never calls tools | The manual model entry is missing `tool_call: true`. Catalog entries set this; hand-written ones default to off. |
| Replies are empty or truncated mid-thought | A reasoning model hit the output limit. Raise `limit.output` in the model entry to match `max_output_length` from `/v1/models`. |
| A direct completions base URL rejects the model | Each `*.completions.near.ai` endpoint serves one model. Confirm with `curl https://<endpoint>/v1/models` that it advertises the ID you configured. |

## Related guides

- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Goose](/cloud/guides/opencode-goose)
- [Cline, Roo Code, and Kilo Code](/cloud/guides/integrations/cline-roo-kilo)

Expand Down
17 changes: 3 additions & 14 deletions cloud/guides/openai-compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,17 @@ To use the OpenAI SDKs with NEAR AI Cloud, you simply need to override the `base

### Base URL

NEAR AI Cloud offers two base URL options:

**Gateway** (routes to any model):
Use the NEAR AI Cloud Gateway base URL:
```
https://cloud-api.near.ai/v1
```

**Direct Completions** (connects straight to a model's TEE):
```
https://{slug}.completions.near.ai/v1
```

For example, `https://qwen35-122b.completions.near.ai/v1` connects directly to Qwen3.5-122B. See [completions.near.ai/endpoints](https://completions.near.ai/endpoints) for all available endpoints.

Both URLs use the same API key. Direct completions offer lower latency and a simpler trust model since TLS terminates directly in the model's TEE. See [Private Inference — Direct Completions](/cloud/private-inference#direct-completions) for details.

### API Key
You can generate your API key in the [NEAR AI Cloud Dashboard](https://cloud.near.ai/dashboard/organizations).

### Request IDs

Gateway responses from `https://cloud-api.near.ai/v1` and direct completions responses from `https://{slug}.completions.near.ai/v1` include an `X-Request-Id` response header. Support may ask you for this value when debugging a request.
Gateway responses from `https://cloud-api.near.ai/v1` include an `X-Request-Id` response header. Support may ask you for this value when debugging a request.

`X-Request-Id` is opaque support/debugging metadata; it is not W3C `traceparent` or distributed trace context. If you send your own `X-Request-Id`, use a non-sensitive UUID value. `X-Request-Id` values must not contain secrets or PII. `X-Org-Id` and `X-Workspace-Id` are internal tenant headers; public clients cannot set or override them.

Expand Down Expand Up @@ -177,7 +166,7 @@ NEAR AI Cloud supports the following core OpenAI API features:
NEAR AI Cloud also provides non-OpenAI extensions:

- **Reranking** (`/v1/rerank`) - Score documents against a query
- **Privacy classification** (`/v1/privacy/classify`) - Detect personally identifiable information through the gateway, or through a privacy-filter direct completions backend when that backend is selected and available
- **Privacy classification** (`/v1/privacy/classify`) - Detect personally identifiable information through the gateway
- **Privacy redaction** (`/v1/privacy/redact`) - Gateway-only endpoint for redacting personally identifiable information
- **Attestation & Signatures** (`/v1/attestation/report`, `/v1/signature/{chat_id}`) - See [Verification](/cloud/verification)

Expand Down
1 change: 0 additions & 1 deletion cloud/guides/opencode-goose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ Keep `max_tokens` generous on reasoning models. GLM 5.3 Flash spends its first t
- [Model Discovery and Refresh](/cloud/guides/integrations/model-discovery)
- [OpenAI Compatibility](/cloud/guides/openai-compatibility)
- [Available Models](/cloud/models)
- [Private Inference - Direct Completions](/cloud/private-inference#direct-completions)
- [Cline, Roo Code, and Kilo Code](/cloud/guides/integrations/cline-roo-kilo)

## Sources Checked
Expand Down
Loading
Loading