crater-openai
crater-openai
OpenAI-to-ActivityPub/ForgeFed translator. ActivityPub plumbing (actor documents, inbox/outbox, HTTP signatures, WebFinger, NodeInfo, delivery) is provided by aptok; this gateway is the OpenAI-side adapter that translates /v1/chat/completions and /v1/responses into Create{Ticket} activities and back.
Endpoints
OpenAI:
POST /v1/chat/completionsPOST /v1/responsesGET /v1/models— preset aliases (auto,smallest,lowprice,balanced,fastest,highest,longcontext,local) plus discovered followers (<model>-<provider>).GET /v1/models/:idGET /health
ActivityPub (served by the embedded Aptok::Federation):
GET /actor/:identifier— Service actor for a preset or followerPOST /actor/:identifier/inbox— per-actor inbox (Create / Update / …)GET /actor/:identifier/outboxPOST /inbox— shared inboxGET /.well-known/webfingerGET /.well-known/nodeinfo,GET /nodeinfo/2.1
Config
The runtime config lives in crater-openai.config.rcl (RCL). Per-provider ForgeFed inbox/actor/target are set on each provider "..." block; the ENV variables below are cross-cutting knobs.
Local actor key (used to sign outbound POSTs)
The gateway signs delivery via aptok's ActorKeyPair. aptok will not derive a public key from the private one — both must be provided.
CRATER_LOCAL_KEY_ID—keyIdURI written into theSignatureheader, e.g.https://crapi.example.com/actor/auto#main-keyCRATER_LOCAL_ACTOR— owner URI of the keyCRATER_LOCAL_PRIVATE_KEY_PEM— path to the private key PEM fileCRATER_LOCAL_PRIVATE_KEY_INLINE_PEM— inline PEM (alternative to the file path, useful with Docker / k8s secrets)CRATER_LOCAL_PUBLIC_KEY_PEM— inline PEM of the public keyCRATER_LOCAL_PUBLIC_KEY_PATH— path to the public key PEM file (alternative to inline)CRATER_LOCAL_KEY_ALGORITHM—rsa-sha256(default) ored25519
Signing is disabled silently when any of keyId / actor / one of the key sources is missing.
Public origin (used when minting actor URIs)
CRATER_PUBLIC_BASE_URL— authoritative override, e.g.https://crapi.example.com. When absent, the gateway falls back toX-Forwarded-Host+X-Forwarded-Proto, then the requestHost.
Legacy per-request ForgeFed delivery (deprecated)
These are kept for callers that haven't moved to RCL providers yet. They're still accepted but provide no signing or queue behavior:
CRATER_FORGEFED_INBOX/X-Forgefed-InboxCRATER_FORGEFED_ACTOR/X-Forgefed-ActorCRATER_FORGEFED_TARGET/X-Forgefed-Target
Run
cd crater-openai
shards install
crystal run src/main.cr
OpenCode setup
Use opencode.json as a provider template for local usage. Default URL targets this service at http://127.0.0.1:3000/v1.
crater-openai
- 0
- 0
- 0
- 0
- 4
- 1 day ago
- March 7, 2026
Thu, 11 Jun 2026 08:45:22 GMT