feat: Add AIMLAPI provider support to AI plugins#12379
Conversation
Introduced AIMLAPI as a supported provider in ai-proxy, ai-request-rewrite, and related schema and documentation. Added a new driver for AIMLAPI, updated provider enums, and clarified documentation to reflect AIMLAPI integration.
There was a problem hiding this comment.
Need to add test cases to verify the provider aimlapi, such as https://github.com/apache/apisix/blob/master/t/plugin/ai-request-rewrite.t#L241.
If you are not familiar with test nginx, you can also use ts to complete the test. You can refer to https://github.com/apache/apisix/blob/master/t/plugin/mcp/bridge.spec.ts
If you have problems running the test locally, you can refer to this document to build the environment https://github.com/apache/apisix/blob/master/docs/en/latest/build-apisix-dev-environment-devcontainers.md
Introduces a new test case to verify schema validation when using the 'aimlapi' provider with authorization header in the ai-request-rewrite plugin.
|
@Baoyuantop Thanks for the note! Test cases for Relevant test output: |
|
Hi @D1m7asis, there is a code lint error that needs to be fixed. |
Reformatted the 'provider' enum lists in ai-proxy/schema.lua and ai-request-rewrite.lua to use multi-line arrays for improved readability and maintainability. No functional changes were made.
|
Hi @D1m7asis, there is also a code lint error that needs to be fixed. |
|
Sorry, didn’t notice that earlier - fixed the style issue in ai-request-rewrite.t Let me know if anything else needs adjustment 🙌 |
Baoyuantop
left a comment
There was a problem hiding this comment.
I tried it and it works.
|
@Baoyuantop @membphis @bzp2010 If that sounds interesting, please send the responsible person's email to [email protected] |
Description
This PR adds AIMLAPI as a supported provider to the
ai-proxy,ai-proxy-multi, andai-request-rewriteplugins in Apache APISIX. AIMLAPI provides a unified OpenAI-compatible API with access to 300+ LLMs such as GPT-4, Claude, Gemini, DeepSeek, and others.Motivation
AIMLAPI is used by over 150,000 developers and organizations as a centralized LLM API gateway. It supports OpenAI-compatible request formats and offers strong uptime, competitive pricing, and access to a wide variety of models. This change enables APISIX users to easily route and proxy requests through AIMLAPI without needing custom drivers or overrides.
What's Changed
✅ Added a new OpenAI-compatible driver:
aimlapi.lua✅ Updated
providerenums in:ai-proxyschemaai-request-rewriteschemaai-proxy-multischema✅ Updated documentation to reflect AIMLAPI as an officially supported provider
✅ Clarified examples, usage, and endpoint behavior for AIMLAPI
✅ Confirmed backwards compatibility and fallback behavior
Test Screenshots:


Which issue(s) this PR fixes:
#12289 — new provider integration
Checklist