Repository navigation
feat(llm): add 88API as a native LLM provider - #327
Open
blackdm666 wants to merge 1 commit into
Open
blackdm666 wants to merge 1 commit into
blackdm666 wants to merge 1 commit into
Conversation
88API (https://88api.ai/v1) is an OpenAI-compatible multi-model gateway: one key calls GPT, Claude, Gemini, DeepSeek, Grok, MiniMax and more. Users previously had to configure it through the Custom provider. - LLMProvider.API88 ("api88"), API88_API_KEY / API88_BASE_URL / API88_MODEL, default claude-sonnet-5-5 with claude-haiku-5-5 fallback - settings schema option and fields, env examples, README provider row - skip response_format json_object for claude-* models on 88API, which Anthropic rejects (same approach as AtlasCloud) - unit tests for config mapping, selection, normalization, request shape Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: blackdm666 <blackdm666@users.noreply.github.com>
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds 88API as a native LLM provider, next to OpenRouter and AtlasCloud. 88API is an OpenAI-compatible gateway (
https://88api.ai/v1): one key can call GPT, Claude, Gemini, DeepSeek, Grok, MiniMax and other models. Until now users had to go through the Custom provider and fill in the URL, key and model by hand. With this change they pick 88API in the provider list and paste their key.It also fills a gap in the presets: none of the existing presets serves Claude models directly. The 88API default model is
claude-sonnet-5-5, withclaude-haiku-5-5as the static fallback.Changes
The provider follows the existing provider pattern. It goes through
_call_openai_compatiblelike DeepSeek, Grok and AtlasCloud, and adds no new request code path.app/services/llm.pyLLMProvider.API88 = "api88". Enum member names and shell env var names can't start with a digit, so the identifier isapi88everywhere:LLM_PROVIDER=api88,API88_*env vars, theapi88config section and the settingsgroup. Because of that, the generic{value.upper()}_BASE_URL/_MODELlookups and the "please setAPI88_API_KEY" error work without special cases.PROVIDER_CONFIGSentry: base URLhttps://88api.ai/v1, defaultclaude-sonnet-5-5, fallbackclaude-haiku-5-5.api88/and88api/model prefixes resolve to this provider and get stripped (88API model ids have no vendor prefix).88API API <status>, like the existing AtlasCloud/OpenRouter labels.app/config/api_keys.py:API88_API_KEY(env first, then addon config, same as the other keys).app/utils/config_loader.py:API88_API_KEY/API88_BASE_URL/API88_MODELmappings.app/routes/settings.py:88API (Multi-model gateway)option in theLLM_PROVIDERselect, plus key / model / base-URL fields in theapi88group.API88_BASE_URLgoes in the Advanced tab with the other base URLs..env.example,backend_api_python/env.example: commented 88API block.README.md,README_CN.md: 88API added to the AI providers row.No frontend change should be needed: the provider dropdown and its fields come from the settings schema. The default provider is still
openrouter.How to test
cd backend_api_python python -m pytest tests/test_llm_litellm_provider.py tests/test_settings_llm_connection.py -qNew unit tests in
tests/test_llm_litellm_provider.pycover:Manual check against the live endpoint:
Results
python -m pytest -m "not integration and not stress": 3867 passed, 37 skipped.ruff checkon all changed Python files passes.https://88api.ai/v1throughLLMService.call_llm_api(JSON mode on, the default for analysis calls). All 56 text models on 88API returned valid JSON:stream_llm_apistreams correctly for one model from each of the 9 vendor families.test_connection()passes with a valid key.One finding from the live run shaped the code: Anthropic rejects
response_format: {"type": "json_object"}with a 400 ("use text or json_schema"). So when the request goes to 88API and the model id starts withclaude,_call_openai_compatibleleaves that field out. This is the same approach already used for AtlasCloud. The prompts still ask for JSON, and all Claude models returned valid JSON in the live run. Other 88API models keep JSON mode.Backward compatibility
The change only adds things. No existing provider, default or env var changes, and no trading, execution or risk code is touched.
🤖 Generated with Claude Code