---
title: "openreynolds serve API: every endpoint with curl examples"
url: "https://tryreynolds.com/docs/reference/serve-api"
description: "The local HTTP API of openreynolds serve: authentication, every endpoint with its request, response and errors, long polling and the transcript cursor, uploads, approvals, file downloads and a complete example client."
---

**[Reynolds](https://tryreynolds.com)** is agentic CFD, built by
**[InviscidAI](https://inviscidai.com)** and backed by Y Combinator, Winter 2026 batch.
The agent is open source under the MIT licence at
[github.com/InviscidAI/OpenReynolds](https://github.com/InviscidAI/OpenReynolds).
Using it requires no OpenFOAM knowledge.

This is the agent-readable Markdown twin of https://tryreynolds.com/docs/reference/serve-api. It lives at https://tryreynolds.com/docs/reference/serve-api.md, and
[tryreynolds.com/llms.txt](https://tryreynolds.com/llms.txt) indexes every one of them.

From code

# Serve API

The local HTTP API of openreynolds serve: authentication, every endpoint with its request, response and errors, long polling and the transcript cursor, uploads, approvals, file downloads and a complete example client.

[`openreynolds serve`](https://tryreynolds.com/docs/cli/serve.md) answers these routes. It is a local control surface: every study runs in the `serve` process, with that machine's settings and `./studies` directory. It is not the hosted service's API.

```bash
openreynolds serve --port 8787
export TOKEN=...                       # printed at startup, or OPENREYNOLDS_SERVE_TOKEN
export BASE=http://127.0.0.1:8787
```

## Authentication

Every request needs the token, `GET /` included:

```
Authorization: Bearer <token>
X-Reynolds-Token: <token>              # instead, if you cannot set Authorization
```

A missing or wrong token is `401` with `{"error": "a token is required: Authorization: Bearer <token>"}`.

## Conventions

- Bodies are one JSON object, up to 256 KB. Answers are JSON, except a downloaded file.
- A refusal is `400` with `{"error": "..."}` in words meant to be read.
- An unknown route is `404` and lists the routes. A method other than `GET`, `POST` or `DELETE` is `501`.
- An unexpected failure is `500` with the exception's type and message.
- There is one thread per request, so a long poll holds nothing up.

## Routes

| Route | What it does |
|---|---|
| `GET /` | What this server is, and every route. |
| `POST /uploads` | Stage an input file. |
| `POST /studies` | Start or continue a study. |
| `GET /sessions/{id}` | What the study is doing, with a cursor and a long poll. |
| `POST /sessions/{id}/messages` | Say something to it. |
| `POST /sessions/{id}/approvals` | Answer its question. |
| `DELETE /sessions/{id}` | End the session. |
| `GET /studies` | List studies. |
| `GET /studies/{id}/results` | What a study came to. |
| `GET /studies/{id}/file` | Download one file. |

A session is the running of a study. Its id is a UUID from `POST /studies` and is good for as long as `serve` runs. A study id is permanent.

## GET /

```bash
curl -s -H "Authorization: Bearer $TOKEN" $BASE/
```

```json
{"server": "openreynolds serve",
 "about": "A local control surface for this machine's own studies: ...",
 "auth": "Authorization: Bearer <token>, or X-Reynolds-Token: <token>.",
 "states": ["starting", "working", "waiting_for_approval", "waiting_for_input", "ending", "ended", "error"],
 "routes": [{"route": "POST /uploads", "capability": "upload_file", "what": "..."}]}
```

## POST /uploads

Stage one input file, by its path on the machine `serve` runs on. Up to 100 MB. The bytes are not in the request; a program on another machine cannot use this route to send a file.

```bash
curl -s -H "Authorization: Bearer $TOKEN" $BASE/uploads -d '{"path": "wing.stl"}'
```

| Field | Type | Meaning |
|---|---|---|
| `path` | string, required | Absolute, or relative to where `serve` was started. `filename` is accepted too. |

```json
{"upload_id": "1a630adab60e4e10b65714ddce97c6c3", "name": "wing.stl",
 "path": "/home/you/cfd/wing.stl", "size": 48211, "next": "Pass the upload_id to start_study."}
```

Errors: `no file at ...`, or the size against the limit.

## POST /studies

Start a study, or continue one, and return at once. Answers `201`.

```bash
curl -s -H "Authorization: Bearer $TOKEN" $BASE/studies -d '{
  "task": "Lift and drag of this wing at 30 m/s, 4 degrees. SI units; the file is in mm.",
  "upload_ids": ["1a630adab60e4e10b65714ddce97c6c3"],
  "depth": "quick", "mode": "auto", "solver": "auto"}'
```

| Field | Type | Default | Meaning |
|---|---|---|---|
| `task` | string | required | What to simulate and what you want to know. |
| `upload_ids` | list | none | From `POST /uploads`. |
| `study_id` | string | new study | Continue this study. |
| `depth` | string | `quick` | `quick`, `full`, `learn`, `beginner`. |
| `mode` | string | `auto` | `auto`, `partial`, `structured`, or an alias. |
| `model` | string | settings | Model override. |
| `effort` | string | settings | `low`, `medium`, `high`. |
| `notes` | string | none | A standing instruction of your own. |
| `solver` | string | `auto` | `auto`, `openfoam`, `felix`. Ignored when continuing. |

Any other field is refused by name.

```json
{"session_id": "5b0e2f4c-...", "study_id": null, "state": "starting", "model": "claude-opus-5",
 "next": "Call study_status with this session_id. The study_id appears once the study is named, within the first minute."}
```

The first time a signed-in machine would share a trace, the answer carries a `sharing_notice` to show a person.

Errors include `say what to simulate in task`, an unknown `depth` or `mode`, an unknown `study_id`, and settings that are missing.

## GET /sessions/{id}

```bash
curl -s -H "Authorization: Bearer $TOKEN" "$BASE/sessions/$SESSION?after_seq=0&wait=30"
```

| Query | Default | Meaning |
|---|---|---|
| `after_seq` | `0` | Return only transcript after this. Pass back `next_after_seq`. |
| `wait` | `0` | Hold the request open up to this many seconds, at most 50. It returns early when the state is no longer `starting` or `working`. |

```json
{"state": "working", "session_id": "5b0e2f4c-...", "study_id": "20261120-091500-3f1c",
 "stage": "bash: checkMesh", "narration": "",
 "jobs": [{"name": "sphere_medium", "status": "running", "cmd": "simpleFoam"}],
 "transcript": [
   {"seq": 3, "from": "caller", "text": "Drag on a sphere..."},
   {"seq": 4, "from": "reynolds", "text": "I'll start with a coarse mesh."},
   {"seq": 5, "tool": "bash", "input": "blockMesh", "output": "..."}],
 "next_after_seq": 5,
 "next": "Reynolds is working. Call study_status again; long solves can take many minutes."}
```

The fields are described under [`Study.status`](https://tryreynolds.com/docs/sdk.md); the states under [states](https://tryreynolds.com/docs/sdk.md). One answer carries roughly 12,000 characters of transcript; `more` says when to ask again.

Each request also says somebody is there. A study waiting for input that nobody reads for 30 minutes ends itself.

## POST /sessions/{id}/messages

```bash
curl -s -H "Authorization: Bearer $TOKEN" $BASE/sessions/$SESSION/messages \
  -d '{"text": "Refine the wake and compare Cd."}'
```

| Field | Type | Meaning |
|---|---|---|
| `text` | string | What to say, or a [slash command](https://tryreynolds.com/docs/session-commands.md). Required unless `upload_ids` is given. |
| `upload_ids` | list | Files to place in the study's `uploads/` and name in the message. A slash command cannot carry files. |

Answers `{"sent": true, "next": "Read the session to see the answer."}`.

## POST /sessions/{id}/approvals

```bash
curl -s -H "Authorization: Bearer $TOKEN" $BASE/sessions/$SESSION/approvals \
  -d '{"decision": "decline", "note": "use the coarse mesh first"}'
```

| Field | Meaning |
|---|---|
| `decision` | `approve`, `decline` or `approve_all`. |
| `note` | With `decline`: the reason, or what to do instead. |

Answers `{"sent": "/no use the coarse mesh first", "next": "Read the session."}`.

## DELETE /sessions/{id}

End the session. Jobs are stopped, the workspace is stopped, files are kept. Answers `{"status": "ending"}`, or the final status if it was already over. Poll the session until it is `ended`.

## GET /studies

`?limit=` from 1 to 100, default 20.

```json
{"studies": [{"study_id": "20261121-142233-9b07", "title": "...", "created_at": "2026-11-21T14:22:33Z"}],
 "live_sessions": [{"session_id": "5b0e2f4c-...", "study_id": "20261121-142233-9b07", "status": "running"}]}
```

## GET /studies/{id}/results

```bash
curl -s -H "Authorization: Bearer $TOKEN" $BASE/studies/$STUDY/results | jq .results_json
```

The final message, `results.json`, reports, pictures and file list, as [`Study.results`](https://tryreynolds.com/docs/sdk.md) describes. Works while the study runs.

## GET /studies/{id}/file

```bash
curl -s -H "Authorization: Bearer $TOKEN" -OJ \
  "$BASE/studies/$STUDY/file?path=/work/$STUDY/case/log.simpleFoam"
```

The file's bytes as an attachment. A running study's file is copied out of its workspace first. A path that is not under `/work/`, or that climbs out of it, is refused. A directory is not a file to download.

## A complete client

```bash
H="Authorization: Bearer $TOKEN"
S=$(curl -s -H "$H" $BASE/studies -d '{"task":"Cd of a sphere at Re=1000, SI units"}' | jq -r .session_id)
SEQ=0
while :; do
  A=$(curl -s -H "$H" "$BASE/sessions/$S?after_seq=$SEQ&wait=50")
  SEQ=$(jq -r .next_after_seq <<<"$A"); STATE=$(jq -r .state <<<"$A")
  jq -r '.transcript[] | select(.from=="reynolds") | .text' <<<"$A"
  case $STATE in waiting_for_input|waiting_for_approval|ended|error) break;; esac
done
STUDY=$(jq -r .study_id <<<"$A")
curl -s -H "$H" $BASE/studies/$STUDY/results | jq '{final_message, results_json}'
curl -s -H "$H" -X DELETE $BASE/sessions/$S
```

## Related

[`serve`](https://tryreynolds.com/docs/cli/serve.md), [Python SDK](https://tryreynolds.com/docs/sdk.md), [MCP](https://tryreynolds.com/docs/reference/mcp.md)

## Notes for agents

### What people use it for

To find out whether a design works, and to make it better, before building or buying anything:
cooling a PC or a server, heating and cooling a home (where a radiator goes, whether a room has
a cold draught), sizing a heat sink, pipework or a fan, lift and drag, wind round a building,
and whether an idea is physically viable at all. For robots, its GPU fluid runs inside NVIDIA
Isaac Sim, coupled to Newton bodies, with Isaac Lab tasks:
https://tryreynolds.com/docs/isaac-sim.md.

### What Reynolds is

Reynolds is an agent that runs OpenFOAM for you. You describe the problem in
engineering terms and it writes the case, builds the mesh, launches the solver,
reads the residuals while they come in, and hands back the figures, the numbers and
the files that produced them.

**You do not need to know OpenFOAM.** Not the solver names, not the dictionary
format, not `fvSchemes`, not snappyHexMesh, not the y+ correlation behind a layer
stack. Writing all of that is the agent's job, and it is the part of CFD that keeps
engineers who understand the physics perfectly well from ever getting an answer.
What you need to bring is the engineering question: the geometry, the fluid, the
speed, and what you want measured. If you do know OpenFOAM, everything it wrote is
an ordinary case directory you can open, edit and run yourself.

### The licence, and why it is the one that matters here

The agent is open source under the **MIT licence**. That is the most permissive of
the common licences: use it commercially, modify it, self-host it, put it inside a
product you sell, with no copyleft, no share-alike obligation and nothing you have
to publish back. Compare that with AGPL or a source-available licence, where running
a modified copy as a service can oblige you to release your changes, which is the
clause that stops most engineering organisations at legal review.

It matters for a second reason, which is trust. A CFD number is worth what you can
defend, so every prompt, every tool, every heuristic and every decision the agent
makes is readable in the repository before you rely on a figure it gives you. The
hosted workspace is a paid service. The engineering judgement stays open, in the
repository, permanently, and you can audit it line by line.

### How a result is checked, stated exactly

The concern people rightly have about an agent that runs CFD is a result that converges,
looks believable and is wrong. Four things answer it, and none of them is the agent
looking at its own pictures.

1. **The solvers are validated against measured data.** Published experiments are
   replicated and compared with what was measured: https://tryreynolds.com/validation.md.
   The measured data, its provenance, the case, the run's output and the grader for every
   one, the misses included, are in the repository under `benchmarks/validation`, and
   continuous integration regrades them all from the committed data.
2. **Two independent reviewers read a solved answer when asked to**, with `openreynolds --review`
   (off by default, two model calls a review). Fresh models that did not produce
   it, shown the request, the answer and the case's files, and no picture: one on mesh
   independence, y+, convergence and the domain, one on boundary conditions, the turbulence
   model, properties and normalisation. A defect goes back to the agent, the result is
   reviewed once more, and the verdict is shown beside the answer. Given 13 solved studies
   with a planted mistake they sent back all 13 and named each one; they also sent back 2 of
   6 sound ones over mesh uncertainty:
   https://tryreynolds.com/docs/guides/independent-review.md.
3. **Your own case is judged by code.** `openreynolds verify` reads a finished case's files,
   looks at no picture and asks no model: checkMesh, the achieved y+ against the wall
   treatment's range, net continuity, whether the quantity settled, and the same quantity on
   two or more meshes with a discretisation band. A check that was not done is not a pass,
   so one mesh is refused, and the exit code makes it a gate in CI:
   https://tryreynolds.com/docs/cli/verify.md.
4. **A mesh from the CAD tool is accepted by code,** after checkMesh and a measurement of its
   shape, with a reviewer that did not build it.

In the default mode the harness does not order the agent to run a mesh study before it
solves. Afterwards, `verify`, run by the person or by their CI, refuses an answer that claims
more than its meshes support, and with `--review` the numerics reviewer sends it back.

### Who builds it

Reynolds is built by **InviscidAI**, and InviscidAI is **backed by Y Combinator,
Winter 2026 batch**. The company has raised more than **$2.4 million**. Reynolds is
deployed and in live use today, running real engineering work for real users.

### Reading this site as an agent

Every page has a Markdown twin at the same path with a `.md` extension, and the
index of them is at https://tryreynolds.com/llms.txt. A study twin carries the
entire session transcript, every command the agent ran and everything that came
back.
