Skip to content

Spec OpenAI-compatible BYOK endpoints#9620

Open
kenrogers wants to merge 1 commit intowarpdotdev:masterfrom
kenrogers:ken/openai-compatible-byok-spec
Open

Spec OpenAI-compatible BYOK endpoints#9620
kenrogers wants to merge 1 commit intowarpdotdev:masterfrom
kenrogers:ken/openai-compatible-byok-spec

Conversation

@kenrogers
Copy link
Copy Markdown

@kenrogers kenrogers commented Apr 30, 2026

Description

Adds a draft product spec and tech spec for issue #4687: a generic OpenAI-compatible BYOK endpoint flow.

The spec frames OpenRouter as the proof case, but keeps the proposed implementation generic: provider label, base URL, API key, and model ID. That avoids a one-off provider button while still making OpenRouter, LiteLLM/internal proxies, and local OpenAI-compatible gateways possible through the same surface.

It also calls out how this relates to #9253: OpenRouter-specific BYOK is useful partial progress, but the broader issue still needs custom endpoint/model metadata instead of relying only on server-approved model choices.

Linked Issue

Fixes #4687 after approval and implementation.

  • The linked issue is labeled ready-to-spec or ready-to-implement.

Note: #4687 is currently enhancement/triaged but not ready-to-spec. I am opening this as a draft spec PR to give maintainers a concrete scope to accept, edit, or reject before any code implementation.

Screenshots / Videos

Not applicable; spec-only PR.

Testing

  • git diff --cached --check
  • git show --check --stat --oneline HEAD

No runtime tests were run because this PR only adds Markdown specs and does not change application code.

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 30, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @kenrogers on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@kenrogers
Copy link
Copy Markdown
Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 30, 2026

The cla-bot has been summoned, and re-checked this pull request!

@kenrogers kenrogers marked this pull request as ready for review April 30, 2026 16:42
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@kenrogers

I'm starting a first review of this spec-only pull request.

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds product and tech specs for a generic OpenAI-compatible BYOK endpoint flow, including Settings > AI configuration, synthetic model picker entries, and request-time endpoint metadata.

Concerns

  • The specs promise local OpenAI-compatible servers while preserving the current backend-routed BYOK architecture, which makes localhost/private endpoints ambiguous or unreachable.
  • Backend routing to arbitrary user-provided URLs needs explicit SSRF/egress controls, redirect/DNS rebinding handling, timeouts, and secret redaction rules.
  • The tech spec is ambiguous about clearing stored endpoint config when BYOK becomes disabled, which conflicts with the product spec's non-destructive gating behavior.
  • The backend request contract remains unresolved enough to block implementation handoff.

Verdict

Found: 2 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread specs/GH4687/product.md

## Summary

Users should be able to configure a custom OpenAI-compatible model endpoint for Warp Agent by entering a provider label, base URL, API key, and model ID. This gives users a narrow, predictable way to use OpenRouter, LiteLLM, internal OpenAI-compatible gateways, and local OpenAI-compatible servers without requiring Warp to add a bespoke provider integration for each one.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [CRITICAL] This promises local OpenAI-compatible servers, but the tech flow sends endpoint metadata to Warp's backend; localhost would resolve from the backend, not the user's machine. Specify client-side/local routing for local endpoints or remove local servers from the first-version scope.

Comment thread specs/GH4687/tech.md

Validation:

- Parse base URL with `url::Url`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 [CRITICAL] Syntax-only URL validation is not enough for a backend-routed arbitrary endpoint. The spec needs server-side egress rules for private/link-local/metadata IPs, redirects, DNS rebinding, timeouts, and redaction of the URL/API key from logs before implementation.

Comment thread specs/GH4687/tech.md

- On blur or Enter, persist the full config via `ApiKeyManager`.
- Empty base URL, API key, or model ID keeps the config incomplete.
- If BYOK is disabled for the workspace, clear/disable the endpoint editors using the same `UserWorkspacesEvent::TeamsChanged` handling as the fixed provider key fields.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] clear/disable conflicts with the product spec's non-destructive gating. Specify that BYOK-disabled workspaces preserve the stored custom endpoint but disable editing/selection unless the user explicitly deletes it.

Comment thread specs/GH4687/product.md
## Open questions

1. Should the first implementation support exactly one custom endpoint, or should the persistence shape support a list immediately while the UI initially exposes one?
2. Should custom endpoint metadata live in the existing `api_keys` request payload or a distinct `custom_model_endpoint` request field?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] The request contract is still an open question even though implementation depends on it. Resolve whether endpoint metadata is a distinct request field or part of ApiKeys, including versioning/backward compatibility with the backend.

@captainsafia captainsafia added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Apr 30, 2026 — with Warp Dev Github Integration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to specify the LLM endpoint (APIs) for other models

2 participants