#AINFT API Integration Issue - HTTP 404
1 messages · Page 1 of 1 (latest)
Yep — with api: "openai-completions" OpenClaw assumes an OpenAI-compatible base URL and will always hit:
POST <baseUrl>/chat/completions
So if AINFT’s API is only:
POST https://chat.ainft.com/webapi/chat/openai(per their docs:POST https://chat.ainft.com/webapi/chat/{provider})
…then it’s not OpenAI-compatible at the URL/path level, and OpenClaw can’t talk to it directly today (there’s currently no config knob to override the /chat/completions suffix for openai-completions providers).
Practical workaround (works if payload/response are OpenAI-chat-compatible)
Put a tiny reverse-proxy in front that exposes an OpenAI-style endpoint and rewrites the path:
- Expose:
http://localhost:PORT/v1/chat/completions - Forward to:
https://chat.ainft.com/webapi/chat/openai
Then configure OpenClaw to use the proxy:
{
models: {
mode: "merge",
providers: {
ainft: {
baseUrl: "http://127.0.0.1:9999/v1",
apiKey: "AINFT_KEY",
api: "openai-completions",
models: [{ id: "whatever-ainft-model-id-is", name: "AINFT" }],
},
},
},
}
If AINFT’s response/streaming format differs from OpenAI’s, the proxy would also need to translate responses — but if your curl body is truly “OpenAI chat completions-like”, path-rewrite alone might be enough.