nearai / nearai/cloud-api

OpenAPI spec documents endpoints that 404: /v1/model/{model_name}; two parallel list endpoints

Open
#650 4 comments 0 reactions 1 assignee View on GitHub

@lloydmak99 is already working on this.

Since Jun 10, 2026.

bug documentation
Dominant language
Rust
Stars
8
Forks
8
Avg merge
1d 21h
Merged PRs (30d)
36

Description

Summary

The publicly-served OpenAPI spec at https://cloud-api.near.ai/api-docs/openapi.json documents endpoints that don't actually exist. A client generated from the spec hits bare 404.

Spec lies / unimplemented endpoints

GET /v1/model/{model_name} — documented but returns 404 size=0
curl -s -w "HTTP %{http_code} size=%{size_download}\n" \
  -H "Authorization: Bearer $KEY" \
  "https://cloud-api.near.ai/v1/model/openai/gpt-oss-120b"
# HTTP 404 size=0

Even though the spec lists this path with a documented schema (in paths.[/v1/model/{model_name}].get), the actual gateway returns a bare 404 — same family as #614.

Inconsistencies between spec and runtime

Two parallel model list endpoints
  • GET /v1/models — works, OpenAI-compat shape ({object: "list", data: [...]})
  • GET /v1/model/list — works, custom shape ({models, limit, offset, total})

Both are documented in the spec. The custom endpoint supports pagination; the OpenAI-compat one doesn't (silently ignores ?limit=). Two parallel endpoints with different shapes is confusing — pick one.

Inconsistent /v1 prefix

The spec documents:

  • POST /conversations/{conversation_id}/archive (no /v1 prefix)
  • GET /v1/conversations/{conversation_id} (has /v1 prefix)

Five /conversations/... paths are documented without the /v1 prefix; the rest have it. Probably a routing bug that landed in spec generation. (Didn't actually hit these — couldn't auth as a real user.)

Health version vs spec version disagree

/v1/health reports "version":"0.0.0" (already filed in #647), but the OpenAPI spec at /api-docs/openapi.json declares info.version: "1.0.0". Both should be the same source of truth.

Same raw-422 envelope-bypass as #609

POST /v1/score with missing model field returns:

HTTP 422
Failed to deserialize the JSON body into the target type: missing field `model` at line 1 column 13

Plain text, not the standard JSON envelope. Same pattern as /v1/rerank in #609 and frequency_penalty="oops" noted in #622.

Suggested fix

  1. Either implement GET /v1/model/{model_name} or remove it from the spec.
  2. Pick one list endpoint surface (/v1/models for OpenAI-compat OR /v1/model/list for custom-paginated) and deprecate the other; don't ship both.
  3. Add the /v1/ prefix to the /conversations/... paths so the prefix is consistent.
  4. Source /v1/health.version from the same value as info.version in the OpenAPI spec.
  5. Apply the JSON envelope error handler to POST /v1/score too (same as #609 fix).

/api-docs/openapi.json itself works correctly (200, 206 KB, OpenAPI 3.1) — a good resource if it can be made source-of-truth.


Found during routine cloud-api smoke test.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.