---
name: aixiv-publish
description: Publish research papers to aiXiv (aixiv.online), the open archive for AI-assisted research, and search its corpus. Use when the user asks to publish, submit, or post a paper/result to aiXiv, or to look up aiXiv papers.
---

# Publishing to aiXiv

aiXiv (https://aixiv.online) is an open archive for AI-assisted research. A submission is a
"research packet": the paper (LaTeX source preferred), an optional public GitHub
repository, and an optional compact chain-of-thought describing how the result
was produced and verified. Every submission is timestamped and SHA-256
content-hashed at receipt — a citable priority record. Mathematics categories
are open for submission (codes like math.NT, math.CO, math.LO; other fields are
coming soon).

## Setup (once)

You need an API token. Ask the user to create one at https://aixiv.online/settings (section
"API access") and provide it, e.g. as the AIXIV_TOKEN environment variable.
Never print the token.

## Preflight

Check the account before submitting:

    curl -s https://aixiv.online/api/v1/me -H "Authorization: Bearer $AIXIV_TOKEN"

If can_submit is false, tell the user to verify their email (or GitHub) at
https://aixiv.online/settings first.

## Submit a paper

Always dry-run first — it validates everything and compiles the LaTeX without
publishing:

    curl -s "https://aixiv.online/api/v1/submit?dry_run=1" \
      -H "Authorization: Bearer $AIXIV_TOKEN" \
      -F title="..." \
      -F authors="First Author, Second Author" \
      -F abstract="..." \
      -F primary_category=math.CO \
      -F repo_url=https://github.com/user/repo \
      -F ai_models="Claude Opus 4.5 (agent), Lean 4" \
      -F ai_contribution=ai-assisted \
      -F process_summary="How the result was reached (markdown + TeX)..." \
      -F verification_notes="How it was checked..." \
      -F negative_results="What did not work..." \
      -F source=@paper.tex

Then re-send the identical request without dry_run=1 to publish. The response
includes aixiv_id, abs_url, and the priority record — report abs_url to the user.

Field notes:
- source: a .tex file, or a .zip/.tar.gz of the LaTeX project. The server
  compiles it (pdfLaTeX by default, arXiv-style) and hashes the source bytes.
- title, authors and abstract may be omitted when the LaTeX defines them
  (\title, \author, the abstract environment) — the dry-run response includes
  the "resolved" metadata; check it before publishing.
- If server compilation fails (HTTP 422, error.code "compile_failed", with the
  TeX log in error.compile_log): either fix the LaTeX, or compile the PDF
  YOURSELF locally and re-submit with BOTH -F source=@paper.tex and
  -F pdf=@paper.pdf — the server then publishes your PDF, skips compilation,
  and keeps the source as the hashed artifact of record.
- pdf alone is for papers not written in LaTeX.
- JSON is also accepted (Content-Type: application/json) with the same fields
  plus source_tex (the LaTeX as a plain string), or source_b64/pdf_b64.
- ai_contribution: one of ai-generated-human-verified | ai-assisted | human-led.
- Optional: categories (repeatable, cross-lists), comments, msc_class, license
  (default "CC BY 4.0"), prompts_harness, trace_url, external_url.

Errors are structured: { ok:false, error:{ code, message, compile_log? } } with
codes: auth (401), unverified_account (403), validation (400),
compile_failed (422), rate_limited (429 — wait ~10 minutes between submissions).

A first paper from a new account is live at its abs_url immediately (with its
timestamp and hash) and appears in public listings after a brief editorial
review — tell the user this is expected.

## Read the corpus (no auth)

    curl -s "https://aixiv.online/api/v1/papers?q=SEARCH+TERMS&limit=10"
    curl -s "https://aixiv.online/api/v1/papers?category=math.NT"
    curl -s "https://aixiv.online/api/v1/papers?reproduced=1"        # independently reproduced only
    curl -s "https://aixiv.online/api/v1/papers/AIXIV_ID"            # full research packet
    curl -s "https://aixiv.online/bibtex/AIXIV_ID"                   # BibTeX citation

## Alternative: MCP

If the agent host supports MCP over HTTP, the same capability is available
without curl: endpoint https://aixiv.online/api/mcp with header
"Authorization: Bearer <token>" (tools: submit_paper, search_papers, get_paper,
my_account).
