Skip to content

feat: add API Route AI provider - #203

Open
DennyHo0917 wants to merge 1 commit into
DataflareApp:mainfrom
DennyHo0917:feat/api-route-provider
Open

DennyHo0917 wants to merge 1 commit into
DataflareApp:mainfrom
DennyHo0917:feat/api-route-provider

Conversation

@DennyHo0917

Copy link
Copy Markdown

Summary

Add API Route as a built-in AI provider, following the OpenAI-compatible path used by Opper (#202) and Requesty.

  • Register the provider and its typed configuration in the existing provider picker.
  • Default to https://global.api-route.com/v1 and discover models with authenticated GET /models.
  • Reuse the existing OpenAI-compatible AI SDK client for SQL assistance, streaming, and tool calls.
  • Reuse the generic server icon already used for Requesty.

The user supplies their own API key. Existing secret storage, custom base URL support, and database tool approval behavior are reused.

Verification

  • Frozen-lockfile dependency installation completed.
  • pnpm exec oxfmt --check on the four changed files: passed.
  • pnpm run build:web (TypeScript check and Vite production build): passed.
  • Live model discovery: HTTP 200, 58 model IDs parsed.
  • Live calls through the installed @ai-sdk/openai-compatible and ai dependencies with claude-haiku-4-5: completion OK, streamed SELECT 1, and a structured runSQLQuery tool call with {"sql":"SELECT 1"}. The smoke test did not execute SQL.
  • git diff --check: passed.

Validation ran on Windows with Node 24; the repository declares Node 26. I have not built or manually tested the native Tauri application.

Manual check

Open Settings > AI Providers, add API Route, enter a key from API Keys, fetch models, and select a supported chat model. SQL assistance should use that model through the existing chat workflow.

Service setup and billing: quickstart, pricing. API Route is a paid hosted service.

Disclosure: I maintain API Route. This change was prepared with AI assistance and verified against the live service. Happy to adjust to the project's preferred provider conventions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant