repos

Generate Docs For Repo

Generate AI documentation for a repo's latest snapshot.

The "adopt-docs" entrypoint: a paying viewer can produce docs for a public repo that someone else indexed without docs. Requires Pro or Admin (free tier rejected upstream by _gate_docs_credit_hold).

Behaviour:

  • Public repo + caller already in user_repos → re-uses the existing link.
  • Public repo + caller not yet linked → upserts a user_repos row pointing at the latest ready snapshot before charging the hold; lets the new viewer see the repo on their dashboard.
  • Private repo + caller not in user_repos → 404 (adopt does not bypass GitHub-App access control).
  • Latest ready snapshot already has docs_artifact_path → short-circuit, no Modal job, no charge. Caller gets the existing snapshot and a fresh user_repos link.
  • Otherwise → runs the existing reindex pipeline with generate_docs=True (parse is fast; the LLM is the cost the caller is paying for).
post/repos/{repo_id}/generate-docs

Path parameters

repo_idstring required

Request body

docs_file_percentagenumber
wiki_style'comprehensive' | 'caveman' | 'reference' | 'tutorial' nullable
docs_language'en' | 'ru' | 'es' | 'fr' | 'de' | 'zh' | 'ja' | 'ko' | 'it' | 'pt' | 'nl' | 'pl' | 'tr' | 'ar' | 'hi' nullable

Response

Successful Response

snapshot_idstring required
short_idstring required
status'queued' | 'indexing' | 'ready' | 'failed' required
cachedboolean required

Changes

No recorded changes to this endpoint across all 1 revision of this API.