Skip to main content

CLAUDE.md — Legnext API Docs

Guidance for working in this repository.

What this is

The public API documentation for Legnext (the Midjourney API platform).
  • Tooling: Mintlify — config in docs.json (theme mint), content in .mdx.
  • Published to: https://docs.legnext.ai
  • Repo: github.com/legnext-ai/docs (origin/main). Mintlify auto-deploys on push to main.
  • ⚠️ This is the only live docs repo. github.com/leggiemint/docs (local ~/projects/API/docs) is a stale abandoned clone — do not edit it.

Structure

  • getting-started/ — overview, quickstart, models, image-parameters, video-parameters, output-storage, notice
  • api-reference/ — one .mdx per endpoint (image-generation, video-generation, enhancement, task-management, account-management)
  • sdk/ — per-language guides (csharp, go, java, javascript, php, python, ruby, rust)
  • integrations/ — make, n8n, postman
  • changelog.mdx, docs.json (navigation — nav is explicit; a file not listed here is not linked)

Preview & deploy

mintlify dev        # local preview (or: npx mint dev) — do NOT auto-start; ask Kai or read an already-running port
Deploy = push to main (Mintlify picks it up). Per global rules: don’t auto-push; prefer a new commit over amend.

Sources of truth (do not guess — verify)

  1. Parameter / version / model behavior → the backend: ~/projects/API/Legnext-backend/internal/task/mj_task/ (e.g. version.go for which flags each MJ version accepts) and the provider code under internal/standalone_server/mj/provider/.
  2. Midjourney’s own semantics → local mirror of MJ official docs at ~/projects/saas/midjourney/midjourney-official-docs/ (API-relevant articles only; local reference, not published, not a git repo). Refresh via its scrape script.
When backend and our docs disagree, the backend wins (it’s what actually runs). When our docs and MJ official docs disagree on MJ semantics, MJ official wins.

Known gotchas / lessons

  • --cref is NOT a v7+ parameter. It only works on v6 / v6.1 / niji 6. v7 replaced it with Omni Reference (--oref / --ow); v8.1 drops omni too. Our docs historically mislabeled this (v7 marked ✓ for --cref), which caused a real support ticket — keep the version-support matrix accurate against the backend + MJ official docs.
  • The default model version is v7 (no --v → runs as v7). A param valid only on v6.x will fail upstream with an opaque Invalid prompt format unless the user pins --v 6.1.
  • Keep --oref naming consistent (MJ calls it Omni Reference); avoid the old “Object Reference” / inconsistent “Universal Reference” labels.