Skip to content

bug: OpenAI Compatible Provider incorrectly validates Endpoint Base URL #27980

Description

@Waltibaba

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

problem

When adding a provider under Admin -> AI -> Providers -> OpenAI-compatible, entering a valid and DNS discoverable domain is blocked in the frontend with the message "Endpoint must be a valid URL".
Neither the Documentation for the AI Providers API nor the related codersdk.CreateAIProviderRequest schema defines this validation requirement.

The setup is using the docker-compose from the example, the provider is an openai-compatible API local inference provider LocalAI, with the attempted base URL "http://localai:8080/v1" (though with or without /v1 makes no difference).
This is especially strange since the default postgres DB in your example docker compose is also found in docker internal DNS the exact same way with the FQDN "http://database:5432", so this frontend limitation is completely arbitrary.

proposal

Stop letting the frontend unnecessarily and incorrectly validate the base URL. This is an admin UI, you shouldn't be expecting bad actors in it anyway, and especially if you were, frontend validation doesn't work. You get your validation for free when trying to run inference anyway (i.e. it fails with provider API not reachable).

Relevant Log Output

$ docker compose exec coder ping localai -c 1
PING localai (172.24.0.2): 56 data bytes
64 bytes from 172.24.0.2: seq=0 ttl=42 time=0.067 ms

--- localai ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.067/0.067/0.067 ms
=========================================================
docker compose exec coder coder --version
Coder v2.36.0+a300a06 Tue Aug  4 10:11:09 UTC 2026
https://github.com/coder/coder/commit/a300a06a0da0dced695ef8df8404c7c4dffd337e

Full build of Coder, supports the  server  subcommand.

Expected Behavior

A valid, reachable, openai-compatible inference host URL should be allowed to be set.

Steps to Reproduce

  1. set up docker-compose based coder config as per instructions
  2. add coder container to a docker network with an openai-compatible inference API (in my example, URL is "http://localai:8080/v1/")
  3. after coder setup, try to add the agent provider per your documentation
  4. be unable to add since the valid URL (e.g. "http://localai:8080/v1") is rejected as invalid by the admin settings frontend

Environment

  • Host OS: Debian 11
  • Coder version: v2.36.0+a300a06
    (using docker image)

Additional Context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions