Skip to content

With OPENAI_BASE_URL set, models that need the Responses API fail with tools #891

Closed

Description

@mxmzb

What happens

With OPENAI_BASE_URL set to any host that is not OpenAI's or Azure's (a proxy, a gateway, a logging relay), the CopilotKit runtime uses Chat Completions for openai/... models:

[CopilotKit] OPENAI_BASE_URL is not an OpenAI or Azure host, so "openai/..." models use the Chat Completions API. To use the Responses API instead, set COPILOTKIT_OPENAI_API=responses.

Models from gpt-5.6 onward reject function tools on Chat Completions, so every Bot run with tools fails:

Function tools with reasoning_effort are not supported for gpt-6.1-terra in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.

OpenBot already knows which models need the Responses API: requiresResponsesApi(model) in shared/model-providers.ts.

Suggested fix

When OPENAI_BASE_URL is set and requiresResponsesApi(model) is true for the Bots' model, set COPILOTKIT_OPENAI_API=responses for the runtime (unless the operator set it), or refuse at startup with a sentence naming the setting. Document both settings next to OPENAI_BASE_URL.

Activity

  1. added
    enhancement
    on Oct 29, 2026
  2. linear-code commented on Oct 29, 2026

    @linear-code
  3. LofiSu commented on Oct 31, 2026

    @LofiSu

    This matches what we hit when routing openai/... models through a non-OpenAI OPENAI_BASE_URL gateway.

    requiresResponsesApi(model) already knows which models need /v1/responses, but the runtime still falls back to Chat Completions whenever the base URL is not OpenAI/Azure — so tool-using Bots on gpt-5.6+ fail even though the gateway itself supports Responses.

    Auto-setting COPILOTKIT_OPENAI_API=responses when requiresResponsesApi(model) is true (unless the operator already set it), or failing fast at startup with that env name in the message, would remove a whole class of "tools suddenly broken behind a proxy" reports. Documenting both knobs next to OPENAI_BASE_URL would help operators who intentionally stay on Chat Completions.

    Happy to test a patch against a logging/proxy base URL if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions