Repository navigation
feat(llm): add API Route gateway preset - #957
DennyHo0917 wants to merge 2 commits into
Conversation
Signed-off-by: dennyho0917 <dennyho0917@gmail.com>
zzet
left a comment
There was a problem hiding this comment.
Thanks for the clear PR and for disclosing the affiliation. The entry has the same shape as the cheaperinference preset, and provider list, provider show and the unknown-provider error pick it up with no other changes. On Go 1.27.3, go vet, the internal/llm and cmd/gortex provider tests and golangci-lint v2.14.0 all pass. The endpoint answers with OpenAI-style errors, and gpt-6.1-sol is in API Route's public model list.
Two small corrections before merge, each with a suggestion inline:
- Docs row order.
gortex provider listsorts presets by name, so theapi-routerow should come first in the gateway presets table, beforecheaperinference. - Link in the code comment.
https://www.api-route.com/en/docs/quickstartredirects to/docs/quickstart, which covers setting up Codex and Claude Code clients.https://www.api-route.com/docs/overviewdescribes the OpenAI-compatible API, which is what the comment is about.
| | `cheaperinference` | `https://api.cheaperinference.com/v1` | `gpt-5.4-mini` | `CHEAPER_INFERENCE_API_KEY` | `frontier` | | ||
| | `api-route` | `https://global.api-route.com/v1` | `gpt-6.1-sol` | `API_ROUTE_API_KEY` | `frontier` | |
There was a problem hiding this comment.
gortex provider list sorts presets by name, so the table can follow the same order:
| | `cheaperinference` | `https://api.cheaperinference.com/v1` | `gpt-5.4-mini` | `CHEAPER_INFERENCE_API_KEY` | `frontier` | | |
| | `api-route` | `https://global.api-route.com/v1` | `gpt-6.1-sol` | `API_ROUTE_API_KEY` | `frontier` | | |
| | `api-route` | `https://global.api-route.com/v1` | `gpt-6.1-sol` | `API_ROUTE_API_KEY` | `frontier` | | |
| | `cheaperinference` | `https://api.cheaperinference.com/v1` | `gpt-5.4-mini` | `CHEAPER_INFERENCE_API_KEY` | `frontier` | |
| // Preset names are deliberately not reserved: a user custom provider of | ||
| // the same name (providers.json or inline `llm.custom`) always wins. | ||
| var gatewayPresets = map[string]CustomProvider{ | ||
| // API Route (https://www.api-route.com/en/docs/quickstart) uses the |
There was a problem hiding this comment.
This URL redirects to /docs/quickstart, which is about client setup. The overview page describes the API:
| // API Route (https://www.api-route.com/en/docs/quickstart) uses the | |
| // API Route (https://www.api-route.com/docs/overview) uses the |
Signed-off-by: dennyho0917 <dennyho0917@gmail.com>
|
Thank you for the review. Both suggestions are addressed in signed commit b5b714a: the API Route row now precedes cheaperinference, matching the sorted preset list, and the code comment links to https://www.api-route.com/docs/overview. This follow-up changes only documentation and a comment; gofmt and git diff --check pass. Ready for another look. |
Summary
Add API Route as an optional OpenAI-compatible gateway preset. I am affiliated with API Route. This follows the one-entry preset approach used in #928/#929.
Changes
gatewayPresetsentry: canonical endpoint,API_ROUTE_API_KEY,gpt-6.1-sol, strict JSON schema, frontier prompt profile.Testing
go test ./internal/llm ./internal/llm/provider/openaicompatpasses.go vet ./internal/llm ./internal/llm/provider/openaicompatpasses; gofmt and diff whitespace checks pass.openaicompat.Clientusing the preset's endpoint/model/key variable: freeform andShapeExpandTermsstrict JSON-schema output both succeed withreasoning_effort: low.golangci-lint v2.14.0 run ./internal/llm ./internal/llm/provider/openaicompat: 0 issues.Checklist