Skip to main content
Tools that let you set a custom base URL for a chat completions API work with floprouter: set the base URL and the key, keep the rest. The SDKs below are usage examples. Two things to know first:
  • Plain chat. Tool calling is not supported, so a request that sends tools is rejected with 400. Agent modes in editors and frameworks usually send tools. Use their chat mode.
  • Slow by API standards. Replies take 15 to 50 s on devnet. Raise client timeouts to 120 s or more.

Python: the openai package

Router fields (provider, flop) go in extra_body. The flop record of the response is in reply.model_extra["flop"].

JavaScript: the openai package

In TypeScript the extra flop and provider fields are not in the SDK’s types. Add // @ts-expect-error above them, or pass the body through a variable typed as any.

LangChain

Checked against responses recorded from the live API, not with separate paid calls.

Vercel AI SDK

Use @ai-sdk/openai-compatible, which calls chat completions. The Responses API is not offered. Checked against recorded responses.

LiteLLM

Not tested against floprouter.

Editor tools and chat apps

Tools with a custom chat-completions provider setting take the base URL, key and model id above. Use chat, not agent or edit modes that depend on tool calls. Keep the output limit low, since max_tokens sizes the escrow of every request.