Skip to main content

ChangeX HTTP/REST API: a thin FastAPI wrapper over the changex-core spine so any app or model — local/offline LLMs, or a ChatGPT custom GPT Action consuming /openapi.json — can open, edit, save, and review tracked Word documents over HTTP.

Project description

changex-api

A thin HTTP/REST API over the ChangeX core spine, so any app or model can drive provenance-first tracked editing of Word documents over plain HTTP — a local/offline LLM with no function-calling, a curl script, or a ChatGPT custom GPT Action that imports the auto-generated OpenAPI schema.

It wraps changex-core and reuses the exact MCP tool semantics (changex-mcp): an op discriminator selects one small intent, the exact before substring is always carried so blind overwrites are refused, and an oversized op is rejected so the model splits the change.

Run

# install (workspace) and launch on 127.0.0.1:8000
uv sync
changex-api                     # or: python -m changex_api
# custom bind / port:
changex-api --host 0.0.0.0 --port 9000   # non-local host REQUIRES a token:
CHANGEX_API_TOKEN=secret changex-api --host 0.0.0.0

Bind is 127.0.0.1 by default. A non-local host is refused unless CHANGEX_API_TOKEN is set; when it is, every non-/healthz route requires Authorization: Bearer <token>.

Endpoints

Method & path Purpose
POST /sessions Open a .docx for tracked editing (returns a handle).
GET /sessions/{handle}/outline Bounded, paginated paragraph outline (discover node_ids).
POST /sessions/{handle}/edit One small, intent-named tracked edit.
POST /sessions/{handle}/save Write the native-revisions .docx + .changex journal.
GET /sessions/{handle}/changes The structured provenance journal.
POST /open Passive (no-tool-calling) capture: snapshot a docx.
POST /seal Diff the edited docx vs the baseline; append passive ops.
POST /report Render an HTML/markdown redline (by handle or .changex path).
GET /healthz Liveness probe (never requires auth).

OpenAPI / function-calling schemas

FastAPI serves the schema at /openapi.json — that file IS the ChatGPT custom GPT Action schema; point a GPT's Action import at it. Static copies plus OpenAI/Gemini function-calling schemas live in the repo's integrations/:

  • integrations/openapi.json — the dumped OpenAPI 3.1 schema (ChatGPT Actions).
  • integrations/openai-functions.json — OpenAI tools format.
  • integrations/gemini-functions.json — Gemini functionDeclarations format.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

changex_api-0.1.18.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

changex_api-0.1.18-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file changex_api-0.1.18.tar.gz.

File metadata

  • Download URL: changex_api-0.1.18.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for changex_api-0.1.18.tar.gz
Algorithm Hash digest
SHA256 2b3c1319dedcc871bede52e2b9d856b74f62d973763e0fc7068420bf8a39fb1e
MD5 4694b7f5d96ca0f6462bf6c1f9eb516b
BLAKE2b-256 304804f50d4018ad2aed450d635a56080ce1b4c1a17ec1fef0ba4e128dc1fc70

See more details on using hashes here.

File details

Details for the file changex_api-0.1.18-py3-none-any.whl.

File metadata

  • Download URL: changex_api-0.1.18-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for changex_api-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 eb7c6c12c9c187405faa9b7dc1f6db76f2121f8d975f719f80263fa086d2c497
MD5 9082b10fcf7c4f070b9ff6f80082f299
BLAKE2b-256 46da7f8c0acc4eb7b28acd682a96a815d2c6e9faf3e039f5117eb3728c4f2e9f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page