# ScholarXIV Developer Docs > ScholarXIV Developer Platform: Papers API, dashboard, subscriptions, and integration guides. ## Conversations URL: https://scholarxiv.com/developers/docs/agent-api/conversations Read, list, create, rename, pin, archive, delete and share the conversations the agent stores for an API key, and see their running turns. Conversations Every turn is stored under the chat_id returned by POST /api/v1/chat. These routes read and manage that history. Read a conversation Returns { "chatid": "…", "title": "…", "messages": [...], "activerun": null }. Messages include persisted text, tool parts, and metadata. active_run is the turn running on the conversation right now (a run object), or null. The same conversation can be opened in the website's chat workspace. Access to another user's chat returns 404. Health and figure conversations are excluded. Manage conversations | Action | Request | | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | List chats | GET /api/v1/chats?surface=research. Optional limit (1–100, default 50), archived=true, and cursor (the previous page's next_cursor). | | Create an empty chat | POST /api/v1/chats with optional title and surface | | Read chat details | GET /api/v1/chats/{chatid}: title, surface, pinned, archived, shared, timestamps, and active_run | | Rename, pin, archive | PATCH /api/v1/chats/{chatid} with title (1–100 characters), pinned, or archived. Archiving also unpins. | | Delete | DELETE /api/v1/chats/{chatid}. A health conversation also deletes its stored messages. | | Share, check, unshare | POST, GET, DELETE /api/v1/chats/{chatid}/share | | List the chat's runs | GET /api/v1/chats/{chatid}/runs | | Cancel the running turn | POST /api/v1/chats/{chatid}/cancel, or POST /api/v1/runs/{run_id}/cancel for one run | All of these use the same sxv_ key as the agent call. Continuing a conversation Send one message at a time per conversation; a message sent while a turn is running returns 409 runinprogress. A dropped connection stops your view of the turn only: the run keeps going and is saved on the chat. Retry with the same Idempotency-Key, or read the run or the conversation, before sending again — see Runs. A fresh POST without chat_id always creates a new conversation. A health conversation is read and managed through the Health Chat API. Continue on the website API conversations are ordinary ScholarXIV chats. Each one appears in the key owner's sidebar on the website, at https://scholarxiv.com/chats/{chat_id}, with the same messages, tool results, figures and files. A new conversation is titled from its first message, the same way the website titles its own. It works both ways: - Start in your app, then open the chat on the website and keep going. If a turn is still running, the website attaches to it and streams the rest. - Start on the website, then pass that chat's id as chat_id from your app. The agent reloads the full history either way. The website's chat id is the last part of its URL, and GET /api/v1/chats lists them all. Renames, pins, archives and deletes made through /api/v1/chats show on the website, and the other way round. One turn runs per conversation across both: sending from the website while your app's turn is still running is refused there the same way the API answers 409 runinprogress. --- ## Errors URL: https://scholarxiv.com/developers/docs/agent-api/errors Status codes, the pre-stream error shape, run conflicts, idempotency errors, and how to tell an incomplete stream from a failed turn. Errors Invalid requests return 400, invalid keys 401, unavailable models or deep research 403, unknown or inaccessible chats and runs 404, run and attachment conflicts 409, oversized model context 413, a reused Idempotency-Key 422, rate limits 429, and agent failures 502. Error shape Pre-stream errors use: Some errors add fields: runinprogress includes the run_id of the turn that is running. Status codes | Status | Codes | What to do | | ------ | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | 400 | invalidrequest, invalidjson, invalididempotencykey, attachmentnotavailable | Check the request against Quickstart. | | 401 | | Rotate the key in the developer dashboard. | | 403 | modelunavailable, deepresearch_unavailable | Check entitlements in Tools and controls. | | 404 | chatnotfound, runnotfound | Confirm the id belongs to the calling key. Runs are kept for 24 hours. | | 409 | runinprogress | A turn is already running on this chat. Wait for it, stream it, or cancel it. | | 409 | idempotencyinprogress | The first request with this key is still starting. Retry in a few seconds. | | 409 | chatattachmentlimitexceeded, chatchanged | Reduce attachment_ids or check the plan's per-chat limit. | | 413 | contexttoolong | Shorten the message or the selected context. | | 422 | idempotencykeyreused | The key was used with a different body. Use a new key for a new request. | | 429 | | Respect Retry-After and back off — see Rate Limits. | | 502 | agentfailed, agentstream_failed | Read the run or the conversation before retrying, or retry with the same Idempotency-Key. | Streaming failures With stream: true, the HTTP status is 200 once headers are sent, so failures arrive inside the stream as error or abort events. Treat a missing finish event as an incomplete view of the turn: the research still finishes on the server. Resume the stream from the last event id, or read the run — see Runs. Failed runs A run read from GET /api/v1/runs/{runid} with status: "failed" has an error. runinterrupted means the server process running the turn stopped before it finished; whatever was saved is in the conversation, and the conversation is free for a new message. Retrying Never automatically resend a POST that has no Idempotency-Key after losing the connection: the turn may already be running or finished. Send keys on every POST and retries become safe. See Runs. --- ## FAQ URL: https://scholarxiv.com/developers/docs/agent-api/faq Short answers about history, custom prompts, retries, background runs, plan gating and the other ScholarXIV agent surfaces. FAQ Can I send my own system prompt or history? No. Caller-supplied history, system prompts, user IDs, plan IDs, and tool definitions are rejected. The agent runs its own prompt, and stored history reloads from chatid. Account custom instructions apply as they do on the website; turn them off for a turn with tools.custominstructions: false. Does it store conversations? Yes. Every turn is persisted under chat_id, and the same conversation opens in the website's chat workspace. Read and manage it through Conversations. My connection dropped. Should I resend? Not blindly. The research keeps running and the finished turn is saved. If you sent an Idempotency-Key, resend with the same key and you get the same run's answer. Otherwise resume the run's stream from the last event id, read GET /api/v1/runs/{runid}, or check activerun on the conversation. See Runs. How do I run something that takes several minutes? Send background: true. You get 202 with a runid right away; poll GET /api/v1/runs/{runid} or stream it from /stream. MCP clients pass background: true to researchchat and read the answer with getagent_run. Why did I get 409 runinprogress? A conversation runs one turn at a time, and another turn on that chatid is still running. The error includes its runid: wait for it, stream it, or cancel it with POST /api/v1/runs/{run_id}/cancel. Can I get JSON instead of prose? Yes, alongside it. Send response_format with a JSON Schema and the answer also comes back as a matching output object. See Structured output. How do I see what my integration costs? Each finished turn reports metrics (tokens, tool calls, duration, estimated cost), and GET /api/v1/usage totals them by day, model, surface, source or key. The dashboard's Usage page shows the same. See Usage and metrics. How is this different from the Router API? The Router API chooses or runs a model. The Agent API runs the research workflow around it: tools, continuation, compaction, storage, and durable runs. Use the Router Chat Completions API when you want a raw completion. How does this compare to MCP? MCP exposes the same engine and runs as tools for editors and agent clients, including researchchat, getagentrun, and cancelagent_run. It returns a completed answer (or a background run) rather than token streaming. Over HTTP, use stream: true — see Streaming. Does the plan gate the tools? Yes. Tools, models, and deep research resolve live against the key owner's plan on every call; per-request controls can only narrow them. See Tools and controls. Is there a health equivalent? Yes — POST /api/v1/health/chat runs the same harness, with the same runs, background mode, idempotency and usage, using the health profile and medical tools. See the Health Chat API. --- ## Files and dictation URL: https://scholarxiv.com/developers/docs/agent-api/files Attach documents to an agent turn, download the figures, plots and files the agent produces, and transcribe audio. Files and dictation These routes use the same sxv_ key and cover the rest of the /chat composer. The Health Chat API uses them with surface or scope set to health. Attach a file Presign, PUT the bytes, then complete: PUT the bytes to the returned uploadUrl, then call POST /api/v1/uploads/complete with { "id" }. Pass the completed id in attachment_ids on the next agent call — up to five per turn, subject to per-chat plan limits. Files the agent makes A turn can produce files: a figure from generateResearchFigure, plots and files from Python in the code sandbox (a .py script, a CSV, a notebook, a spreadsheet; see which types are kept), a manuscript PDF from compileLatexProject, and voice memos. Each is saved to the account like an upload, and every response lists them in files. That is files in the JSON response, and result.files on a run: source is generatedfigure, sandboxfigure, sandboxfile, compiledpdf (a manuscript built with compileLatexProject), or voice_memo. To fetch one: - GET {content} with your key redirects (302) to the file itself. Most HTTP clients follow the redirect, so this returns the bytes in one call. - GET {download} returns { "attachment": {…}, "downloadurl": "…", "expiresin": 300 } when you want the signed URL itself, for example to hand to a browser. Signed URLs last five minutes; ask again for a fresh one. The redirect to it carries no key, so it is safe to follow across origins. content does not count toward the hourly request limit; download counts like any other call. The agent is told to describe a figure rather than embed it, but an answer can still contain !…. That id is always one of the turn's files: replace the link with the file you fetched, or with your own URL for it. The website does the same. GET /api/v1/uploads?scope=figure lists every figure on the account, including ones made on the website. GET /api/v1/uploads without a scope lists chat, health and figure files together. Dictate a question Send it as multipart/form-data with audio and provider (addis or elevenlabs). Put the returned text in message. Context on the message Selected papers and highlighted text are selectedpapers and selectedtexts on the message. Science viewer context is the context object. The server runs the tools; a client does not implement them. Voice memos, figures, and Python outputs are summarised in files and sandbox, and are also inside message.parts and the stream's tool events. GET /api/v1/models?surface=research lists the models the current plan can run. --- ## Agent API URL: https://scholarxiv.com/developers/docs/agent-api The ScholarXIV research agent as an API: one endpoint, our harness, tools, streaming, background runs, files, and saved conversations. Agent API POST /api/v1/chat runs the same agent as the website and mobile chat: the same system prompt, research tools, model routing, continuation, context compaction, and conversation storage. That agent and its harness are the product — you get the whole thing, not a prompt and a model. Tools and models remain subject to the API key owner's current plan. Use this API for a complete research assistant in a bot, app, or integration. If you only need a raw completion against a chosen model, use the Router Chat Completions API instead; it does not run the ScholarXIV research workflow, execute tools, or store conversations. What you get | Part | What it means for you | | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | System prompt | You send a message, not a prompt. The agent already knows how to plan, search, cite and stop. | | Research tools | Paper and web research, federated sources, full-text reading and code execution run server-side. Your client implements no tools. | | Model routing | auto picks per request from the models your plan reaches, or name an entitled model to pin it. | | Continuation and compaction | Long tasks finish across turns, and long conversations stay inside the model's context window. | | Conversation storage | Every turn is persisted under a chat_id, and the chat shows on the website, where you can continue it. History and tool evidence reload either way. | | Generated files | Figures, sandbox plots, files written by Python, and voice memos are saved and listed per turn with download links. | | Durable runs | Every turn is a run that survives a dropped connection. Run it in the background, resume its stream from any event, and retry safely with an Idempotency-Key. | | Per-request controls | Narrow the tools, lower the step budget, tag the run, or ask for a JSON object that matches your schema. | | Usage | Tokens, tool calls, duration and estimated cost per run, and account totals by model, source and surface. | | Files and dictation | Attach documents per turn, or dictate a question and send the transcript. | The surfaces | Action | Request | | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | Run the agent | POST /api/v1/chat (JSON, stream: true, or background: true) | | Read a conversation and its running turn | GET /api/v1/chat/{chatid} | | Read, stream, or cancel a run | GET /api/v1/runs/{runid}, GET /api/v1/runs/{runid}/stream, POST /api/v1/runs/{run_id}/cancel | | List a conversation's runs | GET /api/v1/chats/{chatid}/runs | | List, create, rename, pin, archive, delete, share | GET, POST /api/v1/chats, GET, PATCH, DELETE /api/v1/chats/{chatid}, /api/v1/chats/{chatid}/share | | Cancel whatever is running on a chat | POST /api/v1/chats/{chatid}/cancel | | Agent usage | GET /api/v1/usage | | Upload or download a file | POST /api/v1/uploads/presign, POST /api/v1/uploads/complete, GET /api/v1/uploads/{id}, /content | | Dictate | POST /api/v1/transcribe | | List models | GET /api/v1/models?surface=research | All routes use the same sxv_ key and the same rate limits as the Papers API; reading, streaming and cancelling runs do not count against the hourly limit. The Health Chat API uses these same harness routes with surface or scope set to health. Where to start - Quickstart — create a key, send a message, read the response. - Runs, background mode and retries — long turns, resumable streams, Idempotency-Key, and cancellation. - Streaming — live tokens, tool events, and the AI SDK event stream. - Conversations — read, list, rename, share and delete chats, and continue them on the website. - Files and dictation — attach documents, download what the agent makes, and transcribe audio. - Tools and controls — what the agent runs, the code sandbox, per-request controls, structured output, and entitlements. - Usage and metrics — per-run metrics and account usage. - Errors — status codes, error shape and retry guidance. - FAQ — history, custom prompts, retries and plan questions. Authentication is the same Authorization: Bearer sxv_… header documented in Papers API Authentication. The MCP researchchat tool invokes this same service, including background runs (read them with getagent_run). The signed-in website uses the session route /api/chat, an adapter to the same engine and the same runs: a reopened chat reattaches to a turn that is still running. The ScholarXIV mobile app calls these same agent routes with its session token as the bearer credential; its calls are recorded with the source mobile and do not count against the hourly API limit. Signed-in turns on the website and in the app also follow the account's agent tool settings; turns made with an API key do not. --- ## Quickstart URL: https://scholarxiv.com/developers/docs/agent-api/quickstart Create an sxv_ key, send a message to POST /api/v1/chat, and read the JSON answer back. Quickstart Create an sxv_ key in the developer dashboard. Keep it on your backend or in a user's secure credential storage. Do not embed a shared key in a public app. Ask a question The default response is JSON: The values above are illustrative, and metrics is abbreviated; see Usage and metrics for every field. message.parts also contains any tool calls and results. Model and usage metadata describe the actual execution, including automatic continuations. The X-Chat-Id and X-Run-Id headers carry the same ids. Save chat_id; send it with the next message to continue. You send only the new message. The service reloads stored history and tool evidence. Request fields | Field | Type | Meaning | | ----------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | message | string, required | Nonblank user message, up to 64,000 characters. | | chat_id | string | Owned, 24-character conversation ID. Omit to create a new chat. | | stream | boolean | Default false. Set true for live SSE events — see Streaming. | | background | boolean | Default false. Return 202 with the run at once and read it later — see Runs. Cannot be combined with stream: true. | | model | string | Explicit entitled model or auto routing preset. Defaults to the account's preferred model, with the plan default as fallback. | | deep_research | boolean | Default false. Larger research step budget; requires Plus or Pro. | | max_steps | integer | 1–10. Lowers the tool-step budget for this turn; it never raises the plan's budget (5, or 10 with deep research). | | tools | object | Narrow the agent's tools for this turn — see Tools and controls. | | responseformat | object | { "type": "jsonschema", "json_schema": { "name", "schema", "description"? } } to also get a matching JSON output — see Structured output. | | metadata | object | Up to 16 string tags (keys up to 64 characters, values up to 512), stored on the run and its usage row. | | selected_papers | string | User-selected paper titles, identifiers, abstracts, or serialized context. | | selected_texts | string | Highlighted passages to reference. | | attachment_ids | string[] | Up to five existing attachment IDs owned by the caller. Upload them first — see Files and dictation. Per-chat plan limits also apply. | | replycontexts | object[] | Up to ten excerpts the user is replying to. Each item is { "text", "sourcemessage_id"? }. | | context | object | Optional string fields: proteins, genes, molecules, densities, components, patents, taxa, skyobjects, exoplanets, ephemerides, solarviews. | Each context string accepts up to 128,000 characters; the engine bounds context to fit the chosen model. Unknown fields are rejected. Caller-supplied history, system prompts, user IDs, plan IDs, and tool definitions are not accepted. Account custom instructions apply as they do on the website unless you turn them off with tools.custom_instructions: false. Headers | Header | Meaning | | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Idempotency-Key | Optional, recommended. A retry with the same key returns the same run instead of starting another — see Runs. | Dropped connections and retries A dropped connection stops your view of the turn, not the turn: the run keeps going and is saved on the chat. To get the answer: - If you sent an Idempotency-Key, send the same request again with the same key. You get the same run's result. - Otherwise, with the runid from X-Run-Id, read GET /api/v1/runs/{runid} or resume its stream. - Otherwise, read GET /api/v1/chat/{chatid}: activerun shows a turn that is still running. Send one message at a time per conversation: a second message while a turn is running returns 409 runinprogress. Long turns are best started with background: true. A POST without chat_id always creates a new conversation. --- ## Runs, background mode and retries URL: https://scholarxiv.com/developers/docs/agent-api/runs Every agent turn is a run: start it in the background, poll or stream it, resume a dropped stream, retry safely with Idempotency-Key, and cancel it. Runs, background mode and retries Every message you send starts a run: one turn of the agent on one conversation. The run keeps going on the server whether or not your client stays connected, and it is stored with an id you can read, stream, and cancel. The same runs back the website, the Health Chat API, and the MCP researchchat and healthchat tools. Each response that starts a run carries its id in the X-Run-Id header and, for JSON responses, as run_id. Run in the background A deep-research turn can take minutes. Instead of holding a connection open, set background: true: The response is 202 Accepted with the run object and a Location header pointing at it: Then either poll the run or stream it. background and stream cannot both be true; start in the background and open the run's stream if you want live events. Read a run GET /api/v1/runs/{run_id} returns the run. Poll every few seconds until status is no longer queued or running. | Field | Meaning | | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | status | queued, running, completed, failed, or cancelled. | | result | Once completed: text, model, finishreason, messageid, the saved assistant message, the files it made, its sandbox runs, and output when you asked for structured output. | | error | For failed (and sometimes cancelled) runs: { "code", "message" }. run_interrupted means the turn stopped before it finished; read the conversation for what was saved. | | metrics | Tokens, tool calls, duration and estimated cost once the run ended. See Usage. | | events | How many stream events the run has logged so far. | | metadata | The metadata you sent with the message. | | createdat, startedat, updatedat, completedat | Timestamps. A running run's updated_at moves every second while it is alive. | GET /api/v1/chats/{chatid}/runs lists the recent runs of one conversation, newest first (?limit= up to 50). Reading, streaming, listing, and cancelling runs do not count against your hourly request limit. Stream a run, and resume a dropped stream GET /api/v1/runs/{run_id}/stream returns the run's event stream from the beginning, then follows it live until the run ends. A finished run replays in full. Every event carries its index as the SSE id: If the connection drops, reconnect with the last id you received, either as the standard Last-Event-ID header or as ?after=: The stream continues at event 42, with nothing repeated and nothing skipped. The ids on a POST /api/v1/chat stream with stream: true are the same indexes, so a client that loses a POST stream resumes it the same way with the X-Run-Id it already received. Retry safely with Idempotency-Key Send an Idempotency-Key header (1–255 visible ASCII characters, for example a UUID) on POST /api/v1/chat or POST /api/v1/health/chat. If the request is retried with the same key: - You get the same run instead of a second turn. Nothing is charged or stored twice. The response has Idempotent-Replayed: true. - A JSON request waits for that run and returns its result. A streaming request replays its events from the start. A background request returns the run. - A retry may change stream and background. Changing anything else (for example the message) returns 422 idempotencykeyreused. - If the first request is still starting, the retry waits briefly and may return 409 idempotencyinprogress; retry again after a moment. - If the first request failed before the agent started (for example a 403 for a model your plan cannot use), the key is released and the retry runs normally. Keys are remembered for 24 hours. Without a key, a POST that you did not see answered may already be running: check active_run on the conversation before you send it again. One turn per conversation A conversation runs one turn at a time. Sending a message while another turn on the same chatid is still running returns 409 runinprogress with that turn's runid. Wait for it, stream it, or cancel it first. GET /api/v1/chat/{chatid} (and GET /api/v1/chats/{chatid}) include active_run: the running turn, or null. A turn whose server process died is closed out automatically after about 15 seconds, so the conversation never stays locked. Cancel a run POST /api/v1/runs/{run_id}/cancel stops the agent. It returns { "cancelled": true, "run": {...} }, or cancelled: false with the final run if it had already ended. What the agent produced before it stopped stays in the conversation. POST /api/v1/chats/{chatid}/cancel still cancels whatever is running on a conversation. Retention Run records, their event logs, and Idempotency-Keys are kept for 24 hours after the run's last update. The conversation itself, including every finished answer and its tool evidence, is kept for as long as the chat exists. Usage rows are kept for 400 days. --- ## Streaming URL: https://scholarxiv.com/developers/docs/agent-api/streaming Stream an answer with the AI SDK UI-message event stream: text deltas, tool events, routing metadata, usage, and resumable event ids. Streaming Responses use Content-Type: text/event-stream and x-vercel-ai-ui-message-stream: v1. This is the same AI SDK UI-message stream as the website, not the Chat Completions delta format. The X-Chat-Id and X-Run-Id response headers are available before text starts; save them immediately. Events Each SSE event has an id (its index in the run, starting at 0) and a data: payload that is a JSON event. Typical events include: | Event | Client action | | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | start | Record messageId and messageMetadata, including chatID. | | text-start, text-delta, text-end | Assemble text by part id; append delta as it arrives. | | tool-input-start, tool-input-delta, tool-input-available | Show tool activity if useful. The server executes the tools. | | tool-output-available, tool-output-error | Retain tool evidence or render a tool result. A failed tool can be recoverable. | | message-metadata | Update model, routing, or compaction information. | | data-output | Only with responseformat: jsonschema: { "name", "output", "error"? }, sent just before finish. Transient: not part of the saved message. | | finish | Inspect finishReason and messageMetadata, including usage. | | error, abort | Treat the turn as unsuccessful; do not mark partial text complete. | | [DONE] | Transport terminator, not a JSON object, and has no id. | Handling the stream Ignore event types your UI does not display. Parse frames incrementally: network chunks need not align with events or UTF-8 characters. A connection that closes without finish is incomplete. Errors after headers appear in the stream even though HTTP status is 200; inspect error/abort events and finish metadata. Resuming The run keeps going if your connection drops. Reconnect to GET /api/v1/runs/{run_id}/stream with the last event id you processed, as Last-Event-ID or ?after=, and the stream continues with the next event. Without one it replays the whole turn. See Runs. Use the non-streaming response when you only need the finished answer — see Quickstart — or background: true for long turns. Tool results and failures that end a turn are also covered in Errors. --- ## Tools and controls URL: https://scholarxiv.com/developers/docs/agent-api/tools What the agent runs on the server, the per-request controls that narrow it, structured JSON output, plan entitlements, and rate limits. Tools and controls The tools The server selects the same tool set as /chat, including paper and web research, federated sources, selected context, and supported research workflows. Full-text reading, code execution, and other paid capabilities follow the caller's live entitlements. A client need not implement these tools; richer outputs may need its own UI or a link to the website. Each tool appears as a tool-{name} part in message.parts and in stream events. A tool the plan does not include is left out of the turn entirely, so the agent never plans around it. The plans below are the defaults; an account's live entitlements decide. | Tool | What it does | Plan | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------- | | searchResearchPapers | Searches 3M+ arXiv papers. | All | | webSearch | Searches the web for sources outside arXiv. | All | | getSelectedPapers, getSelectedTexts | Read the selectedpapers and selectedtexts you sent. | All | | searchFederatedResearch | Searches arXiv, OpenAlex, Semantic Scholar, Crossref, PubMed and the other sources. | Go and up (federated search) | | readPaperContent | Reads a paper's full text, a section at a time. | Plus and up (code sandbox) | | executePython | Runs Python in the code sandbox. | Plus and up (code sandbox) | | openResearchHub, createLatexProject, readLatexFiles, editLatexFile, addFigureToLatexProject, peerReviewLatexProject, prepareJournalSubmission, publishJournalPreprint | The research-to-manuscript workflow in Write and the Journal. | Plus and up (code sandbox) | | generateResearchFigure | Generates a figure image. | Plus and up (also figure generator) | | compileLatexProject | Builds a Write manuscript into a PDF. | Plus and up (also LaTeX compile) | | voiceMemo | Records a short spoken summary. | Plus and up (voice) | | savememory, retrievememories, editmemory, deletememory, clear_memories | The account's saved memories. Off with tools.memory: false or the memory setting. | All | | connectAccount and connected-service tools | Mail, calendars, drives and other connected accounts. Off with tools.connectors: false. | All, once an account is connected | The Health Chat API runs its own tools: searchMedicalLiterature, resolveMedications, getMedicationReference and getDrugLabelInteractions, plus the memory tools. Files and errors Every tool that makes a file saves it as an upload and lists it in the response's files: generateResearchFigure, executePython (plots and written files), compileLatexProject (the built PDF) and voiceMemo. The website shows them from the tool output, and the agent is told not to link or embed them. If an answer still mentions attachment://, it means one of those files. A tool that fails does not fail the turn: the agent sees the error and carries on. In message.parts, a failure is either a part with state: "output-error" and errorText, or an output with an error field. Check both. The code sandbox On Plus and Pro the agent can run Python (executePython) in a fresh, isolated Jupyter sandbox. Ask for a chart, a calculation, or a file ("plot this and send me the CSV") and it writes and runs the code itself. Every run is summarised in sandbox. That is sandbox in the JSON response, and result.sandbox on a run: | Field | What it holds | | ------------------ | ----------------------------------------------------------------------------------------------------------- | | status | completed, error (the code raised, or the sandbox failed), or running while streaming. | | code | The Python that ran. | | stdout, stderr | Everything the code printed. | | text, outputs | The cell's value as Jupyter prints it, and any other non-image results (text, Markdown, chart specs, data). | | error | name, value and traceback of the exception, or null. | | figures | Plots the code displayed, such as plt.show(). | | files | Files the code wrote under its working directory, /home/user, kept after the sandbox is discarded. | To get a file back, ask for it: "write the script to analysis.py and send it", "save the cleaned table as an Excel file". The agent writes it to disk in the code, and it comes back in files. | Kind | Kept as | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Images and video | PNG, JPEG, GIF, WebP, MP4, WebM, with their own mime. | | Documents and data | PDF, CSV, TXT, Markdown, DOCX, XLSX, PPTX and ZIP, with their own mime. | | Source and text data | .py, .ipynb, .r, .sql, .sh, .js, .ts, .html, .css, .svg, .xml, .json, .jsonl, .yaml, .toml, .tsv, .log, .tex, .bib, most other source extensions, and Dockerfile, Makefile and requirements. mime is text/plain; filename keeps the original name. | Each file can be up to 20 MB, at most 10 are kept per run, and they count toward the account's storage. Opaque binaries such as .pkl, .npy or .bin are not kept; ask the agent to zip them. A file that is not kept is still listed, with skipped set to unsupportedtype, toolarge, toomanyfiles, storagelimit or savefailed. Download figures and files as described in Files the agent makes. Every one also appears in the response's files. Source files are stored as text/plain so nothing renders them: an .html or .svg file comes back as its source. Save it with its filename to use it. While streaming, the same data arrives in the tool-output-available event for executePython (output.logs, output.results, output.artifacts, output.error). Per-request controls These fields shape one turn. None of them can add a tool, model, or budget the plan does not already allow. | Field | Effect | | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | tools.allow | Only these tools may run (after plan gating). | | tools.deny | These tools may not run. | | tools.memory | false removes the memory tools and keeps saved memories out of the prompt. | | tools.connectors | false removes connected-account tools (mail, calendars, drives). | | tools.custom_instructions | false leaves the account's custom instructions out of this turn. | | max_steps | 1–10. Lowers the tool-step budget for this turn. When the budget is spent the agent writes its answer from the evidence it has. | | metadata | Up to 16 string tags, returned on the run and counted in usage. | Structured output Ask for a JSON object alongside the prose answer: The agent researches and answers exactly as it would otherwise. When the answer is complete, it is converted into an object matching your schema, using only what the answer states. The object is returned as output in the JSON response and in result.output on the run, and streamed as a data-output event just before finish. If conversion fails the turn still succeeds, with output: null and an outputerror. The schema root must be type: "object" and serialize to at most 32,000 characters; name is 1–64 letters, digits, ` or -. { "type": "text" } is the default. Entitlements Tools, models, and deep research resolve live against the API key owner's plan on every request: - model: "auto" picks only from models the plan can reach. - deep_research requires Plus or Pro. - Attachment and per-chat limits follow the plan too. Calls use the existing API rate limits. The hourly window is shared across all of your keys and rolls continuously, so a 429 carries a Retry-After header. Reading, streaming and cancelling runs do not count against it. What it does not do The agent is the product, not a thin wrapper: there is no prompt for you to write and no tool loop for you to orchestrate, and you cannot define your own tools. Long work runs as a durable run that you can start in the background, resume, and retry safely. The MCP researchchat tool invokes this same service and accepts the same controls (allowedtools, disallowedtools, maxsteps, response_schema, metadata, background`). --- ## Usage and metrics URL: https://scholarxiv.com/developers/docs/agent-api/usage Per-run token, tool, duration and cost metrics, and account-wide agent usage from GET /api/v1/usage and the developer dashboard. Usage and metrics Every agent run records what it used, whichever way it started: the website, the HTTP API (research or health), or MCP. Per-run metrics A completed JSON response includes metrics, and so does every run from GET /api/v1/runs/{run_id} once it ends: | Field | Meaning | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | inputtokens, outputtokens, total_tokens | Totals across every model call in the turn, including automatic continuations. | | cachedinputtokens, reasoning_tokens | Reported when the provider returns them, otherwise 0. | | tool_calls | Server-side tool calls the agent made. | | continuations | Automatic continuations used to finish a long answer. | | model, models | The model that finished the turn, and every model that took part (fallbacks included). | | estimatedcostusd | Model tokens priced at catalog rates for model. It does not include search, sandbox, or other tool costs, and it is null when the model has no published price. It is an estimate, not an invoice. | The JSON response keeps its existing usage object (the provider's raw token counts) alongside metrics. The saved assistant message also keeps toolcalls, durationms and estimatedcostusd as metadata.runMetrics, and a stream sends them in a message-metadata event just before finish. Account usage GET /api/v1/usage totals the API key owner's agent runs over a window, grouped as you choose: | Parameter | Values | Default | | ---------- | ---------------------------------------------------- | ------- | | range | 24h, 7d, 30d, 90d | 7d | | group_by | day, model, surface, source, key, status | day | | surface | research, health | all | | source | web, mobile, api, mcp | all | | key_id | An API key id | all | The response has totals and groups. Each has runs, completed, failed, cancelled, the token totals, toolcalls, estimatedcostusd, and avgduration_ms; each group also has its key (the day, model, surface, source, key id, or status). Tag runs with metadata on the message (up to 16 string keys) to tell your own traffic apart. Metadata is stored on the run and on its usage row, and returned on the run. The Usage page of the developer dashboard shows the same agent usage by source, surface, and model. Limits Agent calls use the shared API rate limits. A POST retried with the same Idempotency-Key counts as a request but starts no new agent work. Reading, streaming, listing, and cancelling runs do not count against the hourly limit. --- ## Canvas Audit URL: https://scholarxiv.com/developers/docs/canvas-audit Canvas audit (Stage 0) Read-only audit of the canvas feature as of commit 155c79c, plus the proposed edge value types and node runtime state for Stages 1–9. No code has been changed. 1. Rendering There is no graph library. The canvas is hand-rolled in one component, src/components/canvas/canvas_workspace.svelte (~1,080 lines). package.json has no @xyflow/svelte or similar. | Concern | How it works today | Where | | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | Pan / zoom | A single absolutely positioned layer with transform: translate(x,y) scale(zoom). Panning comes from pointer drags on the background, zoom from the wheel and buttons (0.25–2×). | canvas_workspace.svelte 447–522, 772–775 | | Nodes | One {#each} over canvasWorkspaceState.items. Every node type is rendered inline in the same file, picked by payload type guards (isPaperPayload, isNotePayload, …). There are no per-node components. | 776–1010 | | Handles | Four identical port buttons per node (top, right, bottom, left) from portPositions. A port has no role (in or out), and any port starts a connection. | 54–59, 805–822 | | Edges | One SVG overlay draws a cubic Bézier per connection. The endpoint sides are not stored. facingPort picks whichever side faces the other node, each time it draws. Each edge has an arrowhead marker on its toId end. Clicking an edge deletes it. | 114–173, 701–770 | | Connecting | Click or drag from a port, then release on a node. The hit test is the node's bounding box plus 20 px. | 231–289, 374–428 | Node types in CanvasItemType: paper, attachment, note, clip (a PDF text selection dropped from the PDF viewer) and ai. clip isn't in the tools panel, but it is a real source node, so the later stages need to handle it. src/components/canvas/narrowing_repro.svelte is a tracked file that nothing imports. It looks like a leftover type-narrowing repro and is safe to delete. 2. Storage, save and load The data lives in three MongoDB collections, all accessed through src/lib/server/canvases.ts: | Collection | Shape | Notes | | -------------------- | ------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- | | canvases | { _id, userId, title, viewport, createdAt, updatedAt } | | | canvasitems | { id, canvasId, userId, type, position, size, zIndex, payload } | payload is the per-type union in src/lib/canvas/types.ts. The AI node's output is stored in its payload as payload.result. | | canvasconnections | { id, canvasId, userId, fromId, toId } | Unique index on (canvasId, userId, fromId, toId) (src/db/indexes.ts:85). No handle IDs are stored. | - Load: GET /api/canvases/[id] → getCanvasBoard returns { canvas, items, connections, attachments } in one response. That response goes into CanvasWorkspaceState (src/state/canvasworkspacestate.svelte.ts), which holds plain $state arrays. - Save: each change is its own REST call with an optimistic local update, and there is no autosave or batching. - Item create: POST …/items (validates the payload for each type, items/+server.ts). - Move or edit: PATCH …/items/[itemId], sent on pointer-up after a drag and on blur for note and AI text. - Connect: POST …/connections. - Delete: DELETE …. - Viewport: saved by PATCH /api/canvases/[id] after every pan or zoom. - Connection rules today: createCanvasConnection (canvases.ts:170) only rejects self-loops and unknown nodes. It accepts direction-agnostic and cyclic graphs: A→B and B→A can both exist, and so can longer loops. - Model choice is not persisted. The AI node renders the global ` (canvas_workspace.svelte:975). Every AI node shares, and sends, whatever model is currently picked in modelsState, and the payload has no model field. 3. What Run does on an AI node The model call runs on the server, is not streamed, and handles one node at a time. 1. Client: runAI (canvasworkspace.svelte:438) calls canvasWorkspaceState.runAI(id, prompt, modelsState.currentModelID). That sends POST /api/canvases/[id]/items/[itemId]/run with { prompt, model } (canvasworkspace_state.svelte.ts:130). While it waits, the button shows "Thinking…". 2. Server (src/routes/api/canvases/[id]/items/[itemId]/run/+server.ts): - It reloads the whole board with getCanvasBoard. - Gathering inputs (lines 49–55): it takes every connection whose toId is this node, looks up each fromId item and turns each one into text with describeInput: - paper → title, authors, year and URL (no abstract) - note → Note\n - attachment → the filename only; the file contents are never read - clip → source title, pages and the clip text - ai → AI result\n So chaining already works in a limited way: an upstream AI node's last saved result is used, but that node is not re-run. - The inputs are joined with --- and the joined text is hard-cut at 30,000 characters (MAXCONTEXTCHARS). That cut can fall mid-input, and nothing tells the user it happened. - Model: resolveModel({ requestedModel, surface: 'chat', planId, text, userId }) from #lib/server/router. That resolves "auto" presets through the router and falls back to the plan's default model if the user isn't entitled to the one requested. It then calls generateText from the ai SDK with a fixed research-assistant system prompt. - Result: updateCanvasItem(…, { payload: { prompt, result: text.slice(0, 40000) } }, 'ai') writes the result back into the AI node's own payload in canvasitems, and the updated item is returned to the client. 3. What's missing today: - The canvas route checks no rate limit or usage quota. The only plan gate is model entitlement inside resolveModel. Stage 2's "respect plan limits" needs a decision on which counter to charge. The candidates are the chat surface's limits, checkAndIncrementUserRateLimit (src/routes/api/utils/apiratelimit.ts), or a new canvas counter. - There is no streaming, no cancellation, and no record of which inputs produced the result. - The server returns one generic 502 on any failure. 4. Edges out of an AI node have no effect, including an AI → Note edge. Nothing ever writes AI output into a Note. Those edges are only drawn. The app already has a streaming pattern that Stage 2 should reuse rather than invent: - createUIMessageStreamResponse from the AI SDK - serveDetachedRun in src/lib/server/chat/serve_run.ts, which keeps a run alive after the browser disconnects The detached-run part also matters for Stage 8, where paused runs must survive a page reload. 4. "Search papers" and "Library" on the canvas Both live in src/components/canvas/canvastoolssheet.svelte (the side pane), and both are one-time imports. - Search papers (lines 57–96): - It sends POST /api/search_papers with { title, maxResults: 20 }. That endpoint is the ScholarXIV/arXiv catalogue only (Atlas or legacy Mongo search). It is not the federated search. - Each result has an "Add to canvas" button that creates a static paper item. - paperPayload hard-codes source: 'arxiv' and drops the abstract (summary). - The search has no presence on the board and is never re-run. - Federated search exists separately: - On the client, src/state/federatedsearchstate.svelte.ts fans out from the browser across 11 sources. - On the server, runFederatedSearch (src/routes/api/utils/federated_search.ts) is already used by the chat's research workflow. It takes { query, sources, page, limit, fromYear, toYear, sort } and returns deduped FederatedPapers. Stage 4 should call this server function directly. - Federated search is a paid entitlement (federatedSearch: false on the free plan, src/lib/config/entitlements.ts:65). For free users, the Search node should fall back to arXiv only. - Library (lines 98–108, 285–331): - It lists files from GET /api/uploads, filtered by name on the client. - "Add to canvas" creates an attachment item holding only { attachmentId }. - Files dropped or uploaded onto the board take the same path. - As noted above, the file's contents never reach the AI node. - Text extraction already exists in src/lib/server/attachment_parts.ts (renderAttachmentsAsParts, which caps extracted text at 40,000 characters) and should be reused for document.text. 5. Proposed edge value types All values are plain JSON, so they can be stored, hashed and streamed. Every value carries a kind field that identifies its type (a discriminated union). Design choices to agree on: - papers is already a collection, so a for-each over papers iterates its papers array directly, with no separate list type. list exists for results the for-each produces (Stage 5 outputs list, one item per paper, keyed by paper id). - Paper identity uses the namespaced externalID that federated search already produces. Stage 8 needs it to remember excluded papers, Stage 9 to dedupe collections and cite papers, and the run engine to cache per item. The current CanvasPaper would map to PaperRef, and paper cards would need to start storing the abstract. - Values are what flows along edges. Each source node computes its value from its payload: - Note → text - Attachment → document - Paper card → papers of length 1 - Clip → text labeled with its source AI and Search nodes take their value from the runtime output described below. Source nodes have no runtime state. 6. Proposed node runtime state - Where it's stored: a new runtime field on the canvas_items document, kept apart from payload. The payload stays what the user wrote (instruction, model, query), and runtime holds what the engine produced. On load, payload.result migrates to runtime.output as { kind: 'text', text: result }. CanvasAI also gains a model: string field, so each node stops relying on the global picker. - inputHash: SHA-256 over canonical JSON of: - the node type - its config (instruction, the requested model, and the Search filters) - the hash of each input, sorted by source node id, with empty inputs dropped An AI or Search input contributes its own inputHash. A source node contributes a hash of its value. That makes the hash cheap and Merkle-like: a node's hash changes exactly when something upstream of it changes. Using the requested model rather than the model the router resolves means "auto" doesn't break the cache every time. - Staleness: a status change pushed down the graph, not stored separately for each edge. - Editing a node's config or content, or changing its incoming edges, marks that node and every AI or Search node downstream stale. - When a node is run, if its recomputed hash equals its stored inputHash, the run is a cache hit: the node goes straight back to done with its existing output. - Edits that are later undone therefore cost nothing. 7. Issues to decide before Stage 1 1. Renderer: I recommend keeping the hand-rolled renderer rather than adopting @xyflow/svelte. It is small, styled to the app, and the Stage 1 changes are contained: give each port a role, add two fixed sides, and store nothing new on edges. Switching libraries would mean rewriting every node's rendering for little gain. Stage 6's 50-node performance check is where to reconsider. 2. "Remap old edges" is mostly free. Edges already store direction (fromId → toId), and handles were never stored, so every existing edge maps onto the new right→left handles unchanged. The only edges Stage 1 would drop are those that break the new rules: - edges into a source-only node, such as AI → Note, Note → Note or Paper → Attachment - edges that close a loop 3. Stage 1 and Stage 3 conflict. Stage 1 says to drop edges that can't be mapped, but Stage 3 says to keep AI → Note edges working and show a hint. I propose that in Stage 1, AI → Note edges are kept and marked as legacy, drawn dashed, rather than dropped. Stage 3 then attaches its hint to them. Other invalid edges are dropped, with a console.warn. Edges are only dropped from the loaded view, not deleted from the database, until the board is next edited, so nothing is lost if the rules change. 4. Loops in existing data: if an old canvas contains a loop, I propose dropping the loop's newest edge, by createdAt, and logging a warning. 5. Server-side enforcement: connection rules (direction, source-only targets, loops) should also be checked in createCanvasConnection`, not only on the client. 6. Limits: confirm which limit canvas runs should count against (see §3). --- ## Canvas Progress URL: https://scholarxiv.com/developers/docs/canvas-progress Canvas graph: progress log One entry per stage of the plan in docs/canvas-audit.md. How each stage was checked: with unit tests, svelte-check (filtered to the canvas files) and Prettier. The repo has about 136 type errors in unrelated files that predate this work; the canvas files add none. The dev server and the logged-in UI could not be exercised in this environment, so the UI acceptance checks still need a manual pass. The dev server currently stops at startup because PUBLICGOPRODUCT_ID is missing from .env. Stage 1: Directional ports and connection rules What changed - New pure module src/lib/canvas/graph.ts: - portsFor(type) says which handles each node type has. - checkConnection rejects self-links, wrong direction (output → output, input → input, or into a node with no input), duplicates and loops. A loop is rejected with the message "That would create a loop". - normalizeConnections brings saved boards in line with these rules. - Handles: each node shows an input on the left and an output on the right, and the top and bottom handles are gone. Note, Attachment, Paper and Clip have an output only. The AI node has one input that accepts many connections, plus one output. A drag can start from either handle: from an output it connects to the input of the node you drop on, and from an input it connects from that node's output. - Edges: each edge runs from the right middle of its source to the left middle of its target, with the arrowhead on the target end as before. - Rejected connections: the board checks the rules before calling the API and shows a toast that doesn't block anything. createCanvasConnection repeats the same check on the server. - Old canvases (getCanvasBoard): - Every existing edge already stored its direction (fromId → toId) and none stored handles, so valid edges load unchanged. - AI → Note edges are kept, drawn dashed, and flagged legacy for Stage 3. - Other edges that break the rules are hidden from the view and logged as a warning, but not deleted. - Loops in saved data are broken at their newest edge. That edge is deleted, and a notice is stored on the canvas (canvases.notices) naming the two nodes and the reason. It shows as a banner until it's dismissed (PATCH /api/canvases/[id] { dismissNotice }). - Deleted src/components/canvas/narrowing_repro.svelte. Tests: src/lib/canvas/graph.test.ts (10 tests) covers ports, loop detection, the connection rules, legacy edges, hidden edges and loop breaking. Skipped / open: none. The two existing type errors in the AI node markup (payload narrowing inside closures) were left for Stage 2, which rewrites that block. Stage 2: Graph run engine What changed - Pure engine (src/lib/canvas/engine.ts): topological sort with loop rejection, Merkle-style input hashes, derived staleness, cache hits, run planning and a dependency-aware scheduler with a concurrency cap. - The scheduler is generic: it takes its execute step as a parameter, so tests swap in a fake. - A node's hash covers its type, its config (instruction and requested model) and the hashes of its non-empty inputs. - "Stale" is not stored: a done node is stale whenever its current hash differs from runtime.inputHash. So editing the first Note dims everything downstream immediately, and undoing the edit brings the nodes back to done. - Values and run state: typed values and NodeRuntime live in src/lib/canvas/values.ts, as approved, plus two optional fields: warnings and model (the model that actually answered). - Run state is stored in canvas_items.runtime, separate from payload. - Older AI nodes show their payload.result as a finished run with no hash. They display as done, and the first Run all refreshes them once. - Server run (src/lib/server/canvas_run.ts, POST /api/canvases/[id]/run): streams server-sent events (plan, status, delta, runtime, cancelled, error, end). - What runs: with no targets it's Run all. A single node's Run (or Retry) sends targets plus force for that node, so its upstream AI nodes run only when they aren't done or are stale. - Up to 3 nodes run at once. - Model calls: the model is resolved through the existing router (resolveModel) and called with streamText, so keys stay on the server. - Stop aborts the request, which cancels the node running at that moment and everything still queued. - Failures: a failed node blocks the nodes downstream of it. They go back to idle, marked "Upstream failed". Unrelated branches finish. - The old route items/[itemId]/run is removed. - Inputs: - Attachments now send their extracted text through a new extractAttachmentTexts in attachment_parts.ts. It shares the PDF, DOCX and plain-text readers with chat; chat's output is unchanged. - Context budget: the selected model's context window from the model catalog sets the input budget, minus 8k tokens kept for the answer, and capped at 200k tokens. - Over budget: inputs are trimmed so short ones stay whole (src/lib/canvas/prompt.ts), and the node shows "Inputs truncated to fit the model's context: … (N% kept)". - Empty inputs (a blank Note, an upstream node with no output) are skipped. The node warns about them before you run it. - Labels: each input is labeled in the prompt (Note, Attachment: name, Paper: title, PDF clip from …, Output of "…"). - Per-node model: each AI node saves model and modelName. The node's picker is the existing SelectModel, given a proxy of the shared model state, so it reads and writes the node's own model. New nodes start from the app's current model. - UI: - Run all and Stop buttons in the top bar. - Status on each AI node: - queued: grey border and "Queued" - running: green border, a spinner and the model name - done: a check and the run time - error: red border, the message and a Retry button - stale: dimmed, "Inputs changed" - Text streams into the node while it runs. - Pending text saves are flushed before a run starts. - Limits: each model call is charged to the existing per-user rate limiter (checkAndIncrementUserRateLimit with the plan's api.rateLimit, the same pool as API and MCP requests). When it's exceeded, the node fails with "Rate limit exceeded. Try again in N minutes." Tests: - engine.test.ts (13): topological order, loop rejection, ignoring legacy edges, Run all order, cache hits (nothing re-runs), single-node runs with stale ancestors, stale propagation from a Note, staleness on instruction, model and connection changes, skipping blank inputs, error propagation that leaves unrelated branches running, the concurrency cap, dependency order, and Stop. - prompt.test.ts (3). - The full suite shows the same 10 failures before and after this stage, in hooks.server and the search route and util tests, all unrelated. Skipped / open - Open question, chat usage budget: chat has no usage budget in the codebase today. /api/usage only reports token totals, and nothing enforces a cap. So decision 5's "same budget as chat" has nothing to plug into yet. Canvas calls go through one function, chargeModelCall in canvas_run.ts, so a shared budget can be added in one place. The "same message chat shows" also has no chat equivalent; the node shows the rate limiter's message instead. - Images: image attachments are passed as "(Image file: its contents cannot be read as text.)" rather than sent to vision models. Sending them as images would need the per-node model to support image input. - Output nodes arrive in Stage 3, so Stage 2's Note → AI → AI → Output check was verified as Note → AI → AI, through the engine tests. Stage 3: AI output display and chaining What changed - AI node output: the result shows below the instruction in canvasresultpanel.svelte. It's a scrollable, rendered-markdown area with Copy and Expand (a dialog), on a light sky-tinted background with the caption "Output · model · time". The model in the caption is the one that actually answered, after Auto routing. While the node runs, the caption reads "writing…" and text streams in. - AI node titles: each AI node has an editable title, used in downstream prompt labels, e.g. Output of 'Extract methods'. Every input is labeled by its node type and title (Note, Attachment: name, Paper: title, PDF clip from …, Output of '…'). - Chaining: AI → AI already worked through the engine. The upstream text is the downstream node's labeled input. - Output node (tools panel → Output, type output): one input, no output, read-only. - It shows each connected input: text as markdown, papers as a table, files by name, lists as sections. - Copy, Download as .md, and Expand. - If an input is stale, it's dimmed and says so. - Live text shows while an upstream node is running. - Save to collection goes through the existing Collections API and collectionState. You can add to an existing collection, or create one with a name you choose. It reports "Added N, M already there". - Notes stay user-only. A Note with a legacy AI → Note edge shows a one-time hint. "Add Output node" places an Output node next to the Note and connects the same AI nodes to it. "Dismiss" hides the hint. Either way the Note's text is never touched, and the dismissal is stored as outputHintDismissed on the Note. - New pure helpers: - node_value.ts: values, titles, and the papers upstream of a node. - markdown.ts: papers table, sections, file names. - collections.ts: saving papers to a collection. Tests: markdown.test.ts (5): the papers table with escaping, list sections, section headings, file names, and collecting papers upstream. Canvas suite total: 31. Skipped / open - Collections hold papers only, not text. So "Save to collection" saves the papers the output came from: paper cards and, from Stage 4, Search results upstream of it. When there are none, the button is disabled with an explanation. Saving the Output's text itself would need a new kind of collection entry. I left that out, since you asked not to build new systems. Stage 4: Live Search node What changed - New search node type (tools panel → Search node). It runs in the graph like an AI node: it has a status, goes stale and is cached by input hash. - Fields: query, sources (default all), year range, max results (default 10, max 50) and sort (relevance or newest). Sources, years, results and sort sit behind a filters toggle. - Validation: payloads are checked by parseSearchPayload on create and update. - Optional input: connected text from a Note, a clip or an AI output becomes the query, or extends it when the node has its own query. Each text input contributes at most 300 characters. The node shows the query it actually ran when that differs from the typed one. - Backend: - Paid plans: runFederatedSearch, run server-side inside the run engine. - Free plans: arXiv only, through the existing searchPapers mapped with arxivToFederated. The node shows "arXiv only on your plan · Upgrade for all sources", linking to /pricing. - Either way the results are a typed papers value with namespaced ids. - Results list: title, first author and year, with a "N of M selected" count. - Unticking a paper stores its id in excluded. Excluded papers are removed from everything downstream: the server's input gathering, Output nodes and paper collection. - excluded feeds the hash that downstream nodes see, not the Search's own (outputModifier in the engine). So unticking a paper re-runs only what comes after the Search. - Static paper cards still work. "+" on a Search result places that paper as a card, and the tools panel's "Find a paper" (the old one-shot search) still adds cards. Cards now store the abstract and output papers of length 1. - Papers into AI nodes: each paper becomes its own labeled input ("Paper: title") with title, authors, year, URL and abstract. - Full text comes from the existing getPaperFullText (arXiv HTML/PDF, or a federated paper's PDF, with its cache) when 8 or fewer papers feed the node. It is fetched 4 at a time. - Over budget: the context-budget trimming cuts the longest texts first and says so on the node. - Notes on the node: "Full text was available for N of M papers", or "Using abstracts for all N papers" above 8. - Run all and Run status now cover Search nodes. The Run, status, error/Retry and warning markup is shared in canvasrunstatus.svelte. Tests: - Engine (3 new): Search runs before its consumer; a query or filter change stales the Search and what follows it; excluding a paper stales only the downstream node and re-runs only that. - search_payload.test.ts (2). - Canvas suite total: 36. Skipped / open - Search rate limits: Search runs aren't charged to the model-call rate limiter, since they aren't model calls. The browser search limiter (checkBrowserRateLimit) is keyed by IP address and needs the request event, so it isn't applied inside the run engine either. - "From Library": the canvas Library lists uploaded files, not papers, so there was no Library paper to place as a card. Library files stay Attachment nodes. Stage 5: For-each on AI nodes What changed - "Run for each item" toggle on AI nodes (payload.forEach, part of the node's hash). - It appears when exactly one input is list-like: a Search or other papers value with more than one paper, or a list from another for-each. A Search that hasn't run yet counts, so the pipeline can be wired up before the first Run all. - With the toggle on and no list, or several lists, the node explains what to connect. - Execution (executeForEach in canvas_run.ts): - The instruction runs once per item, 3 at a time inside the node. Each call goes through the same rate-limited callModel. - All other inputs are passed to every call as shared context. - Each paper item gets its full text when available (for-each reads full text for up to 100 items, since each call holds one paper). Each call is fitted to the context budget separately. - The output is a list. Each item is keyed by its source (the paper id) and labeled by the paper title. - Per-item cache: - Each item's hash covers the node's config, the shared inputs and the item itself, stored in runtime.items. A re-run reuses any item whose hash matches and that didn't fail. - So retrying re-runs only the failed items, and a Search that now returns one new paper costs one call. The node notes "Reused N unchanged items". - A node with failed items is never a cache hit. - Upstream output changes now reach downstream nodes (needed for the per-item cache): - Every run stores an outputHash, which feeds its consumers' hashes. If an upstream re-run produced something different, consumers go stale. - Consumers of a node that will run are planned too. The server re-checks the cache once their inputs are final and skips them (a skipped event) if nothing changed. - Each stored inputHash is computed when the node finishes, from the upstream results it actually read. - UI: - "7 / 12 done" with a progress bar, then a collapsible list keyed by paper title. Items stream in as they finish. - A failed item shows its error and a Retry button, which re-runs only the failed items. - The list sits in the tinted output panel, with Copy and Expand on the whole list. - Downstream: an AI node that receives a list gets every item as its own labeled input ("Output of 'Extract' · Paper title"). The Output node renders a list as sections. When every item uses the same headings ("## Method", "Dataset: …" or "Main result: …"), it offers a Table view with one row per item (listAsTable). - Confirmation: before any run (Run all or a single node), the client estimates model calls with the engine's own planRun: one per AI node, or one per item for a for-each node. An un-run Search counts at its max-results setting. Above 20 calls, the user has to confirm. Acceptance pipeline: Note (topic) → Search (10 papers) → AI for-each ("extract method, dataset, main result") → AI ("build a comparison table and summarize trends") → Output runs with one Run all. The Note's text becomes the Search query, the for-each makes 10 calls, and the summary node receives 10 labeled items. It's an estimated 11 calls, so no confirmation is needed. This was checked through the engine and helper tests; the live run is part of the manual pass. Tests: - Engine (3 new): consumers of a forced re-run are planned; a changed upstream output stales its consumers; failed for-each items prevent a cache hit. - for_each.test.ts (3): what counts as list-like, an un-run Search as a list input, and the call estimate. - markdown.test.ts (3 new): the headings table, multi-line fields, and mismatched headings. - Canvas suite total: 45. Skipped / open - Concurrency: for-each concurrency (3) applies inside a node. Two for-each nodes on independent branches can therefore make up to 6 calls at once, within the engine's 3-node cap. Every call is still charged to the rate limiter. - Confirmation dialog: this uses the browser's confirm(). It's simple and blocking; a styled dialog can replace it in Stage 6. Stage 6: Polish, saving and templates What changed - Autosave (debounced and batched): - Every item edit (moves, note text, AI and Search settings) updates the board at once and joins a per-item queue. Edits to the same item are merged. - After 700 ms of quiet, the queue goes out as one PATCH /api/canvases/[id]/items { updates: [...] }, which validates each update with the shared parseItemPatch and writes them in one bulkWrite. Viewport changes are queued in the same way. - The top bar shows Edited / Saving… / Saved, or "Not saved · retrying". A failed batch goes back underneath any newer edits and is retried after 3 s. - Runs flush the queue first. Closing the page sends what's left with keepalive, and the queue is also flushed when you leave the canvas. - Rename: click the title in the top bar, as before. Canvases are listed and reopenable on /canvas, as before. - Reload restores outputs: every node's last output and status are saved in runtime (Stage 2), so reloading brings back the whole board with its results. - Run history: each run is stored in canvas_runs (indexed, last 10 kept per canvas, deleted with the canvas). - Each record holds the start and end times, every planned node with its outcome (done, error with message, blocked, cancelled or skipped), the model calls used, whether the run was stopped, and the output each node produced. - The top bar's history menu lists the runs. Picking one shows that run's outputs on every node, and "Back to latest outputs" undoes it. - Each AI and Search node also has its own "Latest output / Run of …" picker. Viewing an earlier output never changes what downstream nodes receive. - Templates: "Start from template" on /canvas (POST /api/canvases { template }, built on the server in createCanvasFromTemplate from src/lib/canvas/templates.ts). - Literature review: the Stage 5 pipeline, with a sample topic Note. - Compare two papers: two example arXiv cards (Attention Is All You Need, BERT) → AI compare → Output. Swap in your own cards. - Summarize my uploads: up to 5 of your most recent non-image Library files → AI for-each summarize → AI synthesize → Output. With fewer than two files, a Note explains how to add them. - To support this template, "Run for each item" now also iterates when a node has no list input but two or more attached files (on both server and client). - Keyboard: Cmd/Ctrl+Enter runs the selected node, Shift+Cmd/Ctrl+Enter runs all, and Delete/Backspace removes the selection when no text field has focus. The listener uses the capture phase, so the run shortcuts work from inside an instruction box too. - Empty state: "Add a Search node or a Note, then connect it to an AI node", plus the Run all shortcut and a pointer to templates. - Performance with 50 nodes: - Input hashes are now memoized on each item's payload and runtime, plus the connection list. Dragging a node replaces only its item object, so a drag no longer re-hashes the board on every pointer move. - Saves are batched, as above. - Engine test: hashing and planning a 50-node graph takes well under 50 ms. Tests: templates.test.ts (7): - every template is a valid graph: no hidden edges, no loops, every edge accepted by checkConnection, and something for Run all to run - the literature-review run order - uploads iterated as a list - the empty-Library hint - the 50-node timing Canvas suite total: 52. Skipped / open - Manual checks still needed: "All three templates run successfully with Run all" was checked as graph structure and run plans. A live run needs a model, and the uploads template needs Library files. - Large confirmations: these still use window.confirm rather than a styled dialog. - 50-node frame rate: this was reasoned about and covered by the engine timing test, not profiled in a browser. Stage 7: Extract to table node What changed - New extract node (tools panel → Extract to table). It takes papers from a Search, paper cards or (Stage 8) a Checkpoint. Any other connected inputs, such as a Note describing the study, are passed as extra context to every row. - Columns are edited in the node: a name, plus a short description of what to extract. - The 4 starter columns (Method, Dataset, Main result, Limitations) can be edited or deleted. Up to 12 columns. - Settings are validated by parseExtractPayload. - The node has its own model picker, sharing nodeModelPicker with AI nodes (src/lib/canvas/model_picker.ts). - Execution (executeExtract in canvas_run.ts): - One model call per paper, 3 at a time, through the same rate-limited call as for-each. The model is asked for JSON keyed by column id: { value, snippet } per cell. - The system prompt forbids guessing: unsupported cells must be exactly "not reported". - Answers are validated by parseExtraction (code fences and stray text around the JSON are tolerated). A missing key, wrong shape or invalid JSON triggers one retry. If that fails too, the row is marked failed with the reason, and Retry re-runs only failed rows. - Blank values and "Not reported." are normalized to "not reported", with no snippet. - Sources: the abstract plus full text when available, via the same getPaperFullText, for up to 100 papers. Each row records whether it was extracted from full text or the abstract only. The node notes "N of M rows were extracted from the abstract only". - Output is a typed table value (columns + rows, each row linked to its paper id), now part of the value types in values.ts. - Downstream AI nodes get it as a markdown table. - The Output node shows a sortable table (rows that are "not reported" or failed always sort last), with Export CSV (UTF-8 with BOM, quoted, with paper id and "extracted from" columns), Copy and Download .md. - In the node: - A preview of the first 5 rows, with an Expand dialog for the full table. - Hovering a value shows the sentence it came from. - Rows from the abstract only are marked. - Rows progress live ("7 / 10 rows"). - Per-node history (Stage 6) also works here. - Caching: per cell. I picked per cell over per row because, with the for-each machinery already in place, it was barely more code. - Each cell's hash covers the paper (id, title, abstract), that column's name and description, the shared context and the model. Hashes are stored in runtime.cells. - On a re-run, each row's single call asks only for the columns whose cells aren't cached. So editing one column's description extracts only that column, adding a column extracts only the new one, and unchanged rows make no call at all. - The node itself goes stale on any column change, because its config hash includes the columns. Tests: - table.test.ts (8): parsing fenced JSON and snippets; normalizing "not reported"; invalid JSON and missing columns; the instruction asking only for the requested keys; markdown without failed rows; CSV quoting and provenance; settings validation (12 columns at most, names required, starter columns by default); and the node going stale on a column description change. - Canvas suite total: 60. Skipped / open - Live run not done: the acceptance run (Search with 10 papers → Extract → Output, giving 10 rows with CSV) needs a model and wasn't run here. The parsing, validation, caching and rendering behind it are covered by tests. - "Library" papers: as in Stage 4, there are none to connect. Library items are files, not papers. Stage 8: Checkpoint node What changed - New checkpoint node (tools panel → Checkpoint), with one input and one output. It passes its input through unchanged, except for what the user edits. - Engine: - A new waiting status. - A Checkpoint's executor returns 'waiting'. The scheduler then marks everything below it in the plan as held: not run, and not marked as failed. Independent branches keep running. - A waiting Checkpoint is never a cache hit, so the next Run all reviews it again with fresh data. - Review UI: - Papers, table rows and list items are shown as a checkbox list with "8 of 12 selected" and All / None. - Text gets an editable text area. - The node and its border turn amber while waiting. - Continue (POST /api/canvases/[id]/checkpoints/[itemId] { action: 'continue' }): - Flushes pending saves first. - Checks that the data above hasn't changed since the pause. If it has, it asks you to run again to review the latest. - Marks the Checkpoint done, storing its applied output, input hash and output hash. - Returns the held nodes, which the client then runs as targets. Their ancestors are cached, so only the held steps run. - Stop here ({ action: 'stop' }) ends the paused run. The node goes idle with "Run stopped at this checkpoint", and the data is kept so it can be reviewed later. - What downstream nodes receive: visibleOutput gives nothing while the Checkpoint waits, then its input with the review applied (applyCheckpoint). - Unticked items are stored by id in payload.excluded. They change the hash consumers see (as outputModifier, like Search exclusions), so edits made after Continue reach downstream on the next run. - When upstream data changes later: the Checkpoint goes stale and reviews again on the next run. - Exclusions are re-applied wherever the same paper ids come back. - A text edit is tied to the input hash it was written against (editedFor). If the text above changes, the edit isn't applied, and the node says so rather than silently dropping it. - Several Checkpoints: each one holds only its own descendants. The top bar shows "Waiting for review (N)", and clicking it pans to the first waiting Checkpoint and selects it. Held nodes show "Paused for review above". - Reload: the waiting state, the data under review (runtime.pending) and the held nodes (runtime.heldDownstream, written when the run ends) are all stored on the Checkpoint. A reload during a pause shows the same waiting Checkpoint, and Continue still resumes the held steps. Tests: checkpoint.test.ts (7): - unticked papers and rows dropped by id - exclusions re-applied to refreshed data - text edits applied only to their own input - tickable items listed - the scheduler holding everything below a waiting Checkpoint while an unrelated branch finishes - waiting persists through displayStatus, passes nothing downstream, and is never cached - reviewed papers pass downstream after Continue Canvas suite total: 67. Skipped / open - Acceptance check: the pipeline (Search → Checkpoint → Extract: untick 3, Continue, table has only the kept papers) is covered by the engine and helper tests. The live run needs a model. - Housekeeping: I accidentally ran Prettier over all of src/lib/server while working on this stage. I reverted every file except the two canvas server files before committing. Stage 9: Send-to nodes (Write, Collection) How Write stores documents (read first, as asked): - Write is a LaTeX editor. A project is a paperprojects row with a rootFile (main.tex). Its files are paperfiles rows holding text content. They're compiled in a sandbox, and the editor saves files through PATCH /api/write/[projectId]/files. - Citations are standard BibTeX. Every Write template ships a refs.bib and ends with \bibliographystyle{plainnat} and \bibliography{refs}, using natbib (\usepackage[numbers]{natbib}). - Completions: the editor's \cite/\citep/\citet completions (src/lib/write/completions.ts) offer every key found in any .bib file in the project. - Existing BibTeX generator: the app already has one for papers, formatExternalCitation('bibtex', …) in src/lib/federated/citation.ts. How canvas content maps into Write (src/lib/canvas/latex.ts): - Where it goes: each Send to Write node owns one section file in the project, canvas/-.tex. It's pulled into the document with one \input{…} line, added once to the root file before the bibliography (or before \end{document}). The user's own text in main.tex is never rewritten. - The section file: - A \section{…} heading. - A visible line linking back to the canvas: From the ScholarXIV canvas "…" (scholarxiv.com/canvas/…). The full URL is also in a comment. - The content. - A "Sources: \cite{…}" line listing every paper it drew on. - Text (AI output markdown) → LaTeX: - headings become \subsection/\subsubsection/\paragraph, nested under the section - bold/italic → \textbf/\emph, and code → \texttt - links become the link text with the URL in \texttt - bullet and numbered lists → itemize/enumerate - fenced code → verbatim - markdown pipe tables → booktabs tables - all LaTeX specials are escaped - Tables (Extract to table) → a booktabs table with wrapping p{} columns. Each row's paper label carries ~\cite{key}, and unsupported cells read "not reported". - Papers → an itemize list of titles, each with ~\cite{key}. - Citations: - Every paper in the content, and every paper upstream of a text result, gets a BibTeX entry built with the existing formatExternalCitation('bibtex', …). It's added to the bibliography file the root file actually reads (\bibliography{x} or \addbibresource{x.bib}, otherwise refs.bib). - Citations use \cite, which works with natbib, biblatex and plain BibTeX. - The canvas marks each entry it writes with % scholarxiv-canvas-paper:. Later sends reuse those keys instead of adding duplicates, and new keys never collide with the user's own (a/b/… suffixes). - The keys then appear in Write's own \cite completions. - A project with no bibliography command gets \bibliographystyle{plain} and \bibliography{refs}, so the citations resolve. - New documents get a small main.tex (article, geometry, booktabs, array, natbib) that inputs the section, plus a refs.bib. What changed - Send to Write (sendwrite, input only; src/lib/server/canvassend.ts): - It accepts text, tables, papers and lists. - The target is either "A new Write document" (created on the first send; later sends update that same document) or "Append to …" an existing project. - The node shows the destination's name, an Open button (/write/), the last send time and the result ("Created …", "Updated …, adding N references", "… is already up to date"). - Send to Collection (send_collection, input only): - It accepts papers, or a table (using each row's linked paper id). - It adds them to a chosen collection, or creates one with the name you give. - It skips duplicates and reports "Added 7, 3 already there" (plus "N not found" for papers missing from the catalogue). - Open goes to /collections/. - Reused, not duplicated: - The add-paper and create-collection logic moved out of the Collections API routes into src/lib/server/collection_papers.ts. The routes now call it too, with the same responses and access rules: only owners and editors can add. - Project creation moved from POST /api/write into createProject in src/lib/server/write/projects.ts, which the route also uses. - Idempotent: both nodes are runnable and take part in Run all. - Unchanged input is a cache hit, so nothing is sent again. - When a re-run does happen, each node remembers where the last send went (runtime.sent), so it never creates a second document or collection. Unchanged section text isn't rewritten, existing BibTeX entries aren't duplicated, the \input line is added only once, and papers already in the collection are skipped. - Edits made in Write since the last send: the node stores a hash of the section file as it wrote it. If the file differs on the next send, the node stops with "… was edited in Write since the last send". Overwrite re-runs it with permission to replace the file (overwrite on the run request). Keep my edits and open leaves the file alone. Tests: latex.test.ts (10): - markdown headings, emphasis, lists and escaping - pipe tables → booktabs - verbatim code - every LaTeX special escaped - BibTeX keys reused on later sends and never colliding with the user's keys - table rows cited, with "not reported" cells - \input added once, before the bibliography - finding the bibliography file - the section file is deterministic for the same input - a sent node is a cache hit, so Run all twice doesn't send again Canvas suite total: 77. Skipped / open - Not tested live: the acceptance runs (Extract → Send to Write creating a document with the table and citations; Run all twice creating nothing new) need a database and a signed-in session, so they weren't run here. They're covered by the conversion and caching tests above. A LaTeX compile of the generated section wasn't run either. - No cite keys inside prose: model-written text isn't rewritten to insert \cite at the exact sentence where a paper is discussed. Papers are cited in the "Sources" line, and per row in tables. Follow-up: collections take papers, not text results - Changed: collections are groups of papers on a topic, so a text result no longer offers to save to one. This replaces the Stage 3 note that the Output node saves "the papers the output came from". - The Output node shows Save to collection only when what it displays is papers (Search results, paper cards) or an Extract table. An Output showing an AI summary has no button. - Send to Collection collects only the papers in its own input (papersIn in src/lib/canvas/papers.ts). Connected to a text result, it stops with "Collections hold papers…". - Send to Write is unchanged: a text section still cites the papers behind it (citedPapers). - Tests: src/lib/canvas/papers.test.ts (3 tests). All 80 canvas tests pass. --- ## Developer Dashboard URL: https://scholarxiv.com/developers/docs/dashboard Manage API keys, test the Papers API live in the Playground, and monitor shared usage and limits. Developer Dashboard Your central place to create keys, experiment safely, and watch consumption. Go to /developers/dashboard (requires login). A sidebar gives quick access to Overview, Playground, API Keys, and Usage. Overview Four cards give instant visibility: - Current Plan — Shows Free / Plus / Pro. Free users see an upgrade link. - API Keys — How many you have created vs your plan maximum. - Hourly Usage — Requests made in the current rolling 60-minute window (shared by all keys). - Last Used — Most recent activity across your keys. [!TIP] Refresh the dashboard after creating a key or making test calls. Usage numbers update in real time. API Keys Create, rename, enable/disable, and delete keys here. Creating a key - Give it a clear name. - Add an optional description (stored in metadata). - Choose expiration: 7 days, 30 days, 90 days, 1 year, or Never. - The full sxv_... key is shown only once. Copy it right away. Key lifecycle tips - Use separate keys for development, staging, and production. - Prefer shorter expirations for high-privilege keys. - Disable a key instead of deleting it when you suspect compromise — you can re-enable later. - Keys are tied to your account. Their effective rate limit and quotas always follow your current subscription. [!WARNING] Treat keys like passwords. Never commit them, never expose them in browser bundles, and never share them in screenshots or support tickets. Playground The best way to learn the API and generate client code without leaving the browser. Features: - Toggle Simple (single q title search) or Advanced (multiple field filters). - Adjust page, limit, sort, and order. - Paste any of your active keys for live calls (the key never leaves your tab). - "Send Request" executes against the real endpoint and shows status, timing, and results. - Results appear in a table (with paper previews) or as raw JSON. - Code snippets (cURL, TypeScript, Python, Go) update live as you change inputs. Beginner advice: Start here. Experiment with filters until you get the exact papers you want, then copy the generated snippet into your project. It saves hours of guesswork. Pro tip: After creating a new key on the Keys page, click "Use just-created key" in the Playground. Usage Detailed monitoring for production use. - Select time ranges from 30 minutes to "All". - Line + area chart shows request volume over time with hover details. - "Usage by key" breakdown shows which keys are busiest. - Request table lists recent calls (method, endpoint, result count, status). Click any row for the full logged query, filters, and error (if any). - Agent usage totals every research and health agent turn, from the website, the API, and MCP: runs (with failed and cancelled), tokens, estimated model cost, tool calls, and average turn time, broken down by source, surface, and model over 24 hours to 90 days. The same numbers are available from GET /api/v1/usage — see Usage and metrics. Critical fact: The hourly rate limit is per user, not per key. All your services and teammates drawing on the same account compete for the same quota. [!TIP] Check the Usage page before a big batch job. If you are close to the limit, either wait for the window to roll or upgrade. Related - Papers API Overview - Authentication & Limits - Main app Pricing (to change your plan) --- ## Dms URL: https://scholarxiv.com/developers/docs/dms Direct messages DMs are ScholarXIV's first collaborative surface. The bar is Telegram: fast, live, every everyday chat action (reply, forward, edit, delete, react, pin, search), plus the thing only a research app can do — papers, collections, datasets and profiles travel as live cards, not pasted links. What's in it - Chats: one-to-one DMs, groups (title, admins, add/remove, leave) and Saved Messages — a chat with yourself, the quickest place to park a paper. - Messages: text with light formatting (bold, italic, ` code , links), reply with a quote, forward (keeps "Forwarded from"), edit (marked "edited"), delete for me or for everyone, emoji reactions, pin (pinned bar at the top), copy. - Live: new messages, edits, reactions, read receipts (✓ sent, ✓✓ read) and typing indicator, pushed over one SSE stream per tab while a chat page is open. Online / last seen and the unread badge outside chats are polled about once a minute. - Research cards: - Paper — title, authors, year and an abstract snippet; open it, save it to your library or add it to a collection without leaving the chat. - Collection — title, paper count and visibility. Sharing a private collection you own or edit can grant everyone in the chat view access in the same step. - Dataset and profile cards. - Files and images through the existing upload pipeline (dm scope); only people in the chat can open them. - Smart links: an arXiv link or id, a /collections/ link or a dataset link in a message becomes the matching card automatically. - Chat info: members, and a shared library of everything posted in the chat — Papers, Collections, Files, Links — so a chat doubles as a reading list. - List: search, unread counts, pinned chats, mute, archive; drafts are kept per chat. - Safety: block a person; choose who can message you (everyone, or nobody new); sending is rate-limited. - Entry points: Messages in the sidebar (with an unread badge), a Message button on @username profiles, and "Send in a DM" on papers and collections. Data model | Collection | One document per | Notes | | --- | --- | --- | | dm_conversations | chat | kind direct, group or self; memberIds; directKey (sorted pair) is unique so a pair has one chat; lastMessage for the list. | | dm_members | person in a chat | lastReadAt, pinned, muted, archived, clearedAt (delete history for me), leftAt. | | dm_messages | message | text, shares (card snapshots), replyTo, forwardedFrom, reactions, editedAt, deletedAt (for everyone), hiddenFor (for me), clientId for idempotent retries. | | dm_signals | typing ping | TTL of a few seconds; only exists to be streamed. | | dm_presence | person | lastSeenAt, refreshed by the unread poll of a tab in view. Readable only by people who share a chat and aren't blocked either way. | | dmblocks, dmsettings | block / person | who can message whom. | Cards store a snapshot (title, authors, count…) taken when sent, so a chat renders without a lookup per card, and links open the live page. Live updates GET /api/dms/stream opens a MongoDB change stream (Atlas is a replica set) on the DM collections and forwards events for the viewer's chats. If change streams are unavailable it falls back to polling. The stream closes itself after a few minutes and the browser reconnects with the last cursor the server sent, so it fits serverless limits. A catch-up replays at most 300 changed messages; past that it sends resync and the page reloads the list and the open chat. Only /messages and the ambassador community page open a stream, and a tab hidden for 60 seconds closes it until it's back in view. Everywhere else, GET /api/dms/unread runs once a minute while the tab is visible; that request also refreshes "last seen". Stages 1. Data model, rules (pure, tested), server store and REST API. 2. Live stream: messages, typing, presence, read receipts. 3. Messages page: chat list, thread, composer, reply / edit / forward / react / pin / delete. 4. Research cards, smart links, uploads, and "Send in a DM" from papers, collections and profiles. 5. Groups, Saved Messages, chat info with the shared library, search, block and privacy, sidebar badge. Progress (One entry per stage below.) Stage 1: data model, rules and API - Added: src/lib/dms/ (types, text helpers, rules), src/lib/server/dms/ (store, card snapshots, route wrapper) and the REST routes under src/routes/api/dms/. Indexes for every DM collection, including a unique key per direct pair and a 30-second TTL on typing pings. - Uploads: new dm scope; /api/uploads/ now also lets someone open a file that was sent in a chat they're in. - Tests: 16 unit tests (smart links, formatting, previews, permissions, reactions, flood guard) and 8 integration flows run against a throwaway database on the real cluster (DM_INTEGRATION=1 npx vitest run src/lib/server/dms); the database is dropped afterwards. All pass. - Bug caught by the integration run: an empty date filter matched no messages; fixed before commit. Stage 2: live stream - Added: src/lib/server/dms/stream.ts and GET /api/dms/stream. One server-sent-events connection per tab carries new and changed messages, removals ("delete for me" in another tab), chat changes, read receipts, typing and presence. - How it stays complete: the change stream is pinned to the cluster time at connect, so nothing written after ready slips past while it spins up. Streams end themselves after 9 minutes (well inside the function limit); the browser reconnects with ?since= and a catch-up query replays the gap. Without change streams it polls the same catch-up query every 2 seconds. - Presence: an open stream refreshes "last seen" every 25 seconds. - Member rows now carry updatedAt, which the catch-up query uses for read receipts and chat changes. - Tests: an integration test opens a stream for one person, has the other send, type and read, and checks each event arrives; then checks a reconnect replays a message sent while disconnected. Passes (9 integration flows in total). - Bug caught: the first version opened the change stream after announcing ready, so a message sent immediately could be missed. Fixed by pinning the start time. Stages 3–5: Messages page, research cards, groups and entry points These three landed as one commit: the composer, the cards and the info panel depend on each other, so splitting them would have left commits that don't build. - Messages page (/messages, /messages/): chat list beside the thread on wide screens, one at a time on phones. Full-viewport like Write and Canvas, so there's no global input box under it. - List: search, All / Unread / Archived, unread counts (grey when muted), pinned chats on top, "typing…" in the preview, per-chat menu (pin, mute, archive, mark read). - Thread: day separators, a "New messages" divider where unread starts, runs from one sender grouped, older history loads as you scroll up without losing your place, a jump-to-latest button with a count, typing indicator, online / last seen, pinned bar (click cycles through pins), in-chat search that jumps to the hit. - Messages: reply (quote is clickable), forward to several chats, edit (↑ on an empty box edits your last one), delete for me / for everyone, eight reactions, pin, copy, double-click to reply, right-click for the menu, ✓ sent / ✓✓ read, big emoji-only messages, retry or discard a failed send. - Composer: a draft per chat, Enter to send and Shift+Enter for a new line, Esc cancels a reply or edit, paste or drop files, + menu for a file, a paper (title search) or one of your collections. - Cards: paper (open, save to library, add to collection), collection (paper count, visibility, "everyone in this chat can view it" when access was granted), dataset, profile (view, message), file (images inline, other files download), link. - Chat info: members with admin controls (add, remove, make admin), group name and description, mute, and a Shared in this chat library with Papers, Collections, Files and Links tabs, each item linking back to its message. Clear history for me, leave group, block. - Privacy: a settings dialog for "who can message me" (Everyone / Nobody new) and the blocked list. - Entry points: - Messages in the app sidebar, with an unread badge that updates live on every page. - Send on every paper card (feeds, search, the paper page), which opens "Send in a DM": pick chats or find people, add a note. - Send on the collection page; for a private collection you own or edit, it can give the recipients view access. - Message on @username profiles (signed-out visitors are sent to sign in first). - Checks: svelte-check shows no errors in any DM file or in the files I touched; the repo total is unchanged apart from SvelteKit's generated types for the new stream route, which svelte-kit sync produces. Unit tests (16) and integration flows (9) pass. - Not done here: I couldn't click through the page — that needs a signed-in browser session — so the UI hasn't been seen running. Notifications for messages (email or push) aren't part of this; the live badge and the tab title count cover the in-app case. Usernames, @mentions and link previews - Username required: you need a username to message other people (start a chat, create or add to a group, send outside Saved Messages). People without one don't appear in search and can't be added. Messages shows an inline "choose a username" form in the chat list, the New message dialog, the composer and "Send in a DM"; it saves through the existing /api/user. - @mentions: typing @ in the composer lists the chat's members; it filters by username or first letters of a name as you type, and ↑/↓ plus Enter or Tab inserts @username. The server records which members each message mentions (recomputed on edit). Mentions of you are highlighted in the thread. - "@" badge: the chat list shows an @ badge beside the unread count when unread messages mention you, also in muted chats. It clears when you read the chat. System notices ("Ada added Bob") no longer count as unread on the server, matching the page. - Link previews: the first ordinary link in a message (not a paper, collection or dataset, which already become cards) gets a preview while you type: site, title, description and image. × sends the link without one. Pages are fetched by the server through the PDF reader's guard (public addresses only, pinned connection, up to 4 redirects, first 256 KB, 4 s timeout) and cached for a week; failures are retried after an hour. The URL check is now shared as parsePublicUrl in public_pdf.ts. - Tests: 34 DM tests pass, including new ones for the username rule, mention counts, the preview parser and the private-address refusal. - Known gap: preview images load straight from the linked site, so that site sees the viewer's IP address, as with any embedded image. Proxying them would hide it. - Mentions don't make cards: an @username` in a message stays a clickable name and no longer adds a profile card. Profile cards still come from sharing a profile directly. --- ## Conversations URL: https://scholarxiv.com/developers/docs/health-api/conversations Continue, retrieve, list, manage, and share health chats. Conversations Save the chat_id returned by POST /api/v1/health/chat and include it with the next message. The server reloads history; do not resend the transcript or provide a system prompt. A research chat ID cannot be used for a health conversation. Read and manage conversations | Action | Request | | --------------------------------------- | --------------------------------------------------------------------------- | | Read a health conversation | GET /api/v1/health/chat/{chatid} (includes active_run) | | Read, stream, or cancel a turn | GET /api/v1/runs/{runid}, /stream, POST /api/v1/runs/{runid}/cancel | | List a conversation's turns | GET /api/v1/chats/{chatid}/runs | | List health chats | GET /api/v1/chats?surface=health | | Rename, pin, archive | PATCH /api/v1/chats/{chatid} | | Delete the chat and its health messages | DELETE /api/v1/chats/{chatid} | | Share | POST /api/v1/chats/{chatid}/share | Requests use the API key owner's conversations. See Conversations for the shared management request fields. Continue on the website Health conversations started over the API appear in the key owner's health sidebar on the website, at https://scholarxiv.com/health/{chatid}, titled from their first message. Continue them there, or pass a website health chat's id as chatid from your app. A turn still running when the chat is opened streams in live. See Continue on the website. Streaming Set stream: true on POST /api/v1/health/chat for the AI SDK UI-message event stream. X-Chat-Id and X-Run-Id are available before the first token, and every event carries an id you can resume from. See Streaming for the event format and Runs for background mode, resuming, Idempotency-Key, and the one-turn-per-conversation rule. The MCP healthchat tool calls the same health service and returns a completed answer, or a background run you read with getagent_run. Website and mobile clients use session POST /api/health/chat, which records the same runs. --- ## Errors and limits URL: https://scholarxiv.com/developers/docs/health-api/errors Health API status codes, plan access, and request limits. Errors and limits All Health API routes require an API key and Go or above. They use the account's existing API rate limits and storage quotas. Status codes | Status | Meaning | | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | | 400 | Invalid parameters, malformed JSON, or invalid observation fields. | | 401 | Missing or invalid API key. | | 403 | Health or the requested model is unavailable on the plan, or required health-profile consent is missing. | | 404 | Unknown conversation, run, condition, or health log; another account's log is also unavailable. | | 409 | Attachment conflict, a turn already running on the conversation (runinprogress), or an Idempotency-Key request still starting. | | 413 | Oversized conversation context. | | 422 | An Idempotency-Key reused with a different request body. | | 429 | API rate limit reached. | | 502 | Assistant or upstream request failure. | Use the response's error information to identify the failing request. See Agent API errors for the shared error contract and retry guidance. Request limits - Chat messages: up to 64,000 characters; up to ten reply excerpts and five ready health attachments per turn. - Files: up to 20 MiB each, subject to storage and per-chat limits. - Paper search: query length 2–500 characters and 1–20 results per source. - Health logs: each log retains its newest 180 entries; list requests accept limits from 1 to 100. See Quickstart, Medical paper search, Files and dictation, and Health logs for field-level validation. --- ## FAQ URL: https://scholarxiv.com/developers/docs/health-api/faq Answers about paper-only search, account ownership, consent, tools, and health conversations. FAQ Can I get papers without an AI answer? Yes. Use Medical paper search: GET /api/v1/health/search?q=... returns { topic, papers } from the same search service as the health chat tool, without creating a chat. Do I need to implement the chat tools? No. The server selects the same medical literature and medication tools as /health. For direct reference data, use Medication and condition references. Which account owns the data? The API key owner. Profiles, files, and chats share that account's website and MCP workspace. Each user needs their own account and key; a developer key does not create separate patient records. When is profile consent required? Saving a health profile requires consentGiven: true. Creating logs, reading individual logs, and adding entries require consent. Without consent, the log list is empty; log deletion remains available. See Health profile and Health logs. Can I continue a research chat through the Health API? No. Use a health chat_id with POST /api/v1/health/chat. Use the Agent API for research conversations. How do I choose a model? Use GET /api/v1/models?surface=health to list entitled models. Pass a supported model or auto; when omitted, the plan's health model is used. --- ## Files and dictation URL: https://scholarxiv.com/developers/docs/health-api/files Upload health documents and images, attach files, and transcribe audio. Files and dictation Upload a file and ask about it This JavaScript example uses a server-side API key and Node's file API. The signed upload URL expires after 60 seconds; upload immediately, then complete before attaching the file to a message. Files are limited to 20 MiB each and five attachments per chat turn, subject to account storage and per-chat limits. Supported document types include PDF, DOCX, plain text, Markdown and CSV, plus supported images such as JPEG and PNG. See Files and dictation. Only ready files owned by the caller can be attached. GET /api/v1/uploads?scope=health lists files; GET /api/v1/uploads/{id} returns a download URL valid for 300 seconds. Do not send your API key to the signed storage URL. Dictation Send multipart audio and provider (addis or elevenlabs) to POST /api/v1/transcribe, then send the transcript as message to POST /api/v1/health/chat. See the shared Files and dictation guide for the transcription contract. --- ## Health API URL: https://scholarxiv.com/developers/docs/health-api Health chat, medical paper search, profiles, reference lookups, files, and private health logs. Health API Build on the same services as /health using an API key from the Developer Dashboard. Send Authorization: Bearer sxv... or x-api-key: sxv... on every API request. Health requires Go or above and uses your existing account's API rate limits and storage quotas. All private data belongs to the API key owner and is shared with that account's website and MCP workspace. Keys do not create separate patient accounts. Each user of an integration needs their own account/key; never pass a user ID or use one developer key to store multiple people's profiles. Keep keys on your backend. The machine-readable contract is available at OpenAPI, with an interactive API reference. | Feature | Endpoints | | ----------------------------------------- | -------------------------------------------------------------- | | Assistant | POST /api/v1/health/chat, GET /api/v1/health/chat/{chatid} | | Runs: background turns, resume, cancel | GET /api/v1/runs/{run_id}, /stream, /cancel | | Agent usage | GET /api/v1/usage?surface=health | | Profile, saved medications and conditions | GET, POST, DELETE /api/v1/health/profile | | Medication reference | GET /api/v1/health/medication?name=metformin | | Condition reference | GET /api/v1/health/condition?q=migraine | | Medical paper search | GET /api/v1/health/search?q=migraine | | Symptom choices | GET /api/v1/health/symptoms?kind=acute | | Health logs | GET, POST /api/v1/health/trackers | | Individual log | GET, DELETE /api/v1/health/trackers/{trackerId} | | Record symptoms and observations | POST /api/v1/health/trackers/{trackerId}/entries | | Files | Shared /api/v1/uploads routes with scope: "health" | POST /api/v1/health/chat runs the same assistant as the website's /health chat: the same system prompt, health profile, medical tools, model routing, continuation, and conversation storage. Health is available on Go and above. The profile, medications, and literature tools stay on the server. It also shares the Agent API's harness: each turn is a durable run you can start in the background, resume, cancel, and retry safely with an Idempotency-Key; the same per-request controls and structured output apply; and every turn reports metrics. Use the Agent API for the research workspace. This endpoint answers health questions with the caller's health profile and the medical literature and medication tools. Where to start - Quickstart — Authenticate, ask a health question, and continue the conversation. - Medical paper search — Search the same medical evidence sources as the health chat tool, with paper results only. - Health profile — Manage consent, saved conditions, and medications for the API key owner. - Medication and condition references — Look up medication labeling and condition definitions with related research. - Health logs and symptoms — Create health logs, record observations, and browse symptom choices. - Files and dictation — Upload health documents and images, attach files, and transcribe audio. - Conversations — Continue, retrieve, list, manage, and share health chats. - Errors and limits — Health API status codes, plan access, and request limits. - FAQ — Answers about paper-only search, account ownership, consent, tools, and health conversations. --- ## Health profile URL: https://scholarxiv.com/developers/docs/health-api/profile Manage consent, saved conditions, and medications for the API key owner. Health profile The assistant reads the caller's health profile on every turn, the same way /health does. consentGiven: true is required. GET /api/v1/health/profile reads it. DELETE /api/v1/health/profile?confirm=delete removes the profile, trackers, and lab panels. Profile writes replace the editable profile fields, rather than patching individual fields. To update medications or conditions, read the profile and submit the complete desired profile with consent. The profile stores arrays of medication and condition names; medication reference lookups do not alter those arrays. Private data belongs to the API key owner and is shared with that account’s website and MCP workspace. Keys do not create separate patient accounts. Each user of an integration needs their own account and key. --- ## Quickstart URL: https://scholarxiv.com/developers/docs/health-api/quickstart Authenticate, ask a health question, and continue the conversation. Quickstart Use an API key from the Developer Dashboard. Send Authorization: Bearer sxv... or x-api-key: sxv.... Health requires Go or above. Keep keys on your backend. Ask a question The default response matches the Agent API JSON shape: chatid, runid, text, model, usage, metrics, finish_reason, and the full assistant message, including tool parts. stream: true is the same AI SDK UI-message event stream, with X-Chat-Id and X-Run-Id available before the first token. Every health turn is a run, exactly as on the Agent API: send background: true to get 202 and read the answer from GET /api/v1/runs/{runid}, resume a dropped stream from its last event id, and send an Idempotency-Key header so a retry returns the same run instead of asking twice. One turn runs per conversation at a time; a second message meanwhile returns 409 runin_progress. Send chat_id to continue. The service reloads stored history. Do not send a transcript, a system prompt, or a user id. Request fields | Field | Type | Meaning | | ----------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | message | string, required | Nonblank question, up to 64,000 characters. | | chat_id | string | Owned health conversation ID. Omit to create one. A research chat ID is rejected. | | stream | boolean | Default false. | | model | string | An entitled health model or auto. Defaults to the plan's health model, which can read long context, images, and PDFs. | | attachment_ids | string[] | Up to five ready files owned by the caller, uploaded with scope: "health". | | replycontexts | object[] | Up to ten excerpts being replied to: { "text", "sourcemessage_id"? }. | | background | boolean | Default false. Return 202 with the run at once; cannot be combined with stream: true. | | max_steps | integer | 1–5. Lowers the tool-step budget for this turn. | | tools | object | allow / deny lists of health tool names (searchMedicalLiterature, resolveMedications, getMedicationReference, getDrugLabelInteractions), and memory: false. | | response_format | object | A JSON Schema to also return the answer as a matching output object — see Structured output. | | metadata | object | Up to 16 string tags stored on the run and its usage row. | GET /api/v1/health/chat/{chatid} returns the stored conversation and its active_run. GET /api/v1/models?surface=health lists the models this plan can run. --- ## Medication and condition references URL: https://scholarxiv.com/developers/docs/health-api/references Look up medication labeling and condition definitions with related research. Medication and condition references Medication returns { query, rxnorm, fda }: RxNorm identifiers, ingredients, properties and NDCs, plus FDA metadata and label sections. Inspect rxnorm.found and fda.found; a successful lookup may have no matching reference. name must be 1–120 characters. These are labeling references, not a scored drug-interaction assessment. Condition returns { query, info, papers }. info includes the MONDO identifier, label, definition when available, synonyms, and source links; papers contains related research. q (or its name alias) must be 2–120 characters. A condition lookup failure returns 404, matching the website service. --- ## Medical paper search URL: https://scholarxiv.com/developers/docs/health-api/search Search the same medical evidence sources as the health chat tool, with paper results only. Medical paper search Use GET /api/v1/health/search for paper results from the same searchMedicalLiterature service used by the /health chat tool. It does not create a conversation, read your health profile, or generate an assistant answer. The same API-key authentication, Go-or-above requirement, and API rate limits apply. | Parameter | Meaning | | --------- | --------------------------------------------------------------------------------------------------------------------------------------------- | | q | Required search topic, 2–500 characters after trimming. | | sources | Optional comma-separated subset of pubmed, medrxiv, biorxiv, clinicaltrials, openalex, and semantic_scholar. Defaults to all six. | | limit | Results per source before deduplication, 1–20; default 8. The combined result may exceed this value. | The response is { "topic": "migraine prevention", "papers": [...] }, matching the chat tool's result shape. Each paper includes externalID, source, title, authors, summary (abstract), year, published, doi, url, pdfLink, primaryCategory, category, and citationCount. Unavailable years or citation counts are null; unavailable DOI or PDF links may be empty strings. Results can include preprints and trial records, depending on the selected sources. No results returns papers: []. Search uses the chat tool's best-effort source aggregation: unavailable providers can reduce the results. Invalid parameters return 400. --- ## Health logs and symptoms URL: https://scholarxiv.com/developers/docs/health-api/trackers Create health logs, record observations, and browse symptom choices. Health logs and symptoms First save a profile with explicit consent, then create a log: The response is { id, title, kind, status, startedAt, createdAt, updatedAt, entries }. Kinds are acute, pregnancy, and custom; titles must contain 1–80 characters. New logs are active. Fetch symptom options with GET /api/v1/health/symptoms?kind=acute (the default kind). The response is { kind, symptoms: [{ id, label, urgent? }] }, using the same options as the website. You may also record your own symptom strings. Use the returned log id as trackerId: | Entry field | Validation | | -------------------------------- | ------------------------------------------------------------------------------- | | severity | Integer from 0 to 10 | | symptoms | Up to 16 nonblank strings, each up to 60 characters; duplicates are removed | | temperature, temperatureUnit | Positive number and C or F; send both together. Stored to one decimal place | | activityImpact | normal, limited, or unable | | note | Up to 1,200 characters | Supply at least one observation. Invalid fields, unknown properties, and empty entries return 400. The response contains the saved fields plus server-generated id and recordedAt; omitted observation fields are null or an empty symptoms array. Each log retains its newest 180 entries. GET /api/v1/health/trackers?limit=20 returns { consentGiven, trackers, nextcursor }. Follow nextcursor with ?cursor=...&limit=20; limit is 1–100 and ordering is newest log ID first. Without consent the list is empty. GET /api/v1/health/trackers/{trackerId} reads a log; DELETE permanently removes it and returns { "deleted": true }. Unknown or another account's IDs return 404. Creating logs, reading individual logs, and adding entries require consent. Deletion remains available without consent. --- ## Journal Platform Research URL: https://scholarxiv.com/developers/docs/journal-platform-research Building a Journal Inside ScholarXIV — Research Dossier Everything a submission → vetting → publication pipeline actually consists of, reverse-engineered from the real systems: arXiv, Nature (Springer Nature), bioRxiv / medRxiv, PLOS ONE, eLife, F1000Research, and the three manuscript systems that run most of the industry (ScholarOne Manuscripts, Editorial Manager, Open Journal Systems). Sources are primary — publisher/server author guides fetched July 2026. Where a number is quoted (word counts, dpi, character limits) it is quoted from the source, not from memory. 0. TL;DR — the three archetypes Every venue in scholarly publishing is one of three machines. Pick which one(s) we are building before anything else, because the data model and the UI diverge hard after the submit button. | | A. Preprint server | B. Selective journal | C. Publish-then-review | |---|---|---|---| | Examples | arXiv, bioRxiv, medRxiv | Nature, PLOS ONE, Science | F1000Research, eLife (new model) | | Gate before public | Moderation/screening (hours–days) | Peer review (months) | Prepublication checks (days) | | Reviewers | none | 2–3 invited experts | invited, after publication, reports public | | Outcome | posted / declined | accept / revise / reject | always published; review status is a badge | | Versions | v1, v2, v3… same DOI | R1, R2… one final VOR | Version 1, 2, 3 each with own DOI | | Cost to author | free | $0–$11.5k APC | APC | | Rejection exists? | only for scope/ethics | yes, ~92% at Nature | no — only "not indexed" | My recommendation for ScholarXIV: build A first (it is a 2–3 week feature and it works with the LaTeX workspace you already have), design the schema so C is a config flag on top of it, and treat B as the paid/institutional tier later. Rationale in §19. 1. The universal object model Strip away branding and every one of these systems has the same seven objects. Build these and you can express any of the three archetypes. Two things people always get wrong on the first build: 1. Metadata is versioned, not attached to the submission. Titles, author order, and abstracts change between rounds. Nature explicitly rewrites summary paragraphs after acceptance. 2. Files have a *designation*, not just a name. ScholarOne calls it "file designation", Editorial Manager calls it "item type". This is what decides: does it go in the reviewer PDF? Is it anonymized? Does it go to production? See §12.4. 2. arXiv — complete walkthrough The most implementable model, and the one your users already live in. 2.1 Prerequisites (before you can even start) | Gate | Rule | |---|---| | Account | Must be a registered arXiv user. | | Endorsement | First-time submitters, and anyone posting to a new category, must be endorsed. | | Automatic endorsement | Granted if you have claimed ownership of papers submitted by co-authors and have an institutional email address. | | Manual endorsement | Start a submission → pick category → arXiv emails you an endorsement request with a shareable code (6-char alphanumeric). You find an eligible endorser (abstract pages carry a "Which authors of this paper are endorsers?" link), they submit positive / negative / abstain. Need ≥1 positive per category. | | Endorser eligibility | Must have authored enough papers in that "endorsement domain"; only papers submitted 3–5 years ago count. Calibrated so any active scientist of a few years can endorse. | | Explicitly not | "Endorsement is not peer review." Endorsers verify the person is a real researcher in that field — not that the paper is correct. | 2.2 The submission wizard, screen by screen 1. Start — "START NEW SUBMISSION" on the user page. 2. Prepare Files — choose file(s); zip/tar.gz for multi-file. Upload. Delete extraneous files (trashcan icon / "Delete All"). 3. Check Files — automated analysis detects: the correct processor/compiler, the top-level TeX file, and extraneous files it recommends deleting. 4. Compiler & top-level file — auto-detected compiler shown in a dropdown, overridable. Only .tex files containing \documentclass are offered as top-level. Multiple top-level files can be selected → concatenated output. 5. Auto-detected Notes — review recommended deletions; uncheck what you want to keep. "Return to Upload Step" available. 6. Accept and Continue → confirmation popup for deletions. 7. Compile & preview — success/failure with the full log. On success, preview the PDF. 8. Metadata (§2.3). 9. License (§2.4). 10. Agreements — Submittal Agreement, Code of Conduct, Moderation policies, Privacy policy. 11. Review & Submit Article — the timestamp is set here. 12. Unsubmit is available up to announcement (returns it to incomplete; no new version is generated for pre-announcement edits). 2.3 arXiv metadata fields — exact spec All fields are ASCII only; Unicode must be converted to LaTeX. ("Bad character" errors almost always come from pasting curly quotes/em-dashes/ligatures out of a PDF.) | Field | Req | Rules | |---|---|---| | Title | ✔ | No ALL CAPS, no Unicode. Limited MathJax + LaTeX accent commands. Expand cryptic macros. May reference arXiv:YYMM.NNNNN. | | Authors | ✔ | Firstname Lastname or Firstname Middlename Lastname. No honorifics. Initials with periods allowed. No ALL CAPS. No commas or the word "and" inside a name. Suffixes attach without comma (John Smith Jr). Affiliations in parentheses, city/country only — no street/zip. Numbered form: Author One (1), Author Two (1 and 2) ((1) Inst One, (2) Inst Two). Collaboration names allowed. | | Abstract | ✔ | Max 1920 characters. Must not contain the word "Abstract". Some LaTeX via MathJax. Carriage returns stripped unless followed by leading whitespace. Strip ~, \,, \ , \em, \it, font commands. | | Comments | ○ | Page + figure count; "to be published in…", "submitted to…", conference info; author roles ("Appendix by…"). For replacements, describe the change. URLs need a trailing space. No copyright statements. | | Categories | ✔ | One primary (drives the announcement mailing) + optional cross-lists. | | Report-no | ○ | Institution-assigned number only, e.g. EFI-94-11. Nothing else. | | Journal-ref | ○ | Only if already published. Volume, year, pages. Multiple separated by ; . No URLs. | | DOI | ○ | DOI of another version of the article. Do not put the arXiv-assigned DOI here. Space-separated for multiples. | | MSC-class | ○ | Math only. 14J60 (Primary) 14F05, 14J26 (Secondary). | | ACM-class | ○ | CS only. F.2.2; I.2.7. | | "Are you an author?" | ✔ | Yes/no. Submitter becomes the article owner with edit rights regardless. | 2.4 arXiv licenses (irrevocable — cannot be changed later) - CC BY 4.0 - CC BY-SA 4.0 - CC BY-NC-SA 4.0 - CC BY-NC-ND 4.0 - CC0 1.0 (public domain) - arXiv.org Perpetual, Non-Exclusive License 1.0 (minimum grant: arXiv may distribute, nothing more) All metadata is CC0 regardless of the article license. 2.5 File formats | Preference | Format | |---|---| | 1 | (La)TeX, AMS(La)TeX, PDFLaTeX | | 2 | PDF (author-authored, not TeX-derived) | | 3 | HTML with JPEG/PNG/GIF | | Rejected | DVI; PS; PDF generated from TeX/LaTeX source; scanned documents in any format | - Figures: PS/EPS for the LaTeX path; JPEG/GIF/PNG/PDF for the PDFLaTeX path. Mixing the two is the #1 compile failure. - Filenames: only a-z A-Z 0-9 _ + - . , =. Case-sensitive — Figure1.PDF ≠ figure1.pdf (the #2 compile failure). - Submissions with omitted figures are not accepted, even with external links. - Size: no published hard cap; from Feb 2026 arXiv warns on images >34 megapixels (≈ A4 @ 600dpi). Oversized submissions get an automatic rejection identifier; you email admins with that ID to request an exception. Guidance: JPEG for photos, PDF/PNG/GIF/PS for line art. Common failure list arXiv itself publishes: mixed figure formats; filename case mismatch; missing custom .sty; missing/misnamed/wrong-path files. 2.6 Moderation (the vetting model to copy) - Who: volunteer subject-matter experts with terminal degrees, approved by discipline advisory committees + arXiv staff. Confidential, treated like journal peer review. - Criteria: (1) scholarly standards — real sections, figures, references, careful prep; (2) scholarly interest — originality/novelty/significance; no falsified or plagiarized material; (3) content type & format — research articles primary; no egregiously offensive images; significant generative-AI use must be disclosed; (4) scope — must fit the taxonomy and serve a represented community; (5) originality — no duplicated content; max 3 back-catalogue papers per day per submitter. - Outcomes: Accept · Reclassify (move/cross-list) · Decline (pre-announcement) · Withdraw (post-announcement policy violation) · Hold (extra scrutiny for authors with prior rejections). - Appeals: exist for classification and decline; decisions on appeal are final, no feedback given; some appeals require prior journal publication. - Timing: submitted by 14:00 ET → generally available 20:00 ET. 2.7 Lifecycle after announcement - Replace (not withdraw) for updates → new version v2, v3…; all prior versions stay publicly downloadable forever. - Withdraw creates a new version marked withdrawn, displaying the reason and not linking to full text. Valid reasons: fundamental error, legitimate scientific concern. Invalid reasons: "it got published" (use journal-ref), "I updated it" (use replace), copyright (separate process). - Nothing is ever truly deleted post-announcement. 3. Nature — complete walkthrough The reference implementation for a highly selective journal. ~8% acceptance; most submissions are declined without external review. 3.1 Initial submission — deliberately loose Nature is "flexible with regard to the format of initial submissions… style and length will not influence consideration." What they actually want: | Item | Spec | |---|---| | Container | One single PDF or Word file, ≤30 MB, text + figures together, figure legends on the same page as their figure. | | Line numbers | Required. Word docs are auto-numbered by the system; if you supply PDF you must number the lines. | | LaTeX | Not accepted at initial submission — PDF only. LaTeX is accepted at acceptance stage. | | Title | ≤ 75 characters incl. spaces (two print lines). No technical terms, abbreviations, or active verbs. | | Authors | Corresponding author(s) marked with `. LLMs cannot be authors.* LLM use documented in Methods. | | Abstract / summary para | Fully referenced, ideally ≤ 200 words, structured as: 2–3 sentences of basic-level intro → background & rationale → main conclusions ("Here we show…") → 2–3 sentences of general context. | | Main text | ~2,500 words + 4 display items (typical 6-page article) or ~4,300 words + 5–6 display items (8-page). A "modest" display item ≈ ¼ page ≈ 270 words; a composite figure ≈ ½ page ≈ 600 words. Subheadings ≤ 40 chars. | | References | ≤ 50 in main text; article titles required; one publication per number; superscript numerals; no EndNote linked fields; all authors listed unless >5 → first author + et al. Preprints and DOI'd datasets are citable. | | Methods | Typically ≤ 3,000 words; Methods-only refs don't count; no figures/tables allowed inside Methods. | | Extended Data | Up to 10 multi-panel items — online only, not in print. | | Supplementary Info | Only material too large/impractical for print; should not contain figures (those become Extended Data). | | Cover letter | Optional. Not shared with referees. Use it for: why it matters, conflicts of interest, related work in press/submitted elsewhere. | | Related manuscripts | Mandatory disclosure of any overlapping-authorship manuscript under consideration (incl. under appeal) or in press elsewhere — copies uploaded as separate marked files. | | Double-anonymized | Opt-in checkbox at submission; anonymization is the author's responsibility, editors don't verify. | 3.2 Required statements (initial submission) - Author contributions — per-author, by initials. Mandatory. - Competing interests — mandatory for all content. - Funding — separate statement, only if the work arose directly from a specific grant. - Data Availability — in Methods, under that exact heading. Certain data types must be deposited in a structured public repository with accession numbers, fully open at publication. - Code Availability — required whenever custom code is central to the conclusions; editors may decline the paper if important code is unavailable. - Materials & Correspondence — who handles requests. - Acknowledgements — brief, no thanks to referees/editors, no effusive adjectives. - Reporting Summary — life sciences + behavioural/social sciences: a completed PDF form, available to editors and reviewers during assessment, published with the accepted paper. (Uses advanced Acrobat features — must be filled in Adobe Reader.) - Discipline checklists: CONSORT (phase II/III RCTs — non-conforming reports may be sent back before review), REMARK (tumour-marker prognostic studies), BRISQ Tier 1 (human biospecimens), trial registration in ClinicalTrials.gov or an ICMJE-recognized registry before enrollment. - Crystallography: .cif file + structure factors (embedded, or .hkl/.fcf) + CheckCIF PDF output explaining every A/B-level alert + probability-ellipsoid figure in the SI. - Compound numbering: all inorganic/organic compounds bold-numbered in order of appearance. 3.3 Statistics reporting (they are strict) Methods must carry a statistics subsection stating each test and whether one- or two-tailed; error bars defined in every figure legend; exact n for every statistic (individual values, not a range); number of repeats for representative results; exact P values for significant and non-significant results; F and df for ANOVA; t and df for t-tests; replicates explicitly defined. 3.4 The editorial process Criteria for publication: original research (not published/submitted elsewhere) · outstanding scientific importance · conclusion of interest to an interdisciplinary readership. Special cases: large-dataset papers need comprehensiveness or a technical/scientific advance; purely technical papers need broad community impact; therapeutic papers without mechanism need major disease impact. Referee selection criteria (verbatim): independence from authors and their institutions · ability to evaluate technical aspects fully and fairly · currently/recently assessing related submissions · availability within the requested time. Authors may suggest referees (with contact details) and may exclude one or two (no more) competing groups; editors decide. Potential referees must disclose professional/commercial competing interests before agreeing, and must not circulate the manuscript. The five decision outcomes: 1. Accept, no further changes. 2. Accept in principle after revisions — usually not re-sent to referees; editor checks. 3. Decision deferred pending revision — further experiments needed; is re-sent to some/all referees; requires a point-by-point response to every comment. 4. Reject, but resubmission would be considered — letter states this explicitly; resubmission must address all technical comments + point-by-point response, else it isn't re-reviewed. 5. Reject outright, no resubmission — appeal only in writing, on scientific grounds; manuscript may not be submitted elsewhere while an appeal is pending; new referees are rarely brought in; decisions are weighted by referee expertise, "not by a voting procedure." Reviewer questions Nature actually asks (this is your reviewer form): - Key results — outstanding features of the work. - Validity — flaws that should prohibit publication. - Originality and significance — with references if not original; interest to own discipline / multiple disciplines. - Data & methodology — validity of approach, quality of data and presentation; reviewers are expected to review Extended Data and Supplementary Information too; is it detailed and transparent enough to reproduce? - Appropriate use of statistics and treatment of uncertainties — error bars defined; comment on the appropriateness of each statistical test. - (plus) confidential comments to the editor — welcome, but must not contradict the comments to the authors. Transparent peer review: for manuscripts submitted since Feb 2020, reviewer comments + author rebuttals of published research articles are published as a supplementary peer-review file (opt-in; research Articles only; not for transferred versions reviewed at another Nature journal). Reviewer recognition: every peer-reviewed paper carries an acknowledgement statement; reviewers may consent to being named ("Nature thanks X, Y and Z for their contribution to the peer review of this work" / "…and the other, anonymous, reviewer(s)…"). Transfers: a decline letter carries a link to transfer all materials + decision letter + referee comments to another Springer Nature journal without re-entering submission info. Referee comments travel; between journals with in-house editors, referee identities travel too. 3.5 Final (post-acceptance) submission — this is where the real forms appear Text and display items now go up as separate files, plus scanned signed forms. - Text: Microsoft Word preferred, style tags removed, 12pt Times New Roman, single carriage returns, no indents/page breaks, real super/subscript formatting, Symbol font or normal text for Greek/math, Equation Editor/MathType only where unavoidable. - LaTeX: accepted now, but converted to Word before typesetting. Rules: any standard class (article.cls, revtex.cls, aastex.cls, amsart.cls); remove all personal macros; avoid non-standard packages; everything (tables, captions, Methods, refs) in a single .tex file; graphics supplied separately, not called at compile time; numerical citation style only, in text order; BibTeX users must paste the .bbl content into the .tex and delete \bibliography; must compile clean with no errors/warnings; upload a PDF alongside. - Order of elements (exact): title → authors → affiliations (+present addresses) → bold first paragraph → main text → references → tables → figure legends → Methods (+Methods refs, with Data and Code Availability at the end) → acknowledgements → funding → author contributions → competing interests → additional information (SI line + corresponding author line) → Extended Data figure legends and table titles/footnotes. - Print figures: vector with editable layers preferred. Accepted: .ai, .eps, .pdf, .ps, .svg (vector); layered .psd/.tif (layered art); .psd, .tif, .png, .jpg (bitmap); .ppt if fully editable; ChemDraw .cdx for structures. Also acceptable: JPEG 300–600 dpi, CorelDraw ≤v8, Word, Excel, PowerPoint. Never: Canvas, DeltaGraph, TeX, ChemDraw, SigmaPlot (convert to PS/EPS/PDF). - Figure specs: RGB (recommended; CMYK accepted — RGB is auto-converted to CMYK for print) · 300–600 dpi for photographic · standard widths 89 mm (single col) / 183 mm (double col) / 120–136 mm (1.5 col), page depth 247 mm · sans-serif throughout (Helvetica/Arial) · panel labels 8pt bold lowercase a, b, c · other text max 7pt, min 5pt · line weights 0.25–1 pt at final size · don't rasterize or outline text/lines · avoid red/green pairing, prefer green/magenta, no rainbow colour scale · figure legends <250 words each, starting with a title sentence, understandable in isolation. *(Note: the initial-submission guide says "90 mm / 180 mm, max height 170 mm, font 5–7pt" — the final-submission guide's 89/183/247 is the production truth. Both are quoted here because our validator will need to pick one; use the production numbers.)* - Extended Data files: RGB, max 300 ppi, ≤10 MB, JPEG (preferred) / TIFF / EPS only, must fit one page (max 18 × 24 cm; tables 8.9 cm or 18 cm wide), filenames CorrespondingAuthorSurnameEDfig1.jpg / EDtable1.jpg. - Forms & declarations page: author checklist · competing interests declaration · Licence to Publish (Nature does not take copyright for original research — authors grant Springer Nature an exclusive licence to publish; Reviews/commissioned work get a copyright assignment instead; US-government/Crown employees get a non-exclusive licence) · standard structure tables for cryo-EM / X-ray / NMR (used as Extended Data tables) · reprints ordering. - Preprint policy: original submitted version may be posted any time; accepted version after a 6-month embargo; the published copyedited version may never be posted. - Then: subediting (copyedit for a general readership + house style) → edited text sent to author for approval → e-proof (figures + Extended Data) → author collates one set of corrections from all co-authors → sign-off → schedule. Nature reserves final say on style and figure size. - Open access: hybrid/transformative — gold OA or subscription, author's choice. APCs €2,490 (Scientific Reports) → €10,850 (Nature). Waiver fund for corresponding authors in World Bank LIC/LMIC countries (auto-applied at accept-in-principle, opt-out available). - Matters Arising: comments on Nature papers published within the past 18 months; online only. 4. bioRxiv / medRxiv — the pragmatic preprint model Operated by openRxiv (non-profit). Free. Not peer reviewed, not typeset. 4.1 Submission - Register first. Then either one PDF (text + figures + tables) or a Word file + separate figure files which their engine converts to a single PDF. - Figure formats the converter handles: JPEG, TIFF, EPS, PowerPoint. Not compatible: PICT, Bitmap, Excel, PSD — convert first. - LaTeX must be converted to PDF before submission (may additionally be uploaded as supplemental material on bioRxiv). - Title page must carry title, author names + affiliations, abstract (medRxiv states this explicitly). - Supplementary material as separate files; large datasets go to community databases (PDB, GenBank, BioLINCC…), not the server. - One subject category only on bioRxiv (~25 categories) — deliberately, to keep feeds non-redundant. - bioRxiv result type: New Results / Confirmatory Results / Contradictory Results. 4.2 Screening (the vetting model) Screened for: plagiarism · non-scientific content · inappropriate article types · material that could endanger individual or public health (explicitly includes dual-use research of concern and work that could compromise accepted public-health measures on transmission/immunization/therapy). Manuscripts with prior concerns get extra scrutiny. Typically live within 72 hours, longer over weekends/holidays or if flagged. Server reserves the right to decline anything for any reason. Out of scope on bioRxiv (auto-decline list, worth copying as a rules engine): case reports/series · work not premised on modern biology/physiology · clinical veterinary studies · narrative reviews · editorials/letters/opinion · tool announcements without data · advertisements · addenda · hypotheses without new data · lab protocols alone · meeting reports · white papers/policy statements · guidelines · theses/dissertations/term papers/textbook excerpts · teaching materials · individual figures/tables/datasets. Clinical work → medRxiv. Non-English → declined (they can only screen English). Images that could identify an individual → declined; blurring/pixelation is not enough. medRxiv scope is inverted for the health sciences: original research, systematic reviews and meta-analyses, data articles, methodological research, clinical study protocols — yes; narrative reviews, hypotheses, case reports, editorials/commentary/opinion, correspondence, standalone lab protocols — no. 4.3 medRxiv's extra declarations (the health-sciences compliance block) At submission the author must declare: all relevant ethical guidelines followed · IRB/ethics committee approvals obtained · patient/participant consent obtained and forms archived · clinical trial ID from an internationally recognized registry · competing interests including explicit acknowledgement of any payments or services from a third party in the past 36 months · funding statement including third-party payment for any aspect of the work · a data availability statement with links to externally hosted data. 4.4 Lifecycle - DOI at posting (10.1101/2019.12.11.123456, date-stamped since 11 Dec 2019). Revisions keep the same DOI; version-specific URLs (…v2) for citing a specific version. - Cannot be removed once posted — it is citable. medRxiv supports a "Withdrawn" marking with a posted reason; the original stays reachable via Info/History. Removal only for rare legal reasons. - Licenses offered: CC BY · CC BY-NC · CC BY-ND · CC BY-NC-ND · CC0 · no reuse. Author keeps copyright. Posting = consent to text mining. - B2J / M2J — direct transfer of files + metadata from the preprint server into ~250 partner journals and peer-review services, so authors never re-key anything. This is the single most valuable integration in the whole space and the one I'd copy first (see §19). - Journals can post their peer reviews onto the preprint's dashboard (J2B, review-linking). 5. PLOS ONE — the "sound science" journal (runs on Editorial Manager) Publication criteria (7) — notably not including importance or novelty: 1. Original research (not reviews, case reports, hypothesis papers, letters, commentaries, essays, opinion, policy papers, practice guidelines, other secondary literature, monographs). Accepted: Registered Reports (protocol + outcome), systematic reviews, methods/software/database/tool papers, qualitative research, negative/null results, Lab and Study Protocols. 2. Not published elsewhere, not under consideration elsewhere. Preprints are fine (bioRxiv, arXiv, theses, conference presentations). 3. High technical standard, described in enough detail to reproduce. 4. Conclusions supported by the data. 5. Intelligible standard English — PLOS ONE does not copyedit, so language is a rejection ground. 6. Meets ethics standards (human/animal/tissue, non-commercial cell lines, field sampling, biosafety — with approval body + permit numbers, or an explanation of why approval wasn't needed). COPE member. 7. Adheres to reporting guidelines and data-availability community standards. Manuscript structure: Title page → Abstract (≤300 words, no citations) → Introduction → Materials and Methods → Results → Discussion → Conclusions (optional) → Acknowledgments → References → Supporting information captions. Figure captions after first mention. Double-spaced, standard fonts (not Symbol), continuous page and line numbers, ≤3 heading levels, no footnotes, no multi-column layout. Files: DOC/DOCX/RTF (unlocked/unprotected); LaTeX → submit as PDF. Figures as separate files, cited in ascending order, filename matching the citation (Fig1.tif). Supporting info prefixed S (S1 Table). References: Vancouver/ICMJE, numbered in square brackets, first six authors then et al. Cover letter ≤1 page: contribution, relation to prior work, article type, suggested editors. Entered in the system, not the file: author names + affiliations, corresponding author, CRediT contributions per author, financial disclosure (funders, grant numbers, funder role), competing interests, ethics statement, data availability statement, originality/ethics confirmations. 6. eLife — publish, review, assess (no accept/reject) 1. Submit directly, or transfer from bioRxiv/medRxiv. 2. Editors (working researchers) decide whether to review. That is the only gate. 3. Reviewers write public reviews. 4. Reviewed Preprint published = manuscript + public reviews + eLife Assessment + optional author response. Citable DOI. 5. Author may post revised versions (assessment updated), and may finally elect a Version of Record (funder-OA compliant). The eLife Assessment vocabulary — a controlled two-axis rubric, and the single best UI idea in modern publishing. Copy this pattern. Significance of findings: Landmark (profound, widespread influence) · Fundamental (substantially advances major research questions) · Important (implications beyond a single subfield) · Valuable (implications for a subfield) · Useful (focused importance and scope). Strength of support: Exceptional (sets new standards) · Compelling (more rigorous than state-of-the-art) · Convincing (validated, in line with state-of-the-art) · Solid (broadly supports the claims, minor weaknesses) · Incomplete (claims only partially supported) · Inadequate (methods/data do not support the primary claims). Fee: $3,750, waived for anyone who cannot pay. 7. F1000Research — publish-then-review Published as soon as it passes prepublication checks (originality, readability, author eligibility, policy/ethics compliance). Peer review by invited experts happens openly, after publication, and the article stays published regardless of the reports. Articles that pass review get indexed in Scopus/PubMed; everything is in Google Scholar regardless. Authors respond openly to reports; revised versions are free. Pre-submission requirements: work is original (preprints fine) · at least one author is a qualified researcher who made a key contribution · meets research/publication standards · all methodological details and data available for replication · full author + affiliation info + a conflict-of-interest statement · agreement to pay the APC (payer name, email, institution, country; VAT number if EU). 8. Registered Reports (the format that changes the state machine) Two-stage, review-before-results: - Stage 1 manuscript = Introduction + Methods + pilot results. Reviewed on the question and the design. - → In-Principle Acceptance (IPA): publication is virtually guaranteed and cannot be revoked based on the outcomes — only for failing quality assurance, deviating from the registered protocol, or unresolvable reporting problems. - Authors run the study, then submit Stage 2 = the same Intro + Methods + Results + Discussion, with pre-registered analyses separated from a clearly labelled "Exploratory Analyses" section; data/scripts deposited (OSF, Figshare). - 300+ journals participate. The Stage 1 protocol can be registered on the OSF Registry. Implementation consequence: your Submission entity needs a stage field and a decision type inprincipleacceptance that locks the methods section. 9. The three manuscript systems (what authors actually click) 9.1 ScholarOne Manuscripts — "up to 7 steps" Author Centre → Begin Submission. Red asterisk = required; ? tooltips everywhere. Typical step order: Type/Title/Abstract → Attributes (keywords) → Authors & Institutions → Reviewers & Editors (preferred/non-preferred) → Details & Comments (funding, confirmations, cover letter) → File Upload → Review & Submit. - Keywords: journals with a controlled list get type-ahead + "add". - Funding: "Add Funder", picked from the FundRef/Crossref Funder Registry. - Co-authors: searched by email; if not found, you create the account for them; drag to reorder; tick to confirm the list matches the title page. - Files: each gets a file designation from a per-journal dropdown; everything designated "for review" is merged into one PDF proof whose page order you control; anything marked "file not for review" is excluded from that proof (this is how the de-anonymized full version is carried alongside a double-anonymized submission). - Review & submit: red crosses mark missing info; you must open the PDF proof; on double- anonymized journals, an un-anonymized proof gets the paper returned. - Revisions: from the Author Centre, "Create a revision" (never a new submission), with a visible days-left-to-revise counter; you must "view and respond to the decision letter" and paste a point-by-point response; ID gets .R1 appended (TANDF-2010-0014.R1); drafts sit in a "Revised Manuscripts in Draft" queue. - Unsubmitted drafts live in an "Unsubmitted Manuscripts" queue, highlighted in blue. 9.2 Editorial Manager — the status vocabulary authors obsess over Submitted to Journal → With Editor (an editor is assigned/doing checks; recurs at every editor hand-off) → Reviewers Invited → Under Review → Required Reviews Complete → Decision in Process (typically 1–3 weeks) → Decision Sent / Revise → Accept → Transfer to Production. Design lesson: authors read the status string as a promise. Whatever vocabulary we choose, it must be documented on a public page, and every transition must write an AuditEvent with a timestamp so "how long has it been in X" is answerable. 9.3 Open Journal Systems (OJS) — the open-source reference architecture Four stages: Submission → Review → Copyediting → Production. - Dashboard queues: My Queue (My Assigned) · Unassigned · All Active · Archives (declined + published; deleting a declined submission purges its files). Filters: status (incomplete/overdue/inactive 30 days), stage, section, assigned editor(s), assigned issue. Multiple values inside one filter = OR; across filters = AND. - Auto-assignment on submission by section or category; notification copies can go to the journal's primary contact. - Submission record panels: Submission Files · Pre-Review Discussions (editor↔author, editor↔editor) · Action buttons · Participants · Submission Library (COI forms, galley approval forms — visible to all participants except reviewers) · Document Library (journal-wide templates) · Preview · Metadata. - Anonymity is enforced at download time: reviewer downloads are renamed ojs-review-assignment-1-article-text-8.docx. - Pre-review actions: Send to Review · Accept and Skip Review · Decline Submission. (Buttons don't appear until an editor is assigned — a good guardrail.) - Recorded decisions replace the buttons and can be reverted with Change Decision. - Granular metadata permissions: global (Permit submission metadata edit on the Author role) or per-submission/per-stage (Allow this person to edit publication details), which unlocks Title & Abstract, Contributors, and Metadata on the Publication tab. - Review stage: multiple rounds, review forms, reviewer recommendations, then Request Revisions (with or without a new round) / Accept / Decline / Send to Copyediting. - Copyediting: assign copyeditor → author replies → final copyedited file → notify editor → Production: galleys (PDF/HTML/XML/EPUB) → schedule into an issue → publish. 10. Master field inventory — the complete submission form This is the union of every field the above systems collect. Mark each as required / optional / conditional per venue-config; that's how one form engine serves all three archetypes. A. Submission basics article_type (research / review / methods / registered report S1 / S2 / data note / comment) · section or subjectcategory (primary + optional cross-lists) · title · runningtitle · abstract (plain or structured) · keywords (free or controlled vocabulary) · language · wordcount · figurecount · tablecount · referencecount · result_type (new/confirmatory/contradictory) · isresubmission + prior ID · relatedmanuscripts[] (title, journal, status, uploaded copy). B. People For each contributor: givenname · familyname · suffix · email · affiliations[] (institution, ROR ID, dept, city, country) · is_corresponding · iscofirst / equal-contribution flag · presentaddress · creditroles[] (the 14 CRediT roles, §13) · authororder. Plus: grouporcollaborationname · nonauthorcontributors[] for acknowledgements (with written permission recorded) · deceased flag. C. Reviewer preferences suggestedreviewers[] (name, email, institution, reason) · opposedreviewers[] (max 1–2 groups at Nature; require a reason) · preferrededitor · reviewmodel_choice (single/double-anonymized, opt-in transparent review). D. Declarations (each needs a stored answer, a free-text field, and a timestamp) competing interests (incl. 36-month third-party payments) · funding (funder from the Crossref Funder Registry + grant numbers + funder role in the study) · ethics approval (body, protocol number, or justification for exemption) · informed consent (obtained, forms archived) · consent for identifiable images · animal welfare / ARRIVE · clinical trial registration (registry, ID, registered before enrollment) · biosafety / dual-use research of concern · data availability (statement type + repository + accession/DOI + access restrictions) · code availability · materials availability · AI/LLM use disclosure (which tool, what for, where documented) · preprint status + preprint DOI · prior presentation/thesis · plagiarism/originality attestation · "all authors have seen and approved" attestation · authorship-change requests (require signed agreement from all listed authors plus the person added/removed). E. Files — see §12. F. Rights license (from the venue's allowed set) · copyright_holder · signed licence-to-publish or copyright-transfer or government/Crown variant · oa_route (gold / green / subscription) · apc_payer (name, email, institution, country, VAT) · waiver request + eligibility basis · embargo for green OA. G. Compliance checklists — reporting summary, CONSORT/PRISMA/ARRIVE/STROBE/REMARK/BRISQ as applicable, plus a per-venue author checklist. 11. Peer review models — pick one per venue, per section | Model | Author sees reviewer? | Reviewer sees author? | Reports public? | Notes | |---|---|---|---|---| | Single-anonymized | ✗ | ✔ | ✗ | Industry default. | | Double-anonymized | ✗ | ✗ | ✗ | Requires an anonymized manuscript + a "not for review" full version; anonymization is the author's job and the system must show them the exact proof reviewers will see. | | Triple-anonymized | ✗ | ✗ | ✗ | Editor also blinded. Rare. | | Transparent | ✗ (unless signed) | ✔ | ✔ on publication, opt-in | Nature's model: reports + rebuttals as a supplementary file. | | Open / public | ✔ | ✔ | ✔ | F1000Research, eLife public reviews. Reviewers named. | | Post-publication | n/a | ✔ | ✔ | F1000Research; article published first. | | Collaborative / consultative | varies | ✔ | sometimes | Reviewers see each other's reports and confer (eLife, EMBO). | | Registered Report | ✗ | ✔ | ✔ (protocol) | Review before results (§8). | ReviewReport schema: recommendation (enum) · commentstoauthor (rich text) · confidentialcommentsto_editor · structured ratings (Nature's six axes in §3.4, or eLife's two-axis vocabulary) · competinginterestsdeclared · signed (bool → reviewer name published) · consenttopublishreport · consenttobenamed · timespent · attachedannotated_file · aiusedeclaration (COPE now explicitly treats undisclosed AI-drafted reviews as an integrity issue) · duedate, remindedat[], submitted_at. Recommendation enum (superset): accept · minorrevision · majorrevision · rejectandresubmit · reject · transfertosisterjournal · unableto_review · decline_conflict. 12. File formats — the complete matrix 12.1 Manuscript body | Format | arXiv | Nature initial | Nature final | bioRxiv | PLOS ONE | Our engine | |---|---|---|---|---|---|---| | LaTeX source | preferred | ✗ | ✔ (single .tex, converted to Word) | ✗ (as supplement only) | ✗ (PDF instead) | native | | PDF | ✔ (if not TeX-derived) | ✔ (≤30 MB, line-numbered) | alongside .tex | ✔ | ✔ (for LaTeX) | output | | DOCX | ✗ | ✔ (auto line-numbered) | preferred | ✔ (converted) | ✔ | import target | | RTF | ✗ | ✗ | ✗ | ✗ | ✔ | – | | HTML | ✔ (+JPEG/PNG/GIF) | ✗ | ✗ | ✗ | ✗ | – | | DVI / PS | ✗ | ✗ | ✗ | ✗ | ✗ | – | | Scanned | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | 12.2 Figures - Vector (preferred for line art): AI, EPS, PDF, PS, SVG. - Raster: TIFF/PSD (layered, editable) at 300–600 dpi; PNG; JPEG (highest quality setting). - Specialist: ChemDraw .cdx (structures), .cif/.hkl/.fcf (crystallography), PDB/EMDB accessions (structures), .ppt only if fully editable and unstyled. - Never accepted anywhere: Canvas, DeltaGraph, SigmaPlot, PICT, Bitmap, Excel-as-figure, PSD to bioRxiv's converter. - Colour: RGB recommended (wider gamut, faithful fluorescence online); CMYK for print fidelity; RGB→CMYK conversion mutes bright colours and reduces contrast. - Accessibility: avoid red/green contrast pairs; prefer green/magenta or another colour-safe palette; no rainbow scales. 12.3 Supplementary & data Supplementary files (video/audio/large tables/code) as separate uploads with size caps (Nature Extended Data ≤10 MB per file). Large datasets belong in domain repositories, not on the server: GenBank/ENA/DDBJ (sequence), PDB/EMDB (structures), SRA, GEO/ArrayExpress, ClinicalTrials.gov, Dryad, Figshare, Zenodo, OSF, protocols.io (methods). Accession numbers go in the manuscript and must be publicly released on the publication date, not later. 12.4 File designations (the dropdown that runs everything) manuscriptmain · manuscriptanonymized · titlepage · coverletter · figure · figuresource · table · supplementary · datafile · code · reporting_summary · checklist · ethicsdocument · permissionletter · responsetoreviewers · relatedmanuscript · notforreview · productionsource. Each designation carries booleans: includeinreviewpdf, visibleto_reviewers, visibletoauthors, goestoproduction, mustbeanonymized. 13. Authorship, contributorship, ethics ICMJE's 4 authorship criteria — all four must be met, by everyone listed: 1. Substantial contributions to conception/design or acquisition/analysis/interpretation of data; AND 2. Drafting or critically revising for important intellectual content; AND 3. Final approval of the version to be published; AND 4. Agreement to be accountable for all aspects of the work. Anyone meeting fewer than all four → acknowledgements, not authorship (funding acquisition alone, general supervision alone, writing/technical/language editing alone do not qualify). Editors do not arbitrate authorship disputes — the institution does. Author add/remove after submission requires a signed statement of agreement from all listed authors and the person being added or removed. ICMJE also flags exclusion of local LMIC researchers from authorship as grounds for questioning and possibly rejection. AI: disclose at submission whether AI-assisted technologies were used, describe the use in the cover letter and in the manuscript (acknowledgements for writing assistance; Methods for data collection/analysis/figure generation). Chatbots cannot be authors or be cited as authors. Humans remain responsible for everything, including plagiarism in AI-generated text and images. arXiv requires disclosure of significant generative-AI use as part of methodology standards. CRediT — the 14 roles (ANSI/NISO standard, CC BY 4.0, so we can embed it verbatim): Conceptualization · Methodology · Software · Validation · Formal analysis · Investigation · Resources · Data curation · Writing – original draft · Writing – review & editing · Visualization · Supervision · Project administration · Funding acquisition. COPE (Committee on Publication Ethics) provides the flowcharts we should implement as editor runbooks: ghost/guest/gift authorship · undisclosed COI in a submitted manuscript · peer-review manipulation suspected during review · concerns raised directly or via social media · removing an author after publication · risk in published data. Corrections taxonomy (build these as first-class publication events, each with its own DOI and a bidirectional link to the original): - Correction / Erratum (publisher error) and Corrigendum (author error) — minor. - Expression of Concern — when the editor is uncertain and cannot yet resolve it (insufficient info, delays, uncooperative parties). Publish this rather than delay. - Retraction — when the editor no longer has confidence in the results/conclusions: major errors, data/image irregularities, misrepresentation (fraud, identity theft, fictitious authorship), redundant publication without attribution, unauthorized use of material/data, unethical research, compromised peer review, or undisclosed COI that biases the work. Purpose is to correct the literature, not to punish. Notices must link to the retracted article, name title + authors, be published promptly, and be free to read. The editor makes the final call (editorial independence), the publisher supports. Batch retractions are a defined mechanism for paper-mill contamination. - Removal — legal only, extremely rare. 14. Post-acceptance: production and the persistent record 1. Copyediting — language, house style, clarity for non-specialists. (PLOS ONE skips this and rejects on language instead — a legitimate cost-saving choice for us.) 2. Author approval of the edited text, before typesetting. 3. Typesetting → galleys/proofs: PDF + HTML + JATS XML. Nature cycles e-proofs between production, typesetter and author; one collated correction set from the corresponding author. 4. JATS (ANSI/NISO Z39.96, Journal Article Tag Suite) is the archival XML format — the Journal Publishing Tag Set is the one to target. This is what PubMed Central, Portico, CLOCKSS and most indexers ingest. If we ever want to be indexed, we produce JATS. 5. DOI registration with Crossref (deposit XML, UTF-8, numeric character entities only — named HTML entities like é are invalid; upload via the admin tool or HTTPS POST). Metadata segments Crossref documents and expects: titles, contributors, affiliations (with ROR), abstracts, full-text URLs, license information, funding information, references, ISSN/ISBN, article IDs, archive locations, relationships (preprint↔VOR, correction↔original), MathML, multi-language content. 6. Deposit references (enables cited-by counts) and register the preprint→journal-article relationship so the preprint DOI points at the published version. 7. Preservation: CLOCKSS / Portico / LOCKSS — required by DOAJ-grade journals. 8. Indexing applications: DOAJ → Scopus → PubMed/PMC → Web of Science. 15. What it takes to be a real journal (DOAJ's checklist, condensed) DOAJ inclusion is the de-facto legitimacy bar for a new OA journal. Requirements: - Publishing volume: ≥5 research articles/year; a new journal needs >1 year of history or ≥10 published OA research articles before applying. - ISSN registered and confirmed at issn.org, displayed on the site; the title must match exactly. - Own dedicated URL; one unique URL per article; full text in HTML or PDF minimum. - Immediate OA: no embargo, no registration wall, open license (CC or equivalent). - Publicly posted, from the homepage: open access policy · aims and scope · editorial board with institutional affiliations of every member · instructions for authors · editorial process (peer review) · licensing terms · copyright terms · all author charges (submission fees, editorial processing charges, APCs, page charges, colour charges, waiver conditions; withdrawal charges may not exceed author charges; "no charges" must be stated explicitly) · publisher name, address, contact person, dedicated journal email. - Quality control: an editor and an editorial board (recommended ≥5 editors, not all from one institution, listed with names + affiliations); ≥2 independent reviewers per article (arts & humanities may substitute editorial review by ≥2 editors); peer-review type documented, including for special issues. - Endogeny ≤25% — papers where an author is an editor/board member/reviewer, measured over the last two issues (or the last calendar year for continuous publishing). - Special issues: EiC responsible for all content; guest-edited papers get the same external review and are clearly labelled; guest editors' credentials checked; guest editors' own papers independently handled and ≤25% of the issue. - Recommended: plagiarism checking (Crossref Similarity Check / iThenticate); display of submitted / accepted / published dates on each article. - No Impact Factor imagery from unofficial services; DOAJ is a DORA signatory. - No intrusive advertising. 16. Screening & integrity automation (what to build into the pipeline) Ordered by cost/benefit for us: 1. Similarity check — Crossref Similarity Check (iThenticate) or an open alternative. Threshold + human review of the report, never an automatic reject. 2. Scope/type classifier — bioRxiv's out-of-scope list (§4.2) as rules + an LLM classifier that proposes a category and flags out-of-scope types. We already have paper-classification infrastructure in this product. 3. Metadata completeness validator — required fields, ROR resolution, funder registry match, DOI syntax, ISSN, trial ID resolves in a registry. 4. Compile/render gate — we already have this: Tectonic in E2B. A submission that doesn't build isn't a submission (arXiv's model exactly). 5. Figure integrity — duplicate/spliced-band detection, EXIF/manipulation checks, minimum dpi, identifiable-person detection (bioRxiv declines these outright; blurring is not sufficient). 6. Reference integrity — do the cited DOIs resolve? Are any of them retracted? (Retraction Watch data is available via Crossref.) Are the references real? (Fabricated-citation detection is now a first-order need in an AI-drafted world.) 7. Author/affiliation sanity — disposable email domains, paper-mill patterns, sudden authorship-order churn, reviewer-suggestion emails on free domains (the classic peer-review manipulation signature COPE has a flowchart for). 8. AI-text signals — flag for human review only. Never auto-reject. 9. Dual-use / biosecurity screen — required if we ever touch health sciences. 17. Decision & status vocabulary (proposed) Every transition writes {actor, from, to, at, reason, visibility}. Author-visible status strings must be documented publicly — see §9.2. 18. Timelines observed in the wild (for SLA design) | Step | arXiv | bioRxiv/medRxiv | Nature | F1000Research | |---|---|---|---|---| | Screening/moderation | same-day (14:00 ET cut-off → 20:00 ET live) | usually ≤72 h | – | days | | Desk decision | – | – | ~1 week if not going to review | – | | Referee turnaround | – | – | ~2 weeks agreed | post-publication, open-ended | | Decision after reports | – | – | "routinely very rapid" | – | | Rounds to acceptance | – | – | 1–3, sometimes more | unlimited revisions | | "Decision in Process" (EM) | – | – | 1–3 weeks industry-wide | – | 19. Recommendation for ScholarXIV 19.1 What we already have that matters src/lib/write/ is most of the submission client: flat-path project files, rootFile, text/binary split (Mongo + S3), Tectonic-in-E2B compile with parsed Problem[] diagnostics, a PDF + page-one thumbnail, arXiv import (arxiv.ts, tar.ts), and templates. A submission is a frozen snapshot of a Project plus a metadata record. That is a small step from where the code is. 19.2 Phased plan Phase 1 — "ScholarXIV Preprints" (archetype A). Submit from /write in one click: freeze the project (immutable file snapshot + compiled PDF), collect the metadata form, pick a license, agree to terms, land in a moderation queue. Moderator console with accept / reclassify / return-for-fixes / decline + reason. Public landing page per preprint, versioned (v1, v2…), DOI at posting. Everything here is directly modelled on arXiv + bioRxiv, both of which are documented above field-for-field. Phase 2 — Review layer (archetype C). Invite reviewers, public reports, and an assessment rubric copying eLife's two-axis controlled vocabulary (significance × strength of evidence). This gives us a differentiated product without ever having to say "reject" — and without needing an editorial board on day one. Phase 3 — Full journal (archetype B). Editorial roles, review rounds, decision letters, point-by-point response UI, copyediting/production, issues, JATS output, DOAJ application. Phase 4 — Interop. The highest-leverage feature in this entire dossier is bioRxiv's B2J: push files + metadata from us into an external journal (and pull from arXiv/bioRxiv into us) so authors never re-key. We already have arXiv import; the reverse direction is the moat. 19.3 Decisions — SETTLED (2026-07-26) | # | Decision | Answer | |---|---|---| | 1 | Archetype | A — preprint server, arXiv-style. No review process. Every submission is listed automatically; no human moderation gate for now. | | 2 | DOIs | Open. See scholar-profiles-and-indexing-research.md §5 — DataCite (what arXiv uses, prefix 10.48550`) is the cheap path for preprints. | | 3 | Permanence | Open. Follows from (2). | | 4 | Scope | All disciplines. | | 5 | Money | Free. | | 6 | Input format | LaTeX source required. PDF/DOCX policy analysed in scholar-profiles-and-indexing-research.md §1. | Consequence of (1): with no human moderation, the automated screening layer in §16 stops being a nice-to-have. See the de-indexing risk in the companion doc, §2.6. Sources arXiv: submission process · metadata prep · licenses · sizes · endorsement · moderation · withdrawals — Nature: initial submission · formatting guide · editorial criteria and processes · final submission · forms and declarations · peer review policy · open access — bioRxiv submission guide · bioRxiv FAQ · medRxiv submission guide — PLOS ONE submission guidelines · PLOS ONE criteria for publication — eLife peer review model · eLife assessments — F1000Research how to publish — ScholarOne author guide (T&F) · Editorial Manager statuses (Wolters Kluwer) · OJS editorial workflow — ICMJE authorship · CRediT · COPE flowcharts · COPE retraction guidelines — Registered Reports (COS) — Crossref XML deposit · Crossref metadata segments · JATS tag library · DOAJ guide to applying --- ## Client Configuration URL: https://scholarxiv.com/developers/docs/mcp/clients Copy-paste MCP config for opencode, Codex, Claude, Cursor, VS Code, and custom clients. Client Configuration Add the ScholarXIV MCP server to your client with these configs. Replace sxvyourapikeyhere with your actual API key from the Developer Dashboard. Add to opencode.json in your project root: Add to ~/.codex/config.toml (global) or .codex/config.toml (project): Set the environment variable: Or add via CLI: Claude Desktop only supports stdio transport, so we bridge with mcp-remote. macOS: ~/Library/Application Support/Claude/claudedesktopconfig.json Windows: %APPDATA%\Claude\claudedesktopconfig.json Restart Claude Desktop after editing. Add to your project's .cursor/mcp.json or global settings: Add to .vscode/mcp.json in your workspace: Custom Client (TypeScript) Using @modelcontextprotocol/sdk: Direct HTTP (curl) Test the endpoint directly: Troubleshooting | Problem | Solution | |---------|----------| | Tools not appearing | Restart the client after config changes | | "Invalid API key" | Verify key starts with sxv_ and isn't expired | | "Not valid MCP server configurations" (Claude Desktop) | Claude Desktop needs stdio — use the mcp-remote config shown in the Claude Desktop tab | | Connection refused | Check the URL is https://www.scholarxiv.com/api/mcp | | Config not loading | Validate JSON/TOML (no trailing commas, correct escaping) | | Rate limited | Wait for hourly window reset or upgrade plan | --- ## How to Connect URL: https://scholarxiv.com/developers/docs/mcp/connect Endpoint URL, authentication, transport protocol, and discovery for the ScholarXIV MCP server. How to Connect The ScholarXIV MCP server is a remote endpoint using the Streamable HTTP transport. Endpoint This is the single endpoint for all MCP operations. Your client sends JSON-RPC requests to this URL. Authentication Every request requires a valid API key in the Authorization header: Alternatively, you can use the x-api-key header: Keys always start with sxv_. Create one at the Developer Dashboard. Transport | Property | Value | | ---------------- | ---------------------------------------- | | Type | Streamable HTTP | | Protocol Version | 2025-06-15 | | Session State | Stateless (no persistent sessions) | | Response Format | JSON (when enableJsonResponse is used) | The server is stateless — each request is independent. There is no session persistence between tool calls. This makes it compatible with serverless deployments. Discovery Clients that support .well-known auto-discovery can probe these endpoints: Both return a server card with: CORS The MCP endpoint and discovery endpoints include CORS headers for browser-based clients: Rate Limiting MCP calls share the same rate limit as the REST API. Your plan's hourly limit applies to both: | Plan | Rate Limit | | ---- | ------------------- | | Free | 1,200 requests/hour | | Plus | 2,400 requests/hour | | Pro | 3,600 requests/hour | When rate limited, you'll receive a 429 status with a Retry-After header. Error Responses | Status | Meaning | | ------ | -------------------------------------------- | | 401 | Invalid or missing API key | | 429 | Rate limit exceeded | | 405 | GET or DELETE not supported (stateless mode) | Next Steps - Client Configuration — config for every major client - Tool Catalog — all 36 tools --- ## Usage Examples URL: https://scholarxiv.com/developers/docs/mcp/examples Multi-step research workflows showing how ScholarXIV MCP tools compose together. Usage Examples Real-world workflows showing how MCP tools compose together. Workflow 1: Discover and Read Papers Find papers on a topic, read details, and bookmark the best ones. What the AI agent does: Searches, evaluates abstracts, reads full details, and saves interesting papers for later. Workflow 2: Build a Collection Create a curated collection and populate it with papers. What the AI agent does: Creates a themed collection, populates it with relevant papers, makes it public, and generates a share link. Workflow 3: Research with AI Use the AI research assistant for deep analysis. What the AI agent does: Uses the AI research assistant for deep analysis, then saves the most relevant papers. Workflow 4: Collaborate on Collections Share a collection with collaborators. What the AI agent does: Creates a shared workspace, adds papers, and generates an editor link for collaborators. Workflow 5: Paper Discussion Read comments on a paper and join the discussion. What the AI agent does: Reads the paper, checks community discussion, and contributes a thoughtful comment. Workflow 6: Explore What Others Are Reading Discover popular collections and join interesting ones. What the AI agent does: Explores the community, finds interesting collections, and joins them for ongoing reading. Tips for Effective MCP Usage - Be specific in search queries — "transformer attention mechanisms 2024" beats "AI papers" - Use collections to organize research by topic or project - Bookmark incrementally — bookmark papers as you find them, not just at the end - Use research_chat for synthesis questions, not simple lookups - Try deep research (isdeepresearch: true) for complex multi-step analysis --- ## MCP URL: https://scholarxiv.com/developers/docs/mcp Connect AI agents and developer tools to ScholarXIV through the Model Context Protocol. 36 tools for paper search, collections, bookmarks, comments, and research. ScholarXIV MCP The ScholarXIV MCP server lets AI agents and developer tools interact with ScholarXIV through the Model Context Protocol. It provides 36 tools covering paper search, collections, bookmarks, comments, AI research chat, and more. Tool availability is tailored to the API key's plan. MCP vs Papers API | Feature | Papers API | MCP | | ------------ | ---------------------------------------- | ------------------------------------------------------------------ | | Protocol | REST (HTTP) | Model Context Protocol (Streamable HTTP) | | Endpoint | GET/POST /api/v1/papers/search | POST /api/mcp | | Tools | 2 search routes (standard and federated) | 36 tools (search, collections, bookmarks, comments, chat, account) | | Auth | Same sxv API key | Same sxv API key | | Best for | Direct integration into apps | AI agents, IDE assistants, research workflows | Use the Papers API if you need programmatic paper search in a traditional app. Use MCP if you want an AI agent to autonomously search papers, build collections, bookmark findings, and discuss research. What You Can Do - Search — find papers by title, author, abstract, category, or keyword - Read — get full paper metadata and abstracts - Organize — create collections, add/remove papers, manage members - Interact — bookmark, like, comment on papers - Research — ask AI research questions with paper context - Discover — browse public collections from other researchers Prerequisites 1. A ScholarXIV account 2. An API key (create one at /developers/dashboard) 3. An MCP-compatible client (Claude Desktop, Cursor, VS Code, etc.) Quick Example Add this to your MCP client config: Then ask your AI agent: "Search for recent papers on protein folding and bookmark the top 3." Next Steps - Quick Start — go from zero to first tool call in 5 minutes - How to Connect — endpoint, auth, and transport details - Client Configuration — config examples for every major client - Tool Catalog — all 36 tools with parameters and examples - Usage Examples — multi-step research workflows [!NOTE] MCP calls share the same rate limit as the REST API. Your plan's hourly limit applies to both. --- ## Quick Start URL: https://scholarxiv.com/developers/docs/mcp/quickstart Go from zero to your first ScholarXIV MCP tool call in 5 minutes. Quick Start Get connected to the ScholarXIV MCP server in 5 minutes. Step 1: Get an API Key 1. Log in at scholarxiv.com 2. Go to the Developer Dashboard 3. Click Create API Key 4. Name it, choose an expiration, and click Create 5. Copy the key immediately — it's shown only once Your key starts with sxv (e.g. sxvabc123...). Step 2: Pick Your Client The ScholarXIV MCP server works with any MCP-compatible client. Choose one: | Client | Type | Platform | | ----------------- | ----------- | --------------------- | | opencode | CLI | macOS, Linux | | Codex | CLI | macOS, Linux | | Claude Desktop | Desktop app | macOS, Windows | | Claude Code | CLI | macOS, Linux | | Cursor | IDE | macOS, Windows, Linux | | VS Code / Copilot | Extension | macOS, Windows, Linux | Step 3: Add the Config Claude Desktop Claude Desktop only supports stdio transport, so we bridge with mcp-remote. Edit ~/Library/Application Support/Claude/claudedesktopconfig.json (macOS) or %APPDATA%\Claude\claudedesktopconfig.json (Windows): Cursor Add to your settings or .cursor/mcp.json: Claude Code opencode Add to opencode.json in your project root: See the Client Configuration page for all clients. Step 4: Test It Restart your MCP client, then ask your AI agent: Search for recent papers on large language models and show me the top 3 The agent should call the search_papers tool and return paper titles, authors, and abstracts. Step 5: Try More Once search works, try these: - "Bookmark the first paper" → uses bookmark_paper - "Create a collection called 'LLM Research'" → uses create_collection - "Add these papers to my collection" → uses addpaperto_collection - "What papers have I bookmarked?" → uses getbookmarkedpapers See the Tool Catalog for all 36 tools. Troubleshooting | Problem | Solution | | ------------------------------------------------------ | ------------------------------------------------------------------------ | | Client doesn't show MCP tools | Restart the client after adding config | | "Invalid API key" error | Check the key starts with sxv_ and hasn't expired | | "Not valid MCP server configurations" (Claude Desktop) | Use the mcp-remote config — Claude Desktop requires stdio transport | | "Rate limit exceeded" | Wait for the hourly window to reset, or upgrade your plan | | Connection timeout | Check your network; the endpoint is https://www.scholarxiv.com/api/mcp | | Tools not appearing | Ensure the config JSON is valid (no trailing commas) | Next Steps - How to Connect — endpoint and transport details - Client Configuration — all client configs - Tool Catalog — all 36 tools --- ## Tool Catalog URL: https://scholarxiv.com/developers/docs/mcp/tools Complete reference for all 47 ScholarXIV MCP tools with parameters and examples. Tool Catalog The ScholarXIV MCP server exposes 47 tools across 7 categories. Keys without federated-search or health access see fewer tools. Overview | Category | Tools | Description | | ----------------------------------------- | ----- | ----------------------------------------------------------- | | Search & Discovery | 5 | Find papers and collections | | Paper Operations | 9 | Read, bookmark, like, and comment on papers | | Collections | 10 | Create, update, and manage paper collections | | Collection Members | 5 | Manage who can access collections | | Chats | 6 | AI research chat, background runs, and conversation history | | Account | 3 | Subscription info, plans, and reading digests | | Health | 9 | Health chat, medication references, and trackers (Go plan+) | Search & Discovery search_papers Search the ScholarXIV database of 3M+ academic papers. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------------------------------------------------------------------ | | query | string | Yes | Search query text | | search_filter | enum | No | Field to search: all, ti, au, abs, cat, id, co, jr, rn | | limit | number | No | Max results (1-50, default 10) | | page | number | No | Page number, 0-indexed (default 0) | | sort_by | enum | No | relevance, lastUpdatedDate, submittedDate (default relevance) | | sort_order | enum | No | ascending, descending (default descending) | federated_search Search multiple academic sources at once (arXiv, OpenAlex, PubMed, Europe PMC, medRxiv, bioRxiv, ChemRxiv, ClinicalTrials.gov, Semantic Scholar, Crossref, and ChinaXiv) and get a merged, deduplicated list. Requires the Go plan or above. | Parameter | Type | Required | Description | | ---------- | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | query | string | Yes | Search query text | | sources | string[] | No | Which sources to search: arxiv, openalex, pubmed, europepmc, medrxiv, biorxiv, clinicaltrials, semantic_scholar, crossref, chinarxiv, chemrxiv (default: all) | | limit | number | No | Max results per source (1-50, default 10) | | page | number | No | Page number, 0-indexed, applied per source (default 0) | | fromYear | number | No | Only include papers published in or after this year | | toYear | number | No | Only include papers published in or before this year | | sort | enum | No | relevance, date, or citations | Paging is per-source: each page returns up to limit results from every selected source, and the response footer reports per-source counts plus whether more results remain. search_collections Search public paper collections created by other researchers. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------------------- | | query | string | Yes | Search query for collection titles/descriptions | | page | number | No | Page number (default 1) | discover_collections Browse random public collections from other researchers. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------- | | page | number | No | Page number (default 1) | getrecommendedcollections Get personalized collection recommendations based on your reading profile. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------- | | page | number | No | Page number (default 1) | Paper Operations get_paper Get full metadata for a specific paper by arXiv ID or DOI. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ----------------------------------- | | paper_id | string | Yes | arXiv ID (e.g. "2301.12345") or DOI | getpaperfull_text Read a paper's full text in chunks when the abstract is insufficient. Available to paid plans. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | ----------------------------------- | | paper_id | string | Yes | arXiv ID or arXiv URL | | offset | number | No | Character offset for the next chunk | | max_chars | number | No | Characters to return (1,000–60,000) | bookmark_paper Toggle bookmark state on a paper. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ---------------------- | | paper_id | string | Yes | Paper ID (extractedID) | like_paper Toggle like state on a paper. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ---------------------- | | paper_id | string | Yes | Paper ID (extractedID) | getbookmarkedpapers Get all papers bookmarked by the authenticated user. getlikedpapers Get all papers liked by the authenticated user. getpapercomments Get community comments and discussion for a specific paper. | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ---------------------- | | paper_id | string | Yes | Paper ID (extractedID) | commentonpaper Post a comment on a paper. | Parameter | Type | Required | Description | | ----------- | ------ | -------- | -------------------------------------- | | paper_id | string | Yes | Paper ID (extractedID) | | comment | string | Yes | The comment text to post | | parent_id | string | No | Parent comment ID for threaded replies | delete_comment Delete a comment you own. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | ----------------------------- | | comment_id | string | Yes | Comment ID (MongoDB ObjectId) | | paper_id | string | Yes | Paper ID (extractedID) | Collections list_collections List all collections you are a member of. create_collection Create a new paper collection. | Parameter | Type | Required | Description | | ------------- | -------- | -------- | ---------------- | | title | string | Yes | Collection title | | description | string | No | Description | | tags | string[] | No | Tags | update_collection Update a collection's title, description, tags, or visibility. | Parameter | Type | Required | Description | | --------------- | -------- | -------- | --------------------- | | collection_id | string | Yes | Collection ID | | title | string | No | New title | | description | string | No | New description | | tags | string[] | No | New tags | | visibility | enum | No | public or private | delete_collection Delete a collection and all its papers. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | collection_id | string | Yes | Collection ID | getcollectiondetail Get full details of a collection including all papers. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | collection_id | string | Yes | Collection ID | getcollectionpapers Get all papers in a collection. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | collection_id | string | Yes | Collection ID | addpaperto_collection Add a paper to a collection. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ---------------------- | | collection_id | string | Yes | Collection ID | | paper_id | string | Yes | Paper ID (extractedID) | removepaperfrom_collection Remove a paper from a collection. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ---------------------- | | collection_id | string | Yes | Collection ID | | paper_id | string | Yes | Paper ID (extractedID) | join_collection Join a public collection as a viewer. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | collection_id | string | Yes | Collection ID | leave_collection Leave a collection you are a member of. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------- | | collection_id | string | Yes | Collection ID | Collection Members getcollectionmembers List members of a collection (owner only). | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ----------------------------- | | collection_id | string | Yes | Collection ID | | page | number | No | Page number (default 1) | | limit | number | No | Results per page (default 10) | | search | string | No | Search by name or email | updatememberrole Change a collection member's role (owner only). | Parameter | Type | Required | Description | | --------------- | ------ | -------- | --------------------- | | collection_id | string | Yes | Collection ID | | user_id | string | Yes | User ID of the member | | role | enum | Yes | editor or viewer | remove_member Remove a member from a collection (owner only). | Parameter | Type | Required | Description | | --------------- | ------ | -------- | ------------------------------- | | collection_id | string | Yes | Collection ID | | user_id | string | Yes | User ID of the member to remove | generatesharetoken Generate a share link token for a collection. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | -------------------- | | collection_id | string | Yes | Collection ID | | role | enum | Yes | viewer or editor | revokesharetoken Revoke a viewer or editor share link for a collection. | Parameter | Type | Required | Description | | --------------- | ------ | -------- | -------------------- | | collection_id | string | Yes | Collection ID | | role | enum | Yes | viewer or editor | Chats list_chats List all chat conversations. getchathistory Retrieve all messages from a specific chat. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ------------------------- | | chatid | string | Yes | Chat ID (from listchats) | delete_chat Delete a chat and its history. | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------- | | chat_id | string | Yes | Chat ID | research_chat Ask the ScholarXIV AI a research question. This tool runs the same engine, harness, and plan-gated tools as the website and Agent API. It returns a completed text answer with Chat ID and Run ID footers and a structured result containing chatid, runid, text, model, usage, metrics, the full assistant message, and output when you pass response_schema. Use the HTTP API with stream: true for live token events. Many MCP clients stop waiting on a tool call after about a minute. For deep research or long questions, pass background: true: the tool returns a runid at once, and getagent_run returns the answer when it is ready. | Parameter | Type | Required | Description | | ------------------ | -------- | -------- | --------------------------------------------------------------------------- | | question | string | Yes | Your research question | | chat_id | string | No | Existing chat ID to continue a conversation | | selected_papers | string | No | Paper context the AI can reference | | selected_texts | string | No | Highlighted text passages to reference | | isdeepresearch | boolean | No | Enable deep research mode (default false) | | model | string | No | AI model or auto preset; defaults to the account's preferred model | | attachment_ids | string[] | No | Up to five uploaded attachment IDs | | background | boolean | No | Return a runid immediately; read the answer with getagent_run | | max_steps | integer | No | 1–10; lowers the tool-step budget for this turn | | allowed_tools | string[] | No | Only these agent tools may run | | disallowed_tools | string[] | No | These agent tools may not run | | response_schema | object | No | JSON Schema (root type: "object"); the answer also comes back as output | | metadata | object | No | String tags stored on the run and its usage record | getagentrun Read a researchchat or healthchat run started with background: true. Returns the answer once the run has completed, otherwise its status. The structured result is the run object. | Parameter | Type | Required | Description | | -------------- | ------- | -------- | ----------------------------------------------------------- | | runid | string | Yes | The runid returned when the run started | | wait_seconds | integer | No | 0–25; wait this long for the run to finish before returning | cancelagentrun Stop a running researchchat or healthchat run. What the agent wrote before it stopped stays in the chat. | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------- | | run_id | string | Yes | The run to stop | Account getsubscriptioninfo Get your current subscription plan, rate limits, and API usage. get_plans List all available subscription plans with pricing. get_pulse View AI-generated digests of your bookmarked and liked papers with insights. Health Health tools are research-grounded health features: the health assistant chat, FDA/RxNorm medication references, the health profile, and symptom trackers. All Health tools require the Go plan or above. health_chat Ask the ScholarXIV Health assistant a health question. This tool runs the same engine, health profile, and tools as the website and the Health Chat API. It returns a completed answer, or with background: true a runid to read with getagent_run. Use the HTTP API with stream: true when you need token streaming or dictation. | Parameter | Type | Required | Description | | ------------------ | -------- | -------- | ----------------------------------------------------------------------------------------- | | question | string | Yes | Your health question | | chat_id | string | No | Existing health chat ID to continue a conversation | | model | string | No | AI model to use (default: the plan's health model — large context, reads images and PDFs) | | attachment_ids | string[] | No | Up to five uploaded attachment IDs, such as lab reports or images | | background | boolean | No | Return a runid immediately; read the answer with getagent_run | | max_steps | integer | No | Lowers the tool-step budget for this turn | | allowed_tools | string[] | No | Only these health tools may run | | disallowed_tools | string[] | No | These health tools may not run | | response_schema | object | No | JSON Schema; the answer also comes back as output | | metadata | object | No | String tags stored on the run and its usage record | getmedicationreference Fetch the complete reference for one brand or generic medicine: RxNorm concept identity, active ingredients, properties and NDCs, plus openFDA product metadata and every available FDA label section. Product information only — not a diagnosis, dose recommendation, or interaction severity score. | Parameter | Type | Required | Description | | --------- | ------ | -------- | -------------------------------------------- | | name | string | Yes | One medication name, either brand or generic | gethealthprofile Get the user's health profile (birth date, sex, conditions, medications, allergies, lifestyle, goals) and whether consent for health data processing has been given. savehealthprofile Save or update the health profile. consent_given must be true — health data is a special category under GDPR Art. 9, and the profile is only stored after explicit consent. Medication names are normalized against RxNorm on save. | Parameter | Type | Required | Description | | ------------------ | -------- | -------- | ------------------------------------------------------- | | consent_given | boolean | Yes | Must be true to save | | birth_date | string | No | YYYY-MM-DD; age is derived from it | | age | number | No | Years (0-120); used only when no birth_date | | sex | string | No | Free text: female, male, intersex, or self-described | | height_cm | number | No | Height in centimeters | | weight_kg | number | No | Weight in kilograms | | unit_system | enum | No | metric or imperial (display preference) | | blood_type | enum | No | A+, A-, B+, B-, AB+, AB-, O+, O- | | pregnancystatus | enum | No | notapplicable, pregnant, breastfeeding, trying | | conditions | string[] | No | Ongoing diagnoses or conditions | | medications | string[] | No | Current medications, brand or generic | | supplements | string[] | No | Vitamins, supplements, herbal remedies | | allergies | string[] | No | Drug, food, or other allergies | | surgeries | string[] | No | Past surgeries and procedures | | family_history | string[] | No | Conditions that run in the family | | smoking_status | enum | No | never, former, occasional, daily | | alcohol_use | enum | No | none, occasional, weekly, daily | | activity_level | enum | No | sedentary, light, moderate, active, athlete | | sleep_hours | number | No | Typical hours per night (0-24) | | diet | string | No | Dietary pattern and restrictions | | goals | string[] | No | What the user is working toward | | notes | string | No | Anything else the assistant should know | deletehealthprofile Withdraw consent and delete the health profile and all health trackers. Everything is deleted outright — nothing is soft-deleted or retained. | Parameter | Type | Required | Description | | --------- | ------- | -------- | -------------------------------- | | confirm | boolean | Yes | Must be true; there is no undo | listhealthtrackers List active health trackers (health logs) with all recorded entries — severity, symptoms, temperature, and activity impact over time. Returns consentGiven: false and no trackers when no health profile with consent exists. createhealthtracker Create a new health tracker (health log) — an acute illness, a pregnancy, or a custom log. Requires an existing health profile with consent (savehealthprofile). | Parameter | Type | Required | Description | | --------- | ------ | -------- | ----------------------------------------- | | title | string | Yes | Name for the log, e.g. "Flu-like illness" | | kind | enum | Yes | acute, pregnancy, or custom | addhealthtracker_entry Record one entry in a health tracker, appended with the current timestamp. | Parameter | Type | Required | Description | | ------------------ | -------- | -------- | ----------------------------------------------- | | trackerid | string | Yes | Health tracker ID (from listhealth_trackers) | | severity | number | No | 0 (none) to 10 (worst) | | symptoms | string[] | No | Symptoms experienced, e.g. ["fever", "cough"] | | temperature | number | No | Reading in the temperature_unit unit | | temperature_unit | enum | No | celsius or fahrenheit (default celsius) | | activity_impact | enum | No | none, limited, unable (default none) | | notes | string | No | Optional notes | deletehealthtracker Delete a health tracker and all its entries. Requires the health tracker to belong to the user. | Parameter | Type | Required | Description | | ------------ | ------ | -------- | --------------------------- | | tracker_id | string | Yes | Health tracker ID to delete | --- ## Developer Platform URL: https://scholarxiv.com/developers/docs Papers API access powered by your ScholarXIV subscription. Create keys, test in the dashboard, and search millions of papers. Developer Platform Access the Papers API using the same subscription that powers your account. Your plan (Free, Plus, or Pro) directly controls API key quotas and rate limits. Higher plans unlock more keys and significantly higher hourly throughput. Subscriptions & Limits Your plan (Free, Plus, or Pro) controls API key quotas, hourly rate limits, and maximum results per request. Limits are evaluated live from your current subscription on every call. See the dedicated Rate Limits & Quotas page for the full table, rolling window details, and what happens on plan changes or downgrades. Products | Product | Status | Primary Use | |----------------|-------------|-------------| | Papers API | Available | Search and retrieve structured paper metadata | | Agent API | Available | Run the research agent through our harness — tools, files, dictation, streaming, and saved conversations | | Health API | Available | Health assistant, file uploads, medications, conditions, symptoms, and private health logs | | ScholarXIV MCP | Available | Agent and tool integrations | | Abstract Model | Coming soon | Academic writing assistance | Quick Start 1. Log in to ScholarXIV. 2. (Recommended) Subscribe to Plus or Pro via Pricing. 3. Go to the Developer Dashboard. 4. Create an API key (it starts with sxv_ — copy it immediately, it is shown only once). 5. Call the API (see full examples on the Code Examples page). Base URL: https://scholarxiv.com Minimal cURL example: Next Steps - Using the Dashboard — manage keys, test live requests, monitor usage. - Papers API Overview — endpoints and response format. - Authentication — key format and headers. - Search — simple vs advanced queries with filters. - Rate Limits & Quotas — entitlements, plan changes, and 429 behavior. - Code Examples — all ready-to-use snippets and patterns. - Errors — status codes and troubleshooting. [!NOTE] All examples target production at https://scholarxiv.com. Replace the host when testing locally. --- ## Authentication URL: https://scholarxiv.com/developers/docs/papers-api/authentication Use sxv_ API keys with Bearer or x-api-key header. Keys are validated against your live subscription. Authentication All Papers API requests require a ScholarXIV API key. Headers Keys always start with sxv_. How Keys + Subscriptions Work Together 1. The key is validated using secure hashing (via better-auth). 2. On every single request we look up your current active subscription (the same plan that powers the web app). 3. We apply the entitlements for that plan: - Maximum number of keys: Free 2, Plus 5, Pro 20 - Hourly rate limit: Free 1,200/hour, Plus 2,400/hour, Pro 3,600/hour (shared across all your keys) - Maximum results per request (6,000 on every plan) Limits are always evaluated live at request time. See the Rate Limits & Quotas page for the full entitlements table, rolling window details, downgrade behavior, and 429 handling. [!TIP] Your dashboard always shows the live numbers from your current subscription. Creating & Managing Keys Create keys only from the Developer Dashboard. - Name them clearly. - Set a realistic expiration (or "Never" for long-running services). - The raw key is shown once. Store it in an environment variable immediately: Best practices - One key per service or environment. - Rotate keys periodically (create new → update service → delete old). - Never log the full key. Log only the prefix (sxv_abc...) when needed for debugging. - Never embed keys in client-side JavaScript, mobile apps, or public repos. Errors During Authentication | Status | Message | Likely Cause | | ------ | -------------------------------------------------- | -------------------------------------------------------------- | | 401 | API Key is required | Missing header | | 401 | Invalid API key format. Should start with 'sxv_' | Wrong token type | | 401 | Invalid API key | Revoked, expired, or never existed | | 429 | Rate limit exceeded | See Rate Limits & Quotas | Security Checklist - Load keys only from server environment variables. - Use different keys for dev/staging/prod. - Rotate keys on any suspected exposure. - Prefer short-lived keys for anything that can be rotated automatically. - Build a thin server-side proxy/wrapper so browser or mobile clients never see the real key. [!TIP] A small server wrapper also lets you add caching, logging, and per-user quotas on top of the Papers API without exposing secrets. --- ## Errors URL: https://scholarxiv.com/developers/docs/papers-api/errors Complete error reference, status codes, and defensive client patterns for the Papers API. Errors All errors are returned as JSON: Status Codes | Status | Message | How to Fix | | ------ | -------------------------------------------------- | --------------------------------------------------------------------- | | 400 | Missing search query | Provide a non-empty q for simple GET search | | 400 | Missing advanced search filters | searchFilterString must contain at least one non-empty string value | | 401 | API Key is required | Send Authorization: Bearer sxv... or x-api-key: sxv... | | 401 | Invalid API key format. Should start with 'sxv_' | Use a real ScholarXIV key | | 401 | Invalid API key | Key was revoked, expired, or does not exist | | 429 | Rate limit exceeded | You hit the shared hourly limit for your plan. Respect Retry-After | [!WARNING] Always send valid JSON on POST requests. Malformed bodies return generic parse errors. Handling Rate Limits (429) Rate limits are per-user and shared. When you receive 429: - Read the Retry-After header (seconds). - Back off and retry after that time. - Consider spreading work or upgrading your plan for sustained high volume. See the Code Examples page for a complete retry helper and client handling patterns. Defensive Client Pattern Troubleshooting Checklist 1. Key starts with sxv_ and is passed in the correct header. 2. For simple search: q is present and not empty. 3. For advanced search: at least one value inside searchFilterString is non-empty. 4. limit is at least 1 and no more than 6,000. 5. On 429: check your current plan and usage in the dashboard. Wait or upgrade. 6. Pagination: always use the nextPage value from the previous response. [!TIP] Add request IDs or correlation IDs in your own wrapper logs. Never log the full API key. For failed authentication attempts you can safely log the key prefix (e.g. sxv_abc123...) — this is exactly what the Usage page shows for debugging. Common beginner mistakes - Forgetting the Bearer prefix. - Sending an empty searchFilterString object on POST. - Assuming the next page exists without checking hasMore / nextPage. - Treating 429 as a permanent failure instead of a temporary quota signal. Example: Logging safe key prefix on error Still Stuck? - Use the Playground in the dashboard — it shows the exact request and error the server received. - Check the live Usage page for current consumption against your plan. - Review the Paper fields in the overview. - See Rate Limits & Quotas for plan changes and entitlements. - See Code Examples for all code samples and the production checklist. - Review the Dashboard guide for key and limit management. --- ## Code Examples URL: https://scholarxiv.com/developers/docs/papers-api/examples Ready-to-copy examples for quickstarts, search, pagination, error handling, and production patterns. Code Examples All practical code samples for the Papers API in one place. Quick Start Simple Search (GET) Advanced Search (POST) Pagination Loop Always use the nextPage value returned by the API. Rate Limit Retry (429) Client-side 429 handling example: Defensive Client Wrapper Safe Logging (Auth Failures) Never log full keys. Prefixes are safe and match what the dashboard shows. Production Checklist - Store keys only in environment variables - Use separate keys per environment / service - Drive all pagination from the nextPage value (never guess) - Handle 429s with Retry-After + backoff (examples above) - Monitor the Usage dashboard before large jobs or agent runs - Put a thin server-side proxy in front of the API (hides secrets + allows caching) - Rotate keys regularly (create → deploy → delete old) - Add your own correlation IDs so you can trace calls in the dashboard logs See the Limits page for quota and plan change details. Related - Search — filter reference and parameter details - Errors — full status code reference - Limits — entitlements, rolling windows, and downgrade behavior --- ## FAQ URL: https://scholarxiv.com/developers/docs/papers-api/faq Common questions about authentication, search, rate limits, plan changes, pagination, and production best practices for the Papers API. FAQ What is the Papers API and what can I do with it? The Papers API lets you search the ScholarXIV paper index programmatically. It is a read-only search API that returns structured metadata — titles, authors, abstracts, categories, dates, and PDF links. You can use it to build research tools, power academic search features in your own applications, feed paper data into AI agents, or automate literature review workflows. It does not manage collections, likes, bookmarks, or any user-specific state — it is purely a paper search and retrieval API. See the Papers API Overview for endpoints and response format. Do I need a paid subscription to use the API? No. The Free plan gives you 2 API keys, 1,200 requests per hour, and up to 6,000 results per request - enough for testing and small personal tools. Go adds paid research features with 3 keys and 1,800 requests per hour; Plus provides 5 keys and 2,400 requests per hour; Pro provides 20 keys and 3,600 requests per hour. Every plan has the same 6,000-result request cap. Limits are evaluated live from your current subscription on every request. See Rate Limits & Quotas for the full entitlements table. [!TIP] You can test the API with the Free plan and upgrade at any time — changes apply within seconds. How do I get an API key? 1. Log in to ScholarXIV. 2. Go to the Developer Dashboard. 3. Click Create API Key, name it, and optionally set an expiration. 4. Copy the key immediately — it starts with sxv_ and is shown only once. Send the key in every request using either header: [!WARNING] Store the key in an environment variable immediately. Never embed it in client-side code, public repos, or logs. See Authentication for the full key management guide and security checklist. What is the difference between GET and POST search? GET (/api/v1/papers/search?q=...) is a simple title-only search — fast and minimal. Use it for autocomplete, quick lookups, or single-input search bars. POST (/api/v1/papers/search) is advanced search. You send a JSON body with any combination of filters — title, author, abstract, category, arXiv ID, and more. Filters are ANDed together, giving you precise control over results. See Search for the full filter reference and recipes. How does pagination work? How do I get all results? Pagination is zero-based (page=0 is the first page). Every response includes a pagination object: Always drive your loop from nextPage — never hard-code page numbers. When nextPage is null or hasMore is false, you have reached the end. [!IMPORTANT] Guessing page numbers or assuming sequential pages will miss or duplicate results. Always use the nextPage value the API returns. See Code Examples for complete pagination code. What happens when I hit the rate limit? You receive a 429 response with a Retry-After header indicating how many seconds to wait. The rate limit is a rolling 60-minute window shared across all your API keys. Implement backoff in your client: If you consistently hit the limit, check your usage on the Usage dashboard and consider upgrading your plan for higher throughput. See Rate Limits & Quotas for plan-specific limits and the Code Examples page for a complete retry helper. What happens to my API keys if I downgrade or cancel my plan? When you downgrade — for example from Pro (20 keys) to Free (2 keys) — the system automatically disables the oldest enabled keys until you are within the new plan's key limit. The 2 newest keys remain active. Disabled keys stay visible in your dashboard but return 401 on any request. You can re-enable them later if you upgrade again. Rate limits and max results also drop to the new plan's values on your next API call. [!TIP] Before downgrading, decide which services are critical and plan which keys to keep. Keys are inexpensive and easy to rotate. See Rate Limits & Quotas for the full scenario walkthrough. What do the common error codes mean and how do I fix them? | Status | Message | Likely Cause | | ------ | -------------------------------------------------- | ---------------------------------------------------- | | 400 | Missing search query | GET request without q parameter | | 400 | Missing advanced search filters | POST with empty searchFilterString | | 401 | API Key is required | Missing Authorization or x-api-key header | | 401 | Invalid API key format. Should start with 'sxv_' | Wrong key format | | 401 | Invalid API key | Key was revoked, expired, or does not exist | | 429 | Rate limit exceeded | Hit your plan's hourly limit — respect Retry-After | Quick troubleshooting checklist: 1. Key starts with sxv_ and is in the correct header with the Bearer prefix. 2. For POST: searchFilterString has at least one non-empty value. 3. limit is at least 1 and no more than 6,000. 4. On 429: check your dashboard and back off. 5. Pagination: always use nextPage from the previous response. See the Errors page for the full reference and defensive client patterns. Can I search by arXiv ID or specific authors? Yes. Use the advanced search (POST) with the id or au filter: Search by arXiv ID: Search by authors (comma-separated): The id filter matches arXiv ID, extracted ID, and base arXiv ID fields. The au filter accepts comma-separated author names for broader matches. See the Search page for all available filters and more examples. What are the best practices for using the API in production? 1. Store keys securely — environment variables only, never in client code or repos. 2. Separate keys per environment — different keys for dev, staging, and production. 3. Rotate keys regularly — create a new key, deploy it, then delete the old one. 4. Drive pagination from nextPage — never hard-code page numbers. 5. Handle 429s with backoff — use the Retry-After header and exponential backoff. 6. Use a server-side proxy — a thin wrapper hides your key and lets you add caching, logging, and per-user quotas. 7. Log safely — never log full keys. Log only the prefix (e.g. sxv_abc...) which matches what the dashboard shows. 8. Monitor usage — check the Usage dashboard before large jobs or agent runs. [!TIP] The Code Examples page has ready-to-copy production patterns including a defensive client wrapper, retry logic, and safe logging. Still stuck? Use the Playground in the Developer Dashboard to test requests and see exactly what the server receives. --- ## Federated Search URL: https://scholarxiv.com/developers/docs/papers-api/federated-search Search arXiv, OpenAlex, PubMed, Semantic Scholar, Crossref, and ChinaXiv at once. Merged, deduplicated results with per-source pagination. Federated Search Query eleven academic sources at once and get a single merged, deduplicated list: - arxiv — the ScholarXIV arXiv corpus - openalex — OpenAlex - pubmed — PubMed / NCBI - europepmc — Europe PMC - medrxiv — medRxiv - biorxiv — bioRxiv - clinicaltrials — ClinicalTrials.gov - semantic_scholar — Semantic Scholar - crossref — Crossref - chinarxiv — ChinaXiv - chemrxiv — ChemRxiv Sources are fetched in parallel and duplicates (same DOI, or same normalized title) are collapsed into one paper that records every source it was found in. [!IMPORTANT] Federated search requires the Go plan or above. Requests from free-plan keys return 403. See the standard single-source Search for arXiv-only access on any plan. Endpoint Both methods take the same parameters and return the same shape. Parameters | Param | Required | Default | Description | | --------- | -------- | ---------- | ---------------------------------------------------------------------------------- | | q | Yes | — | Search query (GET query param, or q/query in the POST body) | | page | No | 0 | Zero-based page index (applied per source) | | limit | No | 20 | Results per source, 1–50 | | sources | No | all eleven | Restrict to specific sources. GET: comma list (arxiv,pubmed). POST: string array | POST body example: Per-source pagination Paging is per source, not global. A single page requests up to limit results from each selected source, so a page can return up to limit × (number of sources) papers before deduplication. - page and limit are applied independently to every source (offset = page × limit). - Each source reports its own hasMore in bySource. - The top-level pagination.hasMore is true when any source still has more results. Because sources are independent, some may run out of results before others on deep pages — that is expected and is surfaced honestly per source in bySource. Response Each paper carries a source (and a sources array when found in more than one), plus title, authors, summary, year, doi, pdfLink, url, and citationCount where available. Example response (truncated): Pagination loop Drive the loop off pagination.nextPage — never guess page numbers. Empty results A successful search with no matches returns HTTP 200 with an empty data array — normal, not an error. Notes - limit is capped at 50 per source to stay polite to upstream providers, even though your plan's overall result window is larger (see Rate Limits & Quotas). - A single flaky source never fails the whole request — it simply reports { count: 0, hasMore: false } in bySource. - Prefer the single-source Search endpoint when you only need arXiv; it is faster, available on every plan, and supports fielded/advanced filters. --- ## Rate Limits & Quotas URL: https://scholarxiv.com/developers/docs/papers-api/limits Your subscription controls API key quotas, hourly rate limits, and result sizes. Limits are evaluated live on every request. Rate Limits & Quotas All Papers API usage is governed by your active ScholarXIV subscription (Free, Plus, or Pro). Limits are checked live against your current plan on every request. Entitlements by Plan | Plan | Max Keys | Rate Limit (requests/hour) | Max Results per Request | Recommended For | | ---- | -------- | -------------------------- | ----------------------- | ------------------------------------- | | Free | 2 | 1,200 | 6,000 | Testing and small personal tools | | Go | 3 | 1,800 | 6,000 | Paid research workflows | | Plus | 5 | 2,400 | 6,000 | Active development & moderate traffic | | Pro | 20 | 3,600 | 6,000 | Production apps and high volume | [!TIP] Upgrade via the main Pricing page. Changes apply within seconds. How Limits Work - Live resolution: On every API call, the server looks up your current active subscription and applies its entitlements. There is no caching of old limits. - Shared per user: The hourly rate limit is across all your API keys. Multiple services or teammates on the same account compete for the same quota. - Rolling window: The 60-minute window rolls continuously. When you hit the limit you receive a 429 with a Retry-After header. - Max results: limit / maxResults is capped at 6,000 for every plan. Key fact: A key created while on Pro will automatically run under Free limits if you later downgrade or cancel. Plan Changes & Quota Behavior Upgrades are immediate. Your next request uses the new higher limits. Downgrades and cancellations: - Rate limit and max results drop on the next call. - The system automatically disables the oldest enabled keys until you are back within the new plan's maxKeys. - Disabled keys remain in your dashboard but will return 401 until re-enabled (after upgrading). - You can manually manage which keys stay active within the new lower quota. Example scenario You are on Pro (20 keys allowed, 3,600 req/h) with 15 active keys. You downgrade to Free (2 keys, 1,200 req/h): - All future requests are limited to 1,200 per rolling hour. - The 13 oldest keys are automatically disabled. - The 2 newest keys remain enabled. - The disabled keys stay visible in the dashboard. You can re-enable them later if you upgrade. This same enforcement runs on key creation and enabling a key. Best practice: When planning a downgrade, decide in advance which services are critical and keep only those keys active. Treat keys as inexpensive and easy to rotate. Monitoring & 429s - Watch the Usage page in the Developer Dashboard for real-time consumption and per-key breakdown. - On rate limit: respect the Retry-After header and implement backoff in your client. - The dashboard request logs show both successful calls and auth failures (with key prefix for the latter). See the Examples page for ready-to-use retry and backoff code. Related - Authentication — how keys are validated against your live subscription. - Dashboard Usage — charts and request history. - Errors — full error reference including 429 handling. --- ## Papers API URL: https://scholarxiv.com/developers/docs/papers-api Search over millions of research papers with simple or advanced queries. Returns clean metadata for apps and agents. Papers API The Papers API lets you search the ScholarXIV paper index programmatically. It is a read-only search API. It returns structured metadata — titles, authors, abstracts, categories, dates, and PDF links. It does not manage collections, likes, or bookmarks. Endpoints | Method | Path | Use Case | | ------ | --------------------------------- | ---------------------------------- | | GET | /api/v1/papers/search | Simple title search | | POST | /api/v1/papers/search | Advanced multi-field search | | GET | /api/v1/papers/federated/search | Multi-source search (Go+) | | POST | /api/v1/papers/federated/search | Advanced multi-source search (Go+) | Base URL: https://scholarxiv.com Every request must include a valid API key (see Authentication). Limits By Plan | Plan | Max API Keys | Requests per Hour | Max Results per Request | | ---- | ------------ | ----------------- | ----------------------- | | Free | 2 | 1,200 | 6,000 | | Go | 3 | 1,800 | 6,000 | | Plus | 5 | 2,400 | 6,000 | | Pro | 20 | 3,600 | 6,000 | The hourly request limit is shared across all of your API keys and uses a rolling 60-minute window. 429 Rate Limit Handling If the Papers API returns 429 Too Many Requests, read the Retry-After header, wait that many seconds, and retry with backoff. Check the Usage dashboard to see current consumption across all keys before running another batch job. Response Format Successful responses always contain data and pagination. Paper Object Here is the shape of items returned in data: | Field | Type | Always Present? | Description | | ----------------- | -------- | --------------- | -------------------------------------- | | id | string | Yes | Full arXiv identifier URL | | extractedID | string | Yes | Clean ID (e.g. 2401.01234v1) | | title | string | Yes | Paper title | | summary | string | Yes | Abstract / summary text | | authors | string[] | Yes | List of author names | | published | ISO date | Yes | Original submission / publication date | | updated | ISO date | Often | Last record update time | | primaryCategory | string | Yes | Primary arXiv category (e.g. cs.CL) | | category | string[] | Yes | All associated categories | | pdfLink | string | Yes | Direct link to the PDF | Optional fields that appear on many papers: doi, journalRef, comment, reportNo, submitter, authorsRaw. Example paper object: [!NOTE] Treat optional fields as nullable in your code. The API returns whatever metadata was available from the source. Pagination - Zero-based (page=0 is the first page). - limit / maxResults is capped at 6,000 for every plan. - Use pagination.nextPage (or hasMore) to decide whether to continue. Do not guess. Best practice: Always loop using the nextPage value returned by the API. See the Code Examples page for complete quickstarts, search examples, full pagination loops, retry logic, and production patterns. Next - Authentication — key format and headers. - Search — filters and query options. - Rate Limits & Quotas — entitlements, plan changes, and rate limit behavior. - Code Examples — all ready-to-use code samples. - Errors — status codes and troubleshooting. --- ## Search URL: https://scholarxiv.com/developers/docs/papers-api/search Simple title search via GET or powerful fielded search via POST. Full filter reference and pagination patterns. Search Two modes. Same response shape. Simple (GET) — fast title-only search. Advanced (POST) — combine any of the supported fields. Both return: Simple Search (GET) | Param | Required | Default | Description | |--------|----------|---------|-------------| | q | Yes | — | Searches paper titles (case-insensitive, word-aware) | | page | No | 0 | Zero-based page index | | limit| No | 20 | 1–6,000 (capped by your plan) | Tip: Use simple search for autocomplete, quick lookups, or when users type into a single search box. Advanced Search (POST) Send a JSON body. At least one filter in searchFilterString must be non-empty. Request Body Fields | Field | Type | Notes | |----------------------|--------|-------| | searchFilterString | object | The filters (see table below). Required to be non-empty. | | page / startIndex| number | Zero-based page (both aliases accepted) | | limit / maxResults | number | Page size (1–6,000) | | sortBy | string | relevance (default), submittedDate, or lastUpdatedDate | | sortOrder | string | ascending (default) or descending (also accepts asc/desc/dsc) | Available Filters | Filter | What it matches | |--------|-----------------| | all | Title, abstract, authors, submitter, journal ref, categories, comments, DOI, report number | | id | arXiv ID fields (id, extractedID, baseArxivID) | | ti | Title only | | au | Authors (supports comma-separated list) | | abs | Abstract / summary | | cat | Primary category or any category | | jr | Journal reference | | co | Comment field | | rn | Report number | Filters are ANDed together. Several fields (all, id, au, cat) perform internal ORs across related database fields. Example — recent RAG papers in a specific category: Useful Recipes Exact arXiv ID Multiple authors (comma separated) Fielded topic + sort Sorting - relevance — internal order (default for simple search) - submittedDate — paper publication / submission date - lastUpdatedDate — last time the record was updated Invalid values fall back to relevance / ascending. Pagination See the Code Examples page for the recommended full pagination loop pattern. [!IMPORTANT] Always drive pagination from nextPage / hasMore in the response. Hard-coded loops or guessing often miss or duplicate results. Empty Results A successful search with no matches returns HTTP 200 with an empty array. This is normal — not an error. Performance Tips - Keep limit as high as you need but respect your plan's cap (see Rate Limits & Quotas). - Use the most specific filters possible for faster results. - For very large result sets, page aggressively and consider storing IDs locally. - Use the Playground to tune queries before coding. --- ## Preprint Design Ingest Citations Profiles URL: https://scholarxiv.com/developers/docs/preprint-design-ingest-citations-profiles Design: Three-Format Ingest, Citations, and Researcher Profiles Design doc for the preprint server. Decisions it implements: arXiv-style, no review, auto-listed, all disciplines, free, accepting LaTeX + PDF + DOCX. Research backing: journal-platform-research.md · scholar-profiles-and-indexing-research.md 1. Ingest — three lanes, one normalized object 1.1 The canonical artifact set Whatever comes in, every accepted submission version produces the same set of artifacts. The rest of the system only ever talks to these — nothing downstream knows or cares which lane produced them. | Artifact | Purpose | Always present? | |---|---|---| | original/ | The exact bytes the author uploaded, archived forever | ✅ | | paper.pdf | Canonical rendering. <5 MB, text layer, Type 1 fonts | ✅ | | paper.html | Accessible/mobile/indexable full text + MathML | Lanes A, B | | document.json | Structured AST: sections, figures, tables, equations | Lanes A, B | | metadata.json | Title, authors, affiliations, abstract, categories, license | ✅ | | references.json | Parsed reference list, one entry per citation | ✅ (quality varies) | | fulltext.txt | Plain text for search + similarity + classification | ✅ | | thumb.png | Page-one thumbnail (already produced by /write) | ✅ | 1.2 Lane A — LaTeX source (tier: source) LaTeXML is the right converter — it's what arXiv itself uses for HTML papers. arXiv's own caveat applies to us too: it is "a very extensible language used in myriad unique ways," so a small percentage of papers won't convert. HTML conversion failure must never block posting — the paper goes live with PDF only and a "HTML unavailable" note, exactly as arXiv does. References come from the .bbl (or .bib) — this is structured data, not guesswork, so Lane A gives us the best citation graph by a wide margin. 1.3 Lane B — DOCX (tier: converted) DOCX carries real structure — styles, heading levels, footnotes, equations as OMML — so this conversion is genuinely good. It is nothing like trying to reconstruct a PDF. Keep the original .docx archived; if pandoc improves, we can re-run the whole corpus. Author confirms the extracted metadata on a review screen before posting (§1.6). 1.4 Lane C — PDF (tier: unstructured) GROBID is the tool. Purpose-built, open source, Docker + REST, and production-proven at ResearchGate, Academia.edu, HAL, Mendeley, CERN and the Internet Archive. Published accuracy: - Reference extraction/parsing: ~0.87 F1 on a PubMed Central set (90k references), ~0.90 F1 on a bioRxiv PDF set, using the deep-learning citation model. - Isolated reference parsing: >0.90 F1 instance-level, 0.95 F1 field-level. - DOI resolution from extracted references: >0.95 F1 (via Crossref REST or biblio-glutton). - Throughput: ~2.5 PDF/sec full processing on 8 threads; ~4 GB RAM for the full pipeline. That accuracy is good enough to be useful and not good enough to trust blindly — hence §1.6. No HTML view, no version diffs, no JATS. The paper page shows a PDF only tier badge. 1.5 The TeX-derived-PDF nudge (not a block) arXiv hard-rejects PDFs whose /Producer or /Creator is a TeX engine (pdfTeX, XeTeX, LuaTeX). You chose to accept PDF, so we detect and nudge instead: *"This PDF was produced by pdfTeX. Uploading your LaTeX source instead gives your paper an HTML version, better search ranking, accurate citation extraction, and version diffs — and takes about 30 seconds." — with buttons [Upload source] and [Continue with PDF]*. Cheap to implement, preserves author choice, and reclaims most of the value of the hard rule. 1.6 The confirmation screen — the single most important UI in the ingest Lanes B and C extract metadata by machine. Never post machine-extracted metadata unconfirmed. Google Scholar takes 6–9 months to correct an indexed record, so a wrong citation_author is effectively permanent. After processing, show the author a form pre-filled with everything we extracted — title, each author + affiliation, abstract, and the parsed reference list with a per-entry confidence indicator — and require an explicit confirm. Lane A shows the same screen but pre-filled from source, so it's usually a one-click pass. 1.7 Capability matrix (surface this to authors before they choose a lane) | | LaTeX | DOCX | PDF | |---|---|---|---| | Posts publicly | ✅ | ✅ | ✅ | | DOI, OAI-PMH, Scholar meta tags | ✅ | ✅ | ✅ | | HTML full text + MathML | ✅ | ✅ | ❌ | | Metadata accuracy | exact | good | extracted, ~0.87–0.9 F1 | | Reference extraction | exact (.bbl) | good | extracted | | Version diffs | semantic | textual | page images only | | JATS export | ✅ | ✅ | ❌ | | Compile-time validation gate | ✅ | ✅ | ⚠️ format checks only | 2. Citations Two independent directions. Conflating them is the classic mistake. 2.1 Outbound — resolving our reference lists Every reference string goes through a resolution ladder, stopping at the first confident hit: 1. Explicit DOI in the string → 10.\d{4,9}/\S+ regex → validate against Crossref. 2. Explicit arXiv ID → arXiv:\d{4}\.\d{4,5} or the old archive/YYMMNNN form. 3. Other IDs — PMID, ISBN, ACL/DBLP handles. 4. Crossref bibliographic query — GET /works?query.bibliographic=&rows=2. Verified live: querying "LeCun Bengio Hinton Deep learning Nature 2015 521 436" returns 10.1038/nature14539 at score 81.1 with the runner-up at 46.8. The score gap is the confidence signal — accept above a tuned absolute threshold and a minimum margin over #2. Always send mailto= to stay in Crossref's polite pool. 5. OpenAlex title search as a second opinion for things Crossref doesn't have (preprints, dissertations, non-DOI works). 6. Internal match against our own corpus by DOI / arXiv id / normalized title. 7. Unresolved — store the raw string anyway. It still renders in the reference list, and a nightly job retries unresolved edges as external indexes catch up. 2.2 Inbound — who cites us Three sources, unioned and deduplicated by DOI: (a) Internal, instant. Any ScholarXIV paper citing another ScholarXIV paper is an edge we already own. Zero latency, zero cost, 100% accurate — and it's the only citation data that exists for a brand-new preprint. Surface it as "Cited by N papers on ScholarXIV." (b) External indexes, keyed by our DOI. Nightly/weekly polling: - OpenAlex citedbycount + the cites: filter for the actual citing list. - Semantic Scholar /paper/DOI:…/citations (also accepts ARXIV: ids), plus influentialCitationCount. - Crossref is-referenced-by-count. - OpenCitations for a fully-open third opinion. (c) Crossref Cited-by. Free, but it only returns useful data if we deposit our own reference lists. Crossref's own warning: not depositing under-reports counts by ≥20%. Since §2.1 already produces resolved reference lists, depositing them is nearly free — do it. Store per-source counts, never a single blended number: Display the max as the headline with the source named, and the breakdown on hover. Never show a number without its source and age. This is the fastest way to lose credibility with researchers, who will absolutely cross-check against Scholar. 2.3 The cold-start reality A brand-new preprint has zero citations everywhere, and stays at zero until Scholar and the aggregators index it — weeks at best. Nothing we build changes that. The product answer is §3.3: profiles are seeded from the researcher's existing work, not from what they post here. 3. Researcher profiles 3.1 Model 3.2 Claiming — the disambiguation ladder Author name disambiguation is the unsolved problem of this domain. Strongest signal first, and nothing below rung 3 ever auto-confirms: 1. Native works — anything submitted through ScholarXIV by that account. 2. Verified email match against corresponding-author metadata. 3. Candidate suggestions — OpenAlex author entities whose rawauthornames overlap, weighted by affiliation and topic overlap. Presented as a checklist the human confirms. This is precisely Scholar's "select your articles from clusters" step, and it works because the human does the last mile. 4. Manual add by DOI / arXiv ID / pasted citation. 5. Merge / split, with the rule that merging must not double-count a paper citing both versions. 3.3 Solving day one The insight that makes profiles worth building: a new user's ScholarXIV paper count is zero and their citation count is zero. If that's what the profile shows, nobody returns. The onboarding should let users build a useful profile from their ScholarXIV work before they post a preprint. The profile is the acquisition surface. The preprint server is what they stay for. 3.4 Metrics — compute and fetch Do both, and show both: - Fetch OpenAlex summarystats (hindex, i10index, 2yrmean_citedness) and Semantic Scholar hIndex — these are authoritative for the author's global record. - Compute h-index and i10-index ourselves over the confirmed, deduplicated work list, so the numbers stay correct when a user claims a paper OpenAlex hasn't linked to them. - Offer the All / Recent (5y) split that Scholar users expect. - Definitions, matching Scholar exactly: h-index = largest h such that h works each have ≥h citations. i10-index = count of works with ≥10 citations. - If our computed number differs from the fetched one, show ours and label it "computed from N confirmed works". 3.5 Refresh strategy Never on page load. A queue with tiered cadence: | Job | Cadence | |---|---| | resolve_references | on post, retry unresolved nightly | | refreshworkcitations (our papers) | daily for <90 days old, weekly after | | refreshprofilemetrics | daily if profile viewed in last 7 days, else weekly | | discoverclaimcandidates | weekly per profile | | oaipmhreindex | nightly, after the day's papers go live | 4. Build order 1. Lane A end-to-end (LaTeX → PDF + HTML + metadata + references) — extends what /write does. 2. Paper landing pages — SSR, unique URL per version, Highwire citation_* meta tags, sitemap, browse-by-date/category/author within 10 clicks. 3. PDF hygiene gate — <5 MB, text layer, Type 1 font lint. 4. DOIs (DataCite) + version and is-preprint-of relationships. 5. OAI-PMH endpoint — oai_dc + native format, hierarchical sets, nightly. 6. Lane C (PDF + GROBID) — biggest audience unlock per unit of work. 7. Confirmation screen — required by lanes B and C. 8. Reference resolution + internal citation graph → "Cited by on ScholarXIV". 9. Profile v1 (identity and native works). 10. Metrics v1 — OpenAlex ingest, cached, attributed, All/Recent split. 11. Lane B (DOCX + pandoc). 12. Claim & merge UI, external citation polling, Crossref reference deposit. 13. Differentiators — co-author graph, topic map, cited-by reading list, public profile API. 5. Open decisions 1. DOI registry — RESOLVED: Crossref. (Reverses an earlier recommendation of DataCite; real pricing, fetched 2026-07-26, says otherwise at our volume.) | | Crossref | DataCite | |---|---|---| | Annual membership | $275 (tier: $1k–$1M publishing revenue/expenses; $200 below that) | €2,000 | | Per-DOI | $0.25 per preprint (current); $0.15 back-year | €0 up to 100k/year | | Extra for for-profits | none | +€1,000–€2,500 shared infrastructure fee by revenue | | Realistic year-one total | ~$400 at 500 papers | ~$3,250 | Crossover is ≈12,000 papers/year — below that Crossref is cheaper, above it DataCite wins. That's why arXiv (≈200k/year) uses DataCite and why we shouldn't, yet. Crossref also gives us Cited-by, reference deposit, and is-referenced-by-count — the citation plumbing in §2 — on the same membership. Check eligibility for Crossref's GEM programme (fee waivers) before paying anything. Revisit DataCite if we pass ~10k papers/year; old DOIs keep resolving, we'd just run two prefixes. 2. Permanence — a minted DOI is a promise. arXiv/bioRxiv: posted = permanent, withdrawal marks a version rather than deleting. Adopt as-is, or allow deletion in an initial grace window? 3. GROBID hosting — self-host the Docker image (needs ~4 GB RAM, gives ~2.5 PDF/sec) or run it as a separate service alongside the E2B sandboxes? 4. Category taxonomy — adopt arXiv's (familiar, maps cleanly for cross-posting) or build our own for the non-physics disciplines arXiv covers poorly? --- ## Preprint Phases URL: https://scholarxiv.com/developers/docs/preprint-phases Preprint Server — Build Phases Phased plan. Each phase ships something a real user can use, and each has an explicit not in this phase list so scope doesn't creep. Design detail: preprint-design-ingest-citations-profiles.md · Research: journal-platform-research.md · scholar-profiles-and-indexing-research.md Sizes are rough relative estimates, not commitments. Phase 1 — Publish (LaTeX only) · size L Goal: a stranger can post a paper and other people can read it. Ships: - Submit from /write — freeze the project into an immutable version snapshot (files + compiled PDF + thumbnail). Reuses the existing Tectonic/E2B pipeline as-is. - Metadata form — title, authors (+ affiliations), abstract, categories, comments, license picker. Modelled on arXiv's field rules (abstract ≤1920 chars, author formatting, ASCII-safe). - Public paper page — /abs/ and /abs/v2, SSR'd, abstract visible with no gate, PDF download, version history. - Browse + search — by date, by category, by author. Plain server-rendered links. - Submission dashboard — drafts, posted papers, "post a new version". - Google Scholar meta tags + sitemap — nearly free once the pages exist, and skipping them costs 6–9 months later when Scholar has cached wrong metadata. - Basic abuse controls — account email verification, per-account rate limit (arXiv caps back-catalogue posting at 3/day), compile-must-succeed as the accept gate. Not in this phase: DOIs · PDF/DOCX upload · citations · profiles · HTML rendering · OAI-PMH. Done when: you can post a LaTeX paper from /write and send someone a public link to it. Phase 2 — Permanent and indexed · size M Goal: stop being a website with PDFs on it and become a real preprint server. Ships: - Crossref membership + DOI minting — one DOI per paper, version-specific URLs, the is-preprint-of relationship so aggregators cluster our copy with the eventual journal version. - OAI-PMH endpoint — the standard feed that OpenAlex, CORE, BASE, Semantic Scholar and OpenAIRE harvest. Dublin Core + a native format, hierarchical category sets, nightly refresh. This is what actually gets us into the citation databases. - PDF hygiene gate — enforce <5 MB, text layer present, Type 1 fonts (all three are hard Google Scholar requirements; failing any means the paper can never be indexed or cited). - Withdrawal flow — arXiv-style: a withdrawal posts a new version marked withdrawn with a reason; earlier versions stay reachable. Plus the grace-period decision (see open questions). - Robots/canonical/301 discipline — permanent URLs that never break. Not in this phase: citation counts (we're only making ourselves findable here). Done when: search Google Scholar for one of our papers and it's there. Look it up in OpenAlex and it exists. Phase 3 — Open the doors (PDF + DOCX) · size M Goal: researchers who don't write LaTeX can use the product. This is what makes "all disciplines" true rather than aspirational. Ships: - PDF lane — text extraction with pdfjs-dist/unpdf (already installed), then an LLM pass over the first page and reference section to pull title, authors, affiliations, abstract, and individual references. Uses @ai-sdk/google / openai / ai, all already installed. Zero new infrastructure. See the GROBID note below. - DOCX lane — a .docx is a ZIP of XML; unzip with fflate and parse with fast-xml-parser, both already installed. Add mammoth for clean HTML, or run pandoc in the existing E2B sandbox for the LaTeX→PDF leg. - Confirmation screen — mandatory for both lanes. Show every extracted field with a confidence indicator and require the author to confirm before posting. Non-negotiable: Scholar takes 6–9 months to correct a bad author name. - TeX-derived-PDF nudge — detect pdfTeX/XeTeX/LuaTeX in the PDF's /Producer and offer "upload your source instead and get X, Y, Z". Offer, don't block. - Tier badges on paper pages (source / converted / PDF only) and a capability comparison shown before the author picks a lane. Not in this phase: GROBID. Done when: someone with only a Word file can post a paper end to end. Phase 4 — Researcher profiles · size M Goal: a researcher's profile is full and impressive before they've posted anything here. Ships: - Import + claim — pull their publication history from OpenAlex, show it as a checklist, they confirm what's theirs. Unconfirmed matches never count toward public metrics. - Public profile page — name, affiliations (with ROR), interests, links, works list (papers hosted here + claimed external ones), co-author list. - Metrics — citations, h-index, i10-index, All and Recent-5y, plus a per-year chart. Fetched from OpenAlex/Semantic Scholar and cached. Every number labelled with its source and age. - Re-sync button and scheduled refresh. Not in this phase: our own citation graph — this phase borrows everything from OpenAlex, which is why it's cheap and why it works on day one. Done when: a researcher completes their profile and sees their ScholarXIV papers and an h-index they didn't have to type in. Phase 5 — Citations · size L Goal: papers show who cites them; profiles compute metrics from data we own. Ships: - Reference extraction and resolution — from .bbl/.bib (LaTeX), the bibliography section (DOCX), or the LLM pass (PDF). Resolve each reference via DOI regex → arXiv ID → Crossref query.bibliographic (score-and-margin threshold) → OpenAlex → internal corpus → unresolved, retried nightly. - Internal citation graph — instant, exact, and the only citation data a brand-new preprint has. Surfaces as "Cited by N papers on ScholarXIV". - External citation polling — the nextCheckAt cron described in the design doc. Batched (50 DOIs per OpenAlex call, 500 per Semantic Scholar batch), tiered freshness, snapshots-not-overwrites so the history chart is free. - Crossref reference deposit — turns on Cited-by and stops us under-reporting our own counts by the ≥20% Crossref warns about. - Citation displays — counts with source attribution, "cited by" lists, citations-over-time. - Profile metrics recomputed from our own confirmed-works graph, shown alongside the fetched numbers. Done when: a paper page shows a real, sourced citation count that matches what a researcher sees elsewhere. Phase 6 — Depth and defence · size L, mostly optional Pick from this menu based on what's actually hurting by then: - HTML full text via LaTeXML — the converter arXiv itself uses. Big win for accessibility, mobile, and search ranking. Promote to Phase 3 if SEO turns out to matter more than expected. - GROBID — swap in for the LLM extraction pass if quality data says we need it (see below). - Version diffs — semantic diffs between v1 and v2, which only LaTeX submissions can support. - Co-author graph visualisation and topic maps over a researcher's corpus. Google Scholar has never done it. - Full anti-abuse suite — similarity checking, scope classifier, figure-integrity checks, retracted-reference warnings, paper-mill signals. - JATS XML export, public profile API, JSON-LD. - Withdrawal/correction record types if the corpus starts needing them. Appendix — GROBID, Docker, and E2B Does GROBID need Docker? In practice yes. It's a Java service and the supported distribution is Docker images. Two of them: | Image | Size | Notes | |---|---|---| | grobid/grobid:0.9.0-crf | ~500 MB | CRF models only. Best runtime and memory. 2–4 F1 points lower on reference parsing, 2–5 lower on citation contexts. | | grobid/grobid:0.9.0-full | ~8 GB | Adds TensorFlow (3 GB) + embeddings (5 GB). GPU recommended; on CPU the DL models are "much slower with significantly higher memory usage." | Both run as an HTTP service on port 8070. amd64 only — they do not run on linux/arm64 and are only emulated (slowly) on Apple Silicon. (The ~0.87–0.90 F1 reference-extraction figures quoted earlier are the full* image's deep-learning model. The 500 MB CRF image is a few points below that.)* Can E2B run it? Technically yes. E2B templates are built in a full sandbox environment that can run Docker containers during setup, and setStartCmd captures a running process into the snapshot — so a sandbox could boot with GROBID already listening. The CRF image at 500 MB fits comfortably inside the 10 GB Hobby disk limit; the 8 GB full image would not, and its 8 GB memory need is at the plan ceiling. But it's the wrong shape. E2B sandboxes are ephemeral and per-session (1 h on Base, 24 h on Pro). GROBID is a long-running stateless HTTP service whose expensive step is loading models into memory at startup. Using E2B means paying that startup cost repeatedly for a job that takes a fraction of a second once warm. E2B is the right tool for LaTeX compiles — untrusted, per-user, isolated. GROBID is none of those things. If we ever want GROBID, the right home is a small always-on container on Fly.io / Railway / Render / a cheap VPS running the CRF image — roughly 2 GB RAM, on the order of $5–10/month — called over HTTP from Vercel. Recommendation: don't build any of that in Phase 3. Text extraction is already solved in our stack (pdfjs-dist, unpdf) and the "which line is the title, where do the references start" problem is something an LLM handles well — and we already have three LLM SDKs installed. Ship the PDF lane with zero new infrastructure, measure how often authors correct the confirmation screen, and add GROBID in Phase 6 only if that number is bad. Open questions before Phase 1 1. Withdrawal grace period — arXiv/bioRxiv say posted is permanent forever. Copy that, or allow deletion within a short window (e.g. 24 h) before the DOI is minted? *(Recommendation: 24 h grace, permanent after. Mint the DOI at the end of the window.)* 2. Category taxonomy — adopt arXiv's list, or extend it? *(Recommendation: arXiv's as the base, plus categories for biology, medicine, and humanities, which arXiv covers poorly.)* 3. Phase 1 scope check — is "LaTeX only, no DOIs" an acceptable first release, or does Phase 2 need to merge into Phase 1 so the first public papers are citable from day one? --- ## Chat Completions URL: https://scholarxiv.com/developers/docs/router-api/completions POST /api/v1/router/chat/completions — OpenAI-compatible endpoint that routes and executes in one call. Route and run OpenAI-compatible. Send "model": "auto" and the router picks; send a real model id and that one runs, subject to your plan. For the website's full research agent, tools, streaming, and saved conversations, use the Agent API. This Router endpoint runs model completions; it does not execute the research workflow. Request body | Field | Type | Description | |---|---|---| | model | string | auto, auto:quality, auto:cheap, or a concrete model id. Omit for auto. | | messages | array | Required. Standard { role, content } objects. | | models | string[] | Restrict the routing pool (ignored when model is a concrete id). | | max_tokens | number | Passed through to the model. | | temperature | number | Passed through to the model. | Example model in the response is always the model that actually answered — not what you asked for. Log it: it's how you audit what the router is doing on your behalf. Notes - Responses are non-streaming today. Use /api/v1/router and call the model yourself if you need to stream. - A concrete model id outside your plan returns 403 rather than silently downgrading, so you always know which model ran. - 502 means the upstream model call failed. Retry with the next model from fallbacks on the decision endpoint. --- ## Dashboard URL: https://scholarxiv.com/developers/docs/router-api/dashboard Configure the router: billing mode, your own AI Gateway key, routing profiles per API key, and per-key usage. Router dashboard Everything about how the router behaves for your account is configured in one place: Developers → Dashboard → Router. Billing Pick who pays for the models the router chooses. | Mode | Who pays | Model pool | |---|---|---| | Your subscription (default) | ScholarXIV bills it | The models your plan includes | | Your gateway key | You pay the provider directly | Everything your key can reach — plan tiers no longer restrict it | To switch to your own key, paste a Vercel AI Gateway key and save. It's verified against the gateway before it's stored — a key that can't reach any models is rejected rather than saved and left to fail on your first real request. Once stored it is encrypted at rest and never shown again; the dashboard displays only the last four characters and when it was added. Removing the key returns you to subscription billing. Routing profiles A profile is a named policy the router must obey. Each one carries: | Setting | What it does | |---|---| | Allowed models | Exact ids or wildcards (anthropic/*). Empty means every model available to you. | | Optimize for | The default preset — quality, balanced or cheap. | | Max cost per request | A hard per-request ceiling in USD. Leave blank to use your plan's default. | One profile is always the default. Assign profiles to individual API keys under Key assignment — a key with no assignment routes under the default. This is how you run tiers of your own product through one router: give your free tier a profile capped to cheap models, your paid tier a profile with the frontier ones, and issue each tier its own API key. How profiles interact with a request A models list or preset sent on a request is applied on top of the key's profile: - preset on the request overrides the profile's default, for that call only. - models on the request narrows the profile's allowed list. It can never widen it — a request cannot reach a model its key's profile excludes. Usage The same page reports what the router actually did, over 24 hours, 7 days or 30 days: - Requests, estimated spend, average routing latency, and average number of candidate models considered - Requests over time - Models chosen and the task mix the classifier assigned - Per API key: volume, estimated spend, average routing latency, last used - Recent decisions — model, task, preset, cost and latency for individual calls Estimated spend is computed from list pricing and the expected answer length for the task, so treat it as a close estimate rather than an invoice. --- ## Feedback URL: https://scholarxiv.com/developers/docs/router-api/feedback POST /api/v1/router/feedback — tell the router how its pick performed so model rankings improve. Feedback The router ships with estimated model rankings. Feedback is what replaces those estimates with measurements — for your traffic, not a benchmark's. Request body | Field | Type | Required | Description | |---|---|---|---| | decision_id | string | Yes | From a routing decision or a completions response. | | feedback | string | Yes | positive, negative, regenerated, or model_switched. | What each value means | Value | Send it when | |---|---| | positive | The answer was good. | | negative | The answer was wrong, unusable, or off-target. | | regenerated | The user asked for another attempt — the strongest implicit negative. | | model_switched | The user overrode the routed model with their own choice. | Errors | Status | Meaning | |---|---| | 400 | Missing decision_id, or feedback isn't one of the four values. | | 404 | Unknown decision_id, or it belongs to another account. | You can only score your own decisions — otherwise anyone holding a decision id could skew someone else's routing. --- ## Router API URL: https://scholarxiv.com/developers/docs/router-api Send a prompt, get the model that should answer it. The same routing engine that powers Auto mode in ScholarXIV chat and health. Router API Picking a model is a decision your users should not have to make, and one you should not have to hardcode. The Router API reads a request and tells you which model to send it to — weighing task type, difficulty, price, speed and measured reliability. It's the same engine behind Auto mode in ScholarXIV's research and health chat. Two ways to use it Decide only — POST /api/v1/router returns a model id and fallbacks. You call the model yourself, on your own infrastructure, with your own keys. Decide and run — POST /api/v1/router/chat/completions routes and executes, in an OpenAI-compatible shape. Swap your base URL, set "model": "auto", done. How a decision is made 1. Constraints. Models that can't serve the request are removed outright: no tool support when you need tools, no image/pdf input when you're sending a scan, not enough context for the prompt, or outside your plan. 2. Classification. A fast classifier assigns the request one of 14 task types (researchsynthesis, code, mathreasoning, visiondoc, trivialchat, …) plus a difficulty score. 3. Scoring. Survivors are ranked on quality, cost, speed and reliability, weighted by your chosen preset. Two guard rails bound the result: each task carries a capability floor, so a cheap preset can't answer a hard question with a weak model, and each plan carries a per-request cost ceiling, so a quality preset can't quietly spend frontier money on a long prompt. Both only ever filter — if nothing survives a guard rail, the closest candidate is used rather than failing. 4. Fallbacks. The top three come back ranked, so you can retry down the list. Presets | Preset | Behavior | |---|---| | quality | Strongest model available for the task | | balanced (default) | Frontier models when the task earns it, fast ones otherwise | | cheap | Cheapest model that still clears the task's capability floor | Quick start Billing and control Two ways to pay, switched in the developer dashboard: - Your ScholarXIV subscription — we bill it, and your plan decides which models the router can reach. - Your own AI Gateway key — you pay the provider directly, and plan tiers stop restricting the pool. The key is verified before it is stored and encrypted at rest; it is never shown again. The dashboard is also where you define routing profiles: named policies with an allowed-model list, a default preset and a per-request cost ceiling. Point different API keys at different profiles to run tiers of your own product through one router, and watch per-key volume, spend, latency and model mix in the same place. See Dashboard for the full walkthrough. Pricing Routing decisions count against your regular API rate limit — there is no separate per-decision charge. When you use /chat/completions, you pay the underlying model's rate with no router surcharge. Close the loop Send the decision_id back through the feedback endpoint when a routed answer was regenerated, rejected, or worked well. Feedback is what turns the router's model rankings from estimates into measurements. --- ## Route URL: https://scholarxiv.com/developers/docs/router-api/route POST /api/v1/router — analyze a request and return the model that should handle it, with fallbacks. Route a request Returns a routing decision. Nothing is executed — you call the returned model yourself. Authentication Same as every other endpoint: x-api-key: sxv… or Authorization: Bearer sxv…. See Authentication. Request body | Field | Type | Required | Description | |---|---|---|---| | messages | array | one of | OpenAI-style messages. The last user turn is what gets classified. | | prompt | string | one of | A single prompt, if you don't have a message array. | | preset | string | No | quality, balanced (default), or cheap. | | models | string[] | No | Restrict the pool. Exact ids or wildcards: anthropic/, openai/gpt-5. | | requires_tools | boolean | No | Set when you'll pass tools — models without tool-calling are excluded. | | has_image | boolean | No | Set when the request includes an image, so vision-incapable models are excluded. | | has_pdf | boolean | No | Set when the request includes a PDF. | Response | Field | Description | |---|---| | decision_id | Pass to /feedback to score this decision. | | model | The model to use. | | fallbacks | Next-best models, ranked. Retry down this list on failure. | | task | Predicted task type, one of 14 labels. | | difficulty | 0–1. How demanding this request is within its task type. | | preset | The preset the decision was made under — echoes your request, or balanced. | | estimatedcostusd | Estimated cost of this one request on the chosen model. | | candidates_considered | How many models survived the constraint filter. | | routinglatencyms | Time spent deciding. | | degraded | true when constraints left no candidates and a safe default was used. | Profiles set the policy; requests narrow it Each API key routes under a routing profile you configure in the developer dashboard — a saved policy carrying an allowed-model list, a default preset and an optional per-request cost ceiling. A models list on the request is applied on top of that profile, so it can only narrow what the profile already permits. A request cannot reach a model its key's profile excludes. Likewise preset on the request overrides the profile's default for that call only. If you configure your own AI Gateway key in the dashboard, routing bills to that key and our plan tiers stop restricting the pool — you're paying the provider directly. Restricting the pool Route only across models you already have keys for: If no model matches your patterns, the response comes back with degraded: true and a safe default — the endpoint never fails just because routing couldn't find a match. Errors | Status | Meaning | |---|---| | 400 | No messages or prompt, malformed JSON, or an unknown preset. | | 401 | Missing, malformed, or revoked API key. | | 429 | Rate limit for your plan exceeded. | --- ## Scholar Profiles And Indexing Research URL: https://scholarxiv.com/developers/docs/scholar-profiles-and-indexing-research Discoverability, Citations & Researcher Profiles — Research Dossier Companion to journal-platform-research.md. Covers two questions: 1. Should we accept PDF and DOCX alongside required LaTeX source? (§1) 2. How do Google Scholar indexing, citation counting, and author profiles actually work — and how do we build a researcher profile with real citation data? (§2–§7) Sources are primary and fetched July 2026. API field shapes in §4 were verified with live calls, not recalled. 1. PDF and DOCX — the elaboration you asked for 1.1 What the incumbents actually do | Server | LaTeX source | PDF | DOCX | |---|---|---|---| | arXiv | preferred | accepted only if not TeX-derived | rejected outright | | bioRxiv / medRxiv | rejected (must convert to PDF first) | accepted | accepted → auto-converted to PDF | | Nature | accepted at acceptance stage only, then converted to Word | initial submission only | preferred | | PLOS ONE | rejected (submit the PDF) | accepted for LaTeX users | accepted (DOC/DOCX/RTF) | arXiv's rule is the sharp one: "We do not accept dvi, PS, or PDF created from TeX/LaTeX source." Their stated reason is portability and stability over time — a PDF is a dead end, source can be re-rendered forever. That rule is mechanically enforceable. Every TeX engine stamps the PDF's /Producer and /Creator metadata (pdfTeX-1.40.x, XeTeX, LuaTeX). We can detect a TeX-derived PDF in milliseconds and reject it with "you have the source — upload it." No judgement call needed. 1.2 The tension in your own decisions You chose all disciplines and LaTeX required. Those pull against each other, hard: - LaTeX is the norm in physics, math, CS, astronomy, quantitative economics, and statistics. - Word is the norm in biology, medicine, chemistry, psychology, most social sciences, and the humanities — the majority of the world's researchers by headcount. bioRxiv exists precisely because life scientists don't write TeX. If we require source-only, we build an arXiv competitor, not an all-disciplines preprint server. That's a fine product — it's just a different one than "all disciplines" implies, and it should be a deliberate choice rather than a side effect. 1.3 What we gain by having the source (this is the real argument) The compile pipeline you already have (src/lib/write/ + Tectonic in E2B) makes source-in disproportionately valuable: | Capability | With LaTeX source | With DOCX | With PDF only | |---|---|---|---| | Automated accept gate (compiles = valid) | ✅ free, replaces the human moderator you're not hiring | ⚠️ via conversion | ❌ nothing to check | | HTML full text (accessibility, mobile, SEO, Scholar likes it) | ✅ | ✅ | ❌ | | Structured metadata (title/authors/abstract/refs read from source) | ✅ exact | ✅ good | ❌ guessed by a parser | | Reference list extraction → citation graph | ✅ from .bbl/.bib | ✅ | ⚠️ heuristic | | MathML / accessible equations | ✅ | ⚠️ | ❌ | | Semantic version diffs ("what changed in v2") | ✅ | ⚠️ | ❌ | | JATS XML export (indexers, PMC, preservation) | ✅ | ✅ | ❌ | | Format migration in 20 years | ✅ | ✅ | ⚠️ | | Spam resistance | ✅ high friction | ⚠️ medium | ❌ upload anything | That last row matters more than usual for us. With no human moderation, the compile gate is the only gate we have. A PDF-only lane has no gate at all. 1.4 Recommendation — a three-tier acceptance model Don't make it a binary. Make the tier visible on the paper's page, and let it drive features: Tier 1 — source (LaTeX). Required path, the default, and the only one available at launch. Full feature set: HTML view, MathML, structured metadata, version diffs, JATS export, "Source available" badge, higher default ranking in our own search. Tier 2 — converted (DOCX). Ship right after launch. Pipeline: DOCX → pandoc → LaTeX → Tectonic → PDF + HTML. DOCX carries real structure (styles, headings, footnotes, equations as OMML), so conversion is genuinely good — far better than anything you can do from a PDF. Keep the original DOCX as an archived asset. This is what unlocks "all disciplines" honestly. Tier 3 — unstructured (PDF). Accept only with these guardrails: - Reject if /Producer or /Creator matches a TeX engine — arXiv's exact rule, with a message telling them to upload the source. - Reject if there is no extractable text layer (scans). Google Scholar rejects these too, so accepting them would mean hosting papers that can never be indexed or cited. - Reject if >5 MB (Scholar's hard cap — see §2.2). Or warn and offer compression. - Metadata typed by hand by the submitter, flagged as unverified. - No HTML view, no diffs, no JATS. Visibly a second-class object. My call: launch Tier 1 only (it's what you already have and it's the strongest product), add Tier 2 within the first few iterations because "all disciplines" demands it, and treat Tier 3 as a grudging escape hatch that we may never need. If you want to keep it maximally simple, ship Tier 1 + Tier 3-with-guardrails and add DOCX when the first biologist complains. 1.5 One hard constraint you should design around now Google Scholar will not index a PDF over 5 MB, and will not index a PDF without a text layer. Our compiler should surface the output PDF's size at compile time and warn above ~4 MB, with the same advice arXiv gives: JPEG for photographs, PDF/PNG/PS for line art, and watch for images above 34 megapixels. A paper we host that Scholar can't index is a paper that will never accrue citations — which makes the whole profile feature in §6 worthless for it. 2. Google Scholar — how content gets in Scholar has no public API and no submission form. You do not submit to Scholar; Scholar crawls you. Getting indexed is purely a matter of meeting their technical guidelines. 2.1 Site-level requirements - The site must host primarily scholarly articles — journal papers, conference papers, dissertations, preprints, technical reports. (Scholar generally excludes book reviews, editorials, and documents without authors.) - Every article needs its own unique URL. Not multiple abstracts on one page, not multiple papers in one PDF, not one paper split across several files. - Complete abstracts must be visible without signing in, installing anything, dismissing a popup, or scrolling past other content. - Browse interface: every article URL must be reachable from the homepage in ≤10 simple HTML links. Recommended shapes: a single publications page (small collections); browse by publication date or entry date (thousands); plus a "last two weeks" listing for frequent recrawl once you pass ~100,000 papers. - No Flash, JavaScript, or form-based navigation for those links — plain HTML GET links. (Relevant to us: SvelteKit must SSR the browse pages and the article pages.) - robots.txt must not block article or browse URLs; should block search results, carts, comment forms and other dynamic junk. - Uptime and correct status codes: 5xx for temporary errors, 4xx for permanent ones, HTTP 301 when an article moves — never redirect to the homepage. 2.2 File requirements - HTML or searchable PDF only. Maximum 5 MB. (Over 5 MB → they tell you to use Google Books.) - PDFs must have text extractable by Acrobat Reader. No scans. 2.3 Metadata — the Highwire Press tags Scholar reads four schemes; Highwire Press citation_* is preferred (also supported: BE Press bepresscitation, PRISM prism., Dublin Core DC.* — DC is explicitly the least reliable). Minimum required: title, first author, publication year. Also available: citationconferencetitle, citationvolume, citationissue, citationfirstpage, citationlastpage, citation_isbn, citationdissertationinstitution, citationtechnicalreport_number. Rules: author names as Smith, John or John Smith; omit affiliations and degrees; present values as they'd appear in a citation (Trans. Mag. Real., not Magic Realism, Transactions on); escape HTML special characters properly. 2.4 If you have no meta tags, the PDF's visual layout becomes the metadata Worth knowing because it constrains our LaTeX templates: - Title = the largest text on page 1, minimum 24pt, at the top. - Authors = 16–23pt, immediately before or after the title. - A formal bibliographic citation line alone on its own line in the header or footer. - Use Type 1 fonts, not Type 3 — i.e. Times/Helvetica/Palatino in LaTeX. (Old latex+dvips bitmap-font setups produce Type 3 and break Scholar's text extraction. Tectonic/pdfTeX with standard font packages is fine; this is a template-lint rule we should enforce.) - Journal/repository name must be in smaller type than the title and authors. We will emit meta tags, so this is a belt-and-braces concern — but our default templates should comply anyway, because the PDF travels beyond our site. 2.5 Reference formatting — this is how citations happen Scholar parses reference lists out of the full text. Their requirements: - Mark the section with a standard heading — "References" or "Bibliography" — on its own line. - Format entries as numbered: 1./2./3. or [1]/[2]/[3] in PDFs; an ` in HTML. - Each entry must be a formal bibliographic citation with no commentary mixed in. - "Incorrect formatting may cause exclusion or low ranking." Practical consequence for us: our LaTeX templates should default to a numeric bibliography style (plainnat/unsrt/ieeetr-like), and our HTML renderer must emit the bibliography as a real under an References. Author-year styles are riskier for parsers. 2.6 Timeline, and the risk our no-moderation choice creates - Scholar updates several times a week; new papers typically appear within weeks. - Corrections to already-indexed papers take 6–9 months, sometimes years. Get the metadata right the first time — a bad citation_author is effectively permanent for the better part of a year. - The site: operator's result count is explicitly unreliable for measuring coverage. The risk, stated once: Scholar's first content requirement is that the site host *primarily scholarly articles*. A free, all-disciplines, zero-moderation server is a spam magnet, and the penalty for failing that test is de-indexing — which would destroy the citation and profile features that are the whole point of §6. I'd still build it your way, but with an automated gate that costs no staff time: 1. Compile must succeed (already have it). 2. Similarity check against the corpus + web (Crossref Similarity Check or an open equivalent). 3. Account verification + per-account rate limits (arXiv caps back-catalogue posting at 3/day). 4. Structural sanity: has an abstract, has a references section, above a minimum length, is in English or declares its language, isn't a duplicate of an existing entry. 5. LLM scope/type classifier that flags — not blocks — likely non-research uploads. That is a machine, not a moderation team, and it keeps us inside Scholar's content requirement. 3. Google Scholar — how citations are actually counted - Scholar crawls full text, extracts each paper's reference list, and matches those references to records it has already indexed. Citation counts are the size of the resulting inbound set. - Their own caveat: counts *"reflect the state of the web as it is currently visible to our search robots."* They are an estimate, not a ledger. - Version clustering is the important mechanic. Scholar automatically identifies different versions of the same article — preprint, publisher version, repository copies — and groups them into one record ("All versions"). Citations aggregate across the cluster. This is why an arXiv preprint and its published journal version share a citation count. Why this matters enormously for us: if a ScholarXIV preprint is correctly recognised as a version of the eventual journal article, our copy inherits the whole citation count and appears in "All versions" — free credibility and traffic. To make that clustering work we need: identical/near title and author strings, a DOI, and ideally an explicit is-preprint-of relationship registered with the DOI (§5). - An asterisk (\*) on a profile means the count includes citations that might not match that article — i.e. automated matching wasn't confident. 4. Citation data we can actually use in-product Google Scholar cannot be a data source for us. No API, and scraping violates their terms. Every "Scholar-like" product is built on the open stack below. Field shapes here were verified with live API calls today. 4.1 OpenAlex — the best default Free, CC0, ~2× the coverage of Scopus/WoS by their claim. A free API key now gives $1/day of usage; heavier use needs a paid plan or the quarterly snapshot. GET https://api.openalex.org/authors?search=Yoshua%20Bengio returns, per author: summary_stats hands us h-index and i10-index precomputed — the two headline numbers on a Google Scholar profile — and rawauthornames is a ready-made name-variant list for disambiguation. GET https://api.openalex.org/works?filter=doi:… returns, per work: doi, title, publicationdate, type ("preprint"), **indexedin: ["arxiv","datacite"], primarylocation { landingpageurl, pdfurl, version: "submittedVersion", source { type: "repository", … } }, openaccess { isoa, oastatus: "green", oaurl }, and authorships[] with each author's OpenAlex id, institutions (with ROR), is_corresponding, and rawaffiliationstrings. Note the primary_location.id on that arXiv record: pmh:oai:arXiv.org:2205.01833. OpenAlex ingested it through OAI-PMH. That is the doorway (§5.2). 4.2 Semantic Scholar Academic Graph (S2AG) Free; API key optional but strongly recommended — unauthenticated calls get 429'd quickly (mine did). - Paper: citationCount, influentialCitationCount (their distinctive signal), referenceCount, externalIds (ArXiv, DOI, DBLP, MAG, ACL, PubMed, CorpusId), openAccessPdf, tldr, embedding.specter_v2, plus /citations and /references endpoints. - Author: paperCount, citationCount, hIndex. (Verified live: Oren Etzioni → 258 / 43,671 / 88.) - Batch: POST /paper/batch, ≤500 ids, ≤10 MB, ≤9,999 citations per call. Accepts ARXIV:2106.15928 style ids directly — useful for us. 4.3 Crossref - Any DOI's inbound count is on the work record as is-referenced-by-count (verified: 10.1038/nature14539 → 74,490). Free, no key. - Cited-by service is free but requires you to deposit your reference lists; Crossref warns that not depositing your own references under-reports counts by at least 20%. Crossref only matches Crossref-registered → Crossref-registered works. 4.4 OpenCitations CC0 open citation index (COCI, OpenCitations Meta). Good as a third source and as the ideologically consistent one for an open platform. REST APIs + full dumps. 4.5 Summary | Source | Cost | Author metrics | Coverage | Use it for | |---|---|---|---|---| | OpenAlex | free (key, $1/day) | h-index, i10-index, works, citations | broadest | primary — profiles, metrics, affiliations, ROR | | Semantic Scholar | free (key advised) | hIndex, paperCount, citationCount | strong in CS/bio | cross-check, influential citations, TLDRs, embeddings | | Crossref | free | none | DOI-registered only | per-paper counts, reference deposit, our own DOIs | | OpenCitations | free | none | DOI-based | open citation graph, third opinion | | Google Scholar | ❌ no API | — | broadest | link out only | | Scopus / WoS | paid | yes | curated | not worth it | Design rule: merge sources by DOI → arXiv id → normalised title+year, and always display which source a number came from and when it was fetched. Nothing destroys trust in an academic product faster than an unattributed citation count that disagrees with Scholar. 5. Making our papers citable and indexable Six things, in dependency order. All are cheap; none are optional if profiles are to mean anything. 5.1 Persistent identifiers Mint a DOI per paper and per version. Use Crossref, not DataCite — see the pricing comparison in preprint-design-ingest-citations-profiles.md §5.1. (arXiv uses DataCite — the OpenAlex record above shows indexed_in: ["arxiv","datacite"] — but that only pays off above ~12,000 papers/year, and arXiv posts ~200k.) Register the is-preprint-of / is-previous-version-of relationships so aggregators can cluster our copy with the published version (§3). Version policy to copy from bioRxiv: all versions share one DOI, with version-specific URLs (/abs/XXXX.NNNNNv2) for citing a specific one. 5.2 An OAI-PMH endpoint This is how the aggregators find us — it is the single highest-leverage item on this list. arXiv's implementation is the template: - OAI-PMH v2.0, one stable base URL. - Item = article, latest version exposed (with version history inside the richer format). - Metadata formats: oai_dc (Simple Dublin Core — the universal one) plus a native format with authors split out, categories, and license. arXiv offers oai_dc, arXiv, arXivRaw. - Sets for selective harvesting, hierarchical: group:archive:CATEGORY. - Datestamps = last modification, supporting incremental harvest via from. - Update nightly, right after new papers go live. Harvesters that will pick us up: OpenAlex, CORE, BASE, Semantic Scholar, OpenAIRE, Unpaywall. 5.3 Landing pages that satisfy §2 SSR'd HTML, unique URL per paper and per version, abstract visible with no interstitial, full Highwire citation* tags, absolute citationpdf_url, and a browse interface within 10 clicks (by date, by category, by author) plus a "recent" feed. Sitemap. Correct 301s forever. 5.4 Full text in both HTML and PDF PDF ≤5 MB with a real text layer and Type 1 fonts; HTML for accessibility, mobile, and better parsing. Tier-1 (LaTeX) submissions can produce both from one source — this is exactly why §1 recommends requiring source. 5.5 A conventionally formatted reference list References + in HTML; numbered entries under a "References" heading in the PDF; no commentary interleaved. See §2.5. 5.6 Deposit our references If we register DOIs and deposit reference lists, we join the citation graph as a citing party, not just a cited one — and Crossref Cited-by starts returning real data for our papers. 6. The researcher profile — design 6.1 What Google Scholar's profile actually is (the thing to match, then beat) Creation: sign in with a Google account → four steps — confirm name spelling; enter affiliation and research interests; select your articles from clusters of similarly-named authors; choose how future updates are handled. Fields: name, affiliation, research interests, photo, homepage URL, and a verified institutional email. The email is *hidden from the public* but is required for the profile to appear in Scholar search results — profile must be public and email-verified. Adding works, three ways: search by title/keyword; enter bibliographic data manually if search fails; or "add article groups" for people who publish under several name forms. Merging: duplicates are consolidated with a Merge button that combines counts without double-counting papers that cite both versions. Update mode: automatic (matching articles are added without approval) or notify me (email review first). This applies only to the article list — citation counts always update automatically. Metrics shown, each in an All and a Recent (last 5 years) column: - Citations — total. - h-index — "the largest number h such that at least h articles were cited at least h times each." (Example from their own docs: citations of 17, 9, 6, 3, 2 → h = 3.) - i10-index — number of articles with ≥10 citations. Scholar-specific; nobody else uses it. - An asterisk marks counts that include possibly-mismatched citations. Also: public/private toggle; a stable public URL scholar.google.com/citations?user=; co-author list; a per-article citation-over-time graph; "follow" alerts for new articles by an author or new citations to a paper. (For venues rather than people, Scholar Metrics uses h5-index and h5-median* — the h-index and h-core median restricted to the last five complete calendar years. If we ever want to publish a "ScholarXIV h5-index", that's the definition.)* 6.2 Proposed data model 6.3 Claiming and disambiguation (the genuinely hard part) Author name disambiguation is the unsolved problem of this domain. Ladder, strongest first: 1. Native works. Anything submitted through ScholarXIV by that account is auto-attached. 2. Email match against the corresponding-author email in the metadata. 3. Candidate matching — OpenAlex author entities whose rawauthornames overlap plus affiliation/topic overlap — presented as suggestions the user confirms, never auto-attached. This is exactly Scholar's step 3 (pick your articles from clusters) and it works because the human does the last mile. 4. Manual add by DOI / arXiv ID / free-form citation. 5. Merge / split controls, with a rule that merging never double-counts a citing paper. Store claimState so an unconfirmed auto-match can never inflate public metrics. 6.5 Metrics: compute, cache, attribute - Pull summary_stats from OpenAlex as the headline; cross-check totals against Semantic Scholar and Crossref; store all three with fetchedAt. - Compute h-index and i10-index ourselves too, from the merged deduplicated work list, so a claimed-works profile stays correct when a user adds a paper OpenAlex hasn't linked to them. - Offer the All / Recent(5y) split Scholar users expect. - Show a per-year citation histogram and a per-year publication count. - Always label the source and the as-of date. "Citations 1,204 · via OpenAlex, 2 hours ago." - Refresh on a schedule (daily for active profiles, weekly otherwise), never on page load. 6.6 Where we can beat Scholar Scholar's profile is a 2011 web page. Cheap differentiators, roughly in order of value/effort: 1. Platform-native metrics Scholar can't have — views, downloads, and version history for papers hosted here (arXiv-style, and honest: label them as engagement, not impact). 2. Co-author graph — an actual visualisation; OpenAlex authorships gives us the edges free. 3. Topic map over the author's corpus (we already do classification in this product). 4. "Cited by" reading list with our own summarisation on top — this is the natural bridge to the rest of ScholarXIV. 5. One-click claim at onboarding: paste an arXiv author ID, get a populated profile in seconds. First-run experience decides whether anyone ever comes back. 7. Public API + machine-readable profile (JSON-LD ScholarlyArticle / Person), because Scholar has none and researchers want their data out. 8. DORA-consistent framing — show distributions, not just a single h-index. It costs nothing and signals we understand the field's own critique of these metrics. 7. Build order for this half 1. Landing pages + Highwire meta tags + sitemap + SSR browse — nothing else works without these. 2. PDF hygiene in the compile pipeline — <5 MB warning, text layer assertion, Type 1 font lint. 3. DOIs via DataCite, with version + is-preprint-of relationships. 4. OAI-PMH endpoint (oai_dc + a native format, hierarchical sets, nightly). 5. Profile v1 — identity, affiliations, and native works. 6. Metrics v1 — OpenAlex ingest, cached, attributed, with All/Recent split. 7. Claim & merge UI — candidate matching, confirm/reject, merge. 8. Differentiators — co-author graph, topic map, cited-by reading list, public profile API. Sources Google Scholar: technical inclusion guidelines · Scholar Citations / profiles · how Scholar works · Scholar Metrics — OpenAlex API docs (author/work shapes verified live against api.openalex.org) — Semantic Scholar Academic Graph API (verified live) — Crossref Cited-by (verified live via api.crossref.org`) — OpenCitations — arXiv OAI-PMH interface — arXiv submission formats — --- ## Testing URL: https://scholarxiv.com/developers/docs/testing Testing Commands | Command | What it runs | Needs | | ----------------------- | ---------------------------------------- | ------------------------------ | | pnpm test | Unit tests | Nothing | | pnpm test:watch | Unit tests, rerun on save | Nothing | | pnpm test:integration | Tests against a real MongoDB | Downloads MongoDB on first run | | pnpm test:scripts | Tests for scripts/ | Nothing | | pnpm test:coverage | Unit tests, with a report in coverage/ | Nothing | | pnpm test:all | Unit, integration and scripts | As above | To run one file: pnpm vitest run --project unit src/lib/tex_unescape.test.ts. CI runs all of it on pushes to main and on pull requests (.github/workflows/test.yml). Where tests go A test sits next to the code it covers: | Kind | Name | Example | | ---------------- | ------------------------------------------ | ----------------------------------------------------- | | Unit | name.test.ts | src/lib/tex_unescape.test.ts | | API route | server.test.ts, beside +server.ts | src/routes/api/pdf_proxy/server.test.ts | | Needs a database | name.integration.test.ts | src/lib/subscriptions/lifecycle.integration.test.ts | | Script | scripts/name.test.mjs, using node:test | scripts/repairmodelsaves.test.mjs | The name decides which project a test runs in, so nothing needs registering. Shared helpers live in src/test/. Unit or integration? Write a unit test when the logic can be checked without a database, and mock what's around it. Unit tests can't reach a real database: src/test/norealdatabase.ts swaps it for an empty fake, whatever .env says. Write an integration test when the database is part of what you're checking: atomic updates, races, query filters, indexes. A mock can't show that two requests racing for the last slot behave. Integration tests start their own MongoDB replica set, and each file gets its own database: The first run downloads MongoDB, about 750 MB, and caches it. On a slow connection, or if you already have mongod, set MONGOMSSYSTEMBINARY to its path to skip that. They can't reach a real cluster. src/test/mongo.ts refuses any address but the local one, and mongoglobalsetup.ts sets MONGO_URI before dotenv loads, so a value in .env is never used. API and MCP Most routes share the same risks, so two kinds of test cover them. Sweeps cover every route, so a new one is checked without anyone writing a test for it: | Test | What it checks | | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | src/routes/api/anonymous_access.test.ts | Calls every method of every route with no credentials. Nothing may write, succeed outside a short list, or crash | | src/hooks.server.test.ts | Which routes the sign-in gate leaves open, kept as a snapshot | | src/lib/server/admin/access.test.ts | Every admin endpoint checks for itself | | src/lib/server/agent/openapi_routes.test.ts | Everything the API docs promise exists, and new /api/v1 routes get documented | If one of these fails on a new route, decide whether that route should be open. If it should, add it to the list in the test, or accept the snapshot with pnpm vitest run -u. The diff is the review. Depth tests use real data and two people, because being signed in must not be enough: | Test | What it covers | | ---------------------------------------------- | ------------------------------------------------------------------- | | src/routes/api/ownership.integration.test.ts | Chats, comments, notes, canvases, manuscripts, surveys, collections | | src/routes/api/v1/v1_api.integration.test.ts | The public API with real keys: isolation, rate limits, validation | | src/lib/mcp/tools.integration.test.ts | A real MCP client calling the real tools: plans, roles, isolation | | src/lib/mcp/transport.test.ts | The MCP protocol, keys and quota charging | When testing that someone is refused, also test that the owner succeeds on the same id. Otherwise the test still passes if the id is wrong. Known gaps it.fails marks a test for something the code should do but doesn't. It passes while the problem exists and goes red once it's fixed, which is the cue to change it to a plain it. Search for it.fails to list them all. These are what they mark today. Decisions needed These tests describe guest access the code doesn't have. Either build it, or delete the tests. | Expected | What happens now | Test | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------- | | Signed-out visitors can use /homepage, /search, /api/searchpapers and /api/pdfproxy | They're redirected to / | src/hooks.server.test.ts | | Protected APIs answer signed-out requests with 401 | They redirect to / | src/hooks.server.test.ts | | Protected pages send you to sign in, then back | They redirect to /, except shared chats | src/hooks.server.test.ts | | /api/searchpapers is rate limited, caps results at 50, and answers 401 for advanced search when signed out | None of these. checkBrowserRateLimit isn't used by any route, and results are capped at 40,000 | src/routes/api/searchpapers/server.test.ts | Not tested - The tools that call a language model, such as researchchat and healthchat, beyond whether they're listed. - Routes that need outside services, beyond refusing callers with no credentials. - The fallback paper search has no time limit, unlike the main search. Coverage pnpm test:coverage fails below the floor in vitest.config.ts. Raise the floor as coverage grows. The number counts unit tests only, so code covered by integration tests alone reads as uncovered, which includes most of what the MCP and API depth tests reach. Svelte components aren't measured, and nothing tests pages in a browser yet. --- ## Verify Checkout URL: https://scholarxiv.com/developers/docs/verify-checkout Verify Checkout Verify Checkout is a separate ETB payment option. The existing bank-transfer page at /verify_payment, its verification API, and the USD/Polar integration remain unchanged. On each pricing page, select ETB, then a plan. Verify Checkout is the default ETB method; select Bank transfer to use the existing checkout. The new review page is /verify_checkout?plan=plus&interval=monthly. It sends the customer to Verify's hosted checkout, where they select a receiving account and submit their transfer reference. /verify_checkout/return?order=… shows the stored order and reconciles its current payment state. No bank-reference input is added to the new UI. Server configuration Set these independently of VERIFYETAPI_KEY: Use the actual canonical deployment origin, including www if applicable. Never include a path. http://localhost:5173 is accepted for local development. This origin is server configuration, never taken from a client or forwarded host header. In the Verify Checkout dashboard: 1. Complete the business name/logo and add an active merchant-owned receiving account. 2. Create a key with deposits:create and deposits:read scopes. 3. Register and activate the exact return origin (scheme, host and port). 4. Add https://YOURORIGIN/api/verifycheckout/webhook as the webhook endpoint. Subscribe to the default outcome events and webhook.test; all deposit.* events can also be handled. Set its signing secret on the server. 5. Send a dashboard test delivery. The receiver durably records it and returns 200, without activating a subscription. The successful test activates the endpoint. The database must support MongoDB transactions (Atlas or a replica set). Fulfillment intentionally fails and remains retryable on a standalone MongoDB server, rather than granting a subscription without an atomic payment receipt. No new package or dependency upgrade is required for the application. Reconciliation and recovery - Prices and active plans come from plan_pricing and plans, with currency ETB and the selected monthly/yearly interval. The browser never supplies a price. - An order snapshots its price, user, interval and return URL before contacting Verify. A per-customer attempt ID produces a stable idempotency key; retries replay the stored request even after a timeout or price change. The browser keeps its attempt in session storage across reloads when storage is available. - The API contract is pinned to 2026-06-01. Deposit IDs are persisted before returning a checkout URL. Only HTTPS links on checkout.verify.et/c/ are used. - Status and return routes require the signed-in owner. Anonymous accounts cannot create or inspect checkout orders. Return query parameters never authorize access. - Webhooks verify HMAC-SHA256 over the exact raw body with a 300-second timestamp tolerance, validate event headers, and deduplicate by event ID. They fetch the current deposit from Verify before fulfillment. Unlinked deposits return 503 so a delivery racing deposit creation will be retried. - Only authoritative succeeded deposits with matching ID, customer, ETB amount and currency activate a subscription. review_required and unknown states stay pending; failed, expired and cancelled deposits never activate a plan. - The deposit receipt, subscription, subscription event and fulfilled order marker commit in one transaction. A provider-specific per-user lock serializes parallel purchases. A repeated webhook or concurrent browser check cannot extend the same payment twice. API-key entitlement synchronization can retry after commit. - A still-active matching plan extends from its current period end. A different or expired plan starts now. Payments grant one month/year and do not auto-renew. The shared lifecycle used by Polar is not changed. For unattended recovery, configure an external scheduler to POST to /api/verify_checkout/reconcile every few minutes with Authorization: Bearer . The route is disabled unless that secret is set. Each request checks at most 20 unresolved orders, oldest check first, including interrupted creations and review cases. It also retries incomplete entitlement synchronization. No scheduler is enabled by this change. Failed checks return 503; provider throttling stops the batch. The return page polls with increasing intervals, honors Retry-After, and pauses after 24 checks. Review and terminal states stop automatic polling. Customers can manually check again, resume an unexpired checkout, or create a fresh attempt after a failed/expired/cancelled checkout. The support reference is displayed. Collections: verifycheckoutorders, verifycheckoutreceipts, verifycheckoutcustomers, and verifycheckoutwebhooks. Order indexes are awaited before use. Receipts and webhook events use the provider ID as MongoDB _id, providing an intrinsic unique key. Existing subscription collections are updated in their established shape. Validation For the transactional suite, point VERIFYCHECKOUTTESTMONGOURI at a disposable replica set and run: The suite creates and removes its own randomly named verifycheckouttest_* database. It mocks Verify's network responses, never calls the live payment API, and covers concurrent webhook/poll fulfillment, rollback after a failed event write, renewals, fixed yearly pricing, replay after lost responses, ownership, signature/header checks, and non-success outcomes. Without the test URI the transaction suite is skipped. A live merchant smoke test still needs configured credentials, return-origin registration and webhook activation. Provider references - Quick Start - Create a Deposit - Hosted Checkout - Webhooks - Reconciliation - OpenAPI schema The docs site's generated API reference returned an unavailable-schema placeholder during implementation; the direct OpenAPI URL above supplied the complete contract. ---