[Feature]: Add cheapaimodel provider
Pre-submission Checklist
- [x] I have searched existing issues and discussions
- [x] I have read the documentation
- [x] This is a feature request, not a bug report
Problem Statement
CLIO has no built-in provider for cheapaimodel. cheapaimodel is an OpenAI-compatible model gateway: one API key for DeepSeek, Z.ai GLM, Moonshot Kimi and xAI Grok models, billed per token from a prepaid USD balance. Today a user must set it up as a custom endpoint by hand.
Disclosure: I work on cheapaimodel.
Proposed Solution
Add cheapaimodel as an OpenAI-compatible provider, the same way as Opper (#36) and Cheaper Inference (#39).
api_base:https://api.cheapaimodel.ai/v1/chat/completions- Auth: API key,
Authorization: Bearer <key> - Tools and streaming: yes
- Model list:
GET https://api.cheapaimodel.ai/v1/models(needs the key); public catalog at https://cheapaimodel.ai/models - Default model:
deepseek-v4-1-flash - Model ids are bare names:
deepseek-v4-1-flash,glm-5.3,glm-5.3-flash,grok-4.7,kimi-k3. kimi-k3only acceptstemperature1 or 0.6 andtop_p0.95; this goes in docs/PROVIDERS.md.
Which area would this affect?
API / Provider Integration
Alternatives Considered
A custom endpoint works, but each user must enter the URL and the model limits by hand.
Examples / References
- Docs: https://cheapaimodel.ai/docs
- Opper provider: #36, Cheaper Inference provider: #39
Would you be willing to contribute?
Yes, I'd like to implement this. The change is ready and tested; I'll open the PR right after this issue.
Automated Triage Summary
| Field | Value |
|---|---|
| Classification | enhancement |
| Priority | medium |
| Completeness | 95% |
Analysis: Valid, well-formed feature request: add a 'cheapaimodel' OpenAI-compatible gateway provider. Disclosed vendor affiliation (author works on cheapaimodel), which is fine for a provider-integration feature. The codebase has a proven pattern from the nearly identical Cheaper Inference provider (PR #39, commit 4579f452): a registry entry in lib/CLIO/Providers.pm plus provider-mapping.json/provider-defaults.json entries and two unit-test updates. The proposed kimi-k3 sampling-parameter restrictions belong in docs/PROVIDERS.md like the other provider quirks. Reporter has a tested PR ready - maintainers should review that PR against the cheaperinference precedent.
Root Cause Analysis
Confidence: high
Relevant files:
lib/CLIO/Providers.pmlib/CLIO/Core/model-data/provider-defaults.jsonlib/CLIO/Core/model-data/provider-mapping.jsontests/unit/test_providers_flags.pltests/unit/test_openai_compatible_mcm_url.pldocs/PROVIDERS.md
Relevant functions:
provider registry entry (Providers.pm %PROVIDERS hash)
Not a bug - a feature request following an established integration pattern. The provider registry in lib/CLIO/Providers.pm already has the template for this: the 'cheaperinference' entry (added via PR #39, merged in commit 4579f452) is an OpenAI-compatible gateway with api_base pointing at /v1/chat/completions, apikey auth, supports_tools/streaming, bare model ids, and a url_detection_patterns regex. Adding 'cheapaimodel' follows the same recipe: a registry entry, provider-mapping.json and provider-defaults.json entries, updates to test_providers_flags.pl (the CLOUD_NAMES list and max_context_tokens case) and test_openai_compatible_mcm_url.pl (models URL derivation), plus docs/PROVIDERS.md documenting the kimi-k3 temperature (1 or 0.6) and top_p (0.95) restrictions. Note: I did not verify the upstream API endpoints at cheapaimodel.ai; the PR should demonstrate the /v1/models listing works with a key.
Affected Areas
- lib/CLIO/Providers.pm
- lib/CLIO/Core/model-data/
- tests/unit/test_providers_flags.pl
- tests/unit/test_openai_compatible_mcm_url.pl
- docs/PROVIDERS.md
This is an automated analysis. A maintainer will review shortly.