feat: Add OpenAI-compatible provider nodes

- Support multiple OpenAI-compatible providers with custom prefix/baseUrl
- Add provider nodes CRUD (create/read/update/delete)
- URL building: baseUrl + /chat/completions or /responses
- Model import from /models endpoint
- API key validation via /models
- Usage type safety across all translators
- OAuth token auto-refresh for expired tokens
This commit is contained in:
decolua
2026-02-02 19:45:12 +07:00
parent 1b14c9d66b
commit 0a28f9f924
25 changed files with 1276 additions and 151 deletions

View File

@@ -31,7 +31,10 @@ export async function POST(request) {
};
// Build URL and headers using provider service
const url = buildProviderUrl(provider, body.model || "test-model", true, { baseUrlIndex: 0 });
const url = buildProviderUrl(provider, body.model || "test-model", true, {
baseUrlIndex: 0,
baseUrl: connection.providerSpecificData?.baseUrl
});
console.log("🚀 ~ POST ~ url:", url)
const headers = buildProviderHeaders(provider, credentials, true, body);
console.log("🚀 ~ POST ~ headers:", headers)

View File

@@ -91,7 +91,10 @@ export async function POST(request) {
};
// Build URL and headers
const url = buildProviderUrl(provider, model, true, { baseUrlIndex: 0 });
const url = buildProviderUrl(provider, model, true, {
baseUrlIndex: 0,
baseUrl: connection.providerSpecificData?.baseUrl
});
const headers = buildProviderHeaders(provider, credentials, true, actualBody);
result = {