Files
hearth/package/affine-chatgpt/README.md
T
yukkop 50c4efc09b
runner nix smoke / nix label and flake smoke (push) Failing after 1m12s
gpt in affine
2026-11-01 11:21:28 +00:00

42 lines
2.2 KiB
Markdown

# affine-chatgpt
Local ChatGPT OAuth enrollment companion and minimal OpenAI Responses gateway
for AFFiNE. It supports sign-in, safe status inspection, visible-model listing,
text Responses, and client-executed function/custom tools. Gateway runs in
foreground and has no login or administration HTTP endpoints.
```sh
affine-chatgpt login
affine-chatgpt status
affine-chatgpt models
affine-chatgpt serve --gateway-key-file /run/keys/affine-chatgpt
```
`login` binds only `127.0.0.1:1455` (override with `--port`) before printing a
public authorization URL. Open that URL in a local browser and personally
approve access. State defaults to `~/.local/state/affine-chatgpt`; override it
with `--state-dir`. Files are owner-only and must never be copied into the Nix
store, source control, logs, or shared AFFiNE configuration.
`serve` binds `127.0.0.1:3012` by default (`--host` and `--port` override it).
Gateway key file is required, must contain at least 32 characters, and must be
an owner-only regular file. Every `/v1/models` and `/v1/responses` request
requires `Authorization: Bearer <gateway-key>`. `/healthz` returns only generic
readiness. Configure AFFiNE for Responses dialect and choose one of models
returned by `/v1/models`; gateway does not select or invent default model.
Incoming Responses requests are reduced to preview-compatible fields and sent
upstream with `store:false`, `stream:true`, and complete array input history.
Streaming callers receive official SSE events unchanged. Non-stream callers
receive actual terminal completed Response JSON, including text, function
calls, and usage. AFFiNE executes tools and returns `function_call_output` in
next request; gateway never executes tools.
OAuth plan usage remains preview functionality. Supported inputs are text
messages, function-call history/output, and necessary reasoning history.
Function/custom tools are grouped in Responses namespaces. Unsupported:
images/media, files, audio, image generation, file search, Code Interpreter,
hosted MCP/connectors, conversations, background mode, persistent response
continuation, and Chat Completions conversion. No billing fallback exists.
A successful login/model listing does not prove inference entitlement.