Skip to content

feat: add Requesty as a named AI provider - #588

Open
Thibaultjaigu wants to merge 1 commit into
di-sukharev:masterfrom
thibault-forks:add-requesty-provider
Open

Thibaultjaigu wants to merge 1 commit into
di-sukharev:masterfrom
thibault-forks:add-requesty-provider

Conversation

@Thibaultjaigu

Copy link
Copy Markdown

Summary

Adds Requesty as a named AI provider. Requesty is an OpenAI-compatible gateway, so RequestyEngine reuses OpenAiEngine the same way OrcaRouterEngine does. It defaults to https://router.requesty.ai/v1 and OCO_API_URL can still override it, for example https://router.eu.requesty.ai/v1 for the EU region.

Changes

  • src/engine/requesty.ts: new RequestyEngine, only sets the base URL and provider name
  • src/utils/provider.ts: OCO_AI_PROVIDER_ENUM.REQUESTY plus the API key requirement
  • src/commands/config.ts: MODEL_LIST.requesty, default and recommended model openai/gpt-4o-mini, API key URL, validators
  • src/utils/engine.ts: engine dispatch
  • src/utils/errors.ts: billing URL and recommended model
  • src/utils/modelCache.ts: fetchRequestyModels lists the managed policies (/v1/models/managed) first, then the full catalog (/v1/models), chat models only. Each list is fetched on its own so one failing does not drop the other, and it falls back to MODEL_LIST.requesty. Both endpoints work without a key, so the listing is not gated on one.
  • src/commands/setup.ts: setup picker entry "Requesty (Multiple providers)"
  • README.md: provider list and a "Use Requesty as the model gateway" section
  • test/unit/requesty.test.ts, test/unit/modelCache.test.ts, test/unit/setup.test.ts: provider coverage
  • out/cli.cjs: rebuilt bundle (a clean build of master reproduces the committed bundle byte for byte, so the bundle diff is only this change)

How to test

oco config set OCO_AI_PROVIDER=requesty OCO_API_KEY=<your_requesty_api_key>
oco config set OCO_MODEL=openai/gpt-4o-mini

Keys come from https://app.requesty.ai/api-keys.

Validation

  • npm run lint (biome + tsc --noEmit): clean
  • prettier --check on changed files: clean
  • npm test: 23 suites, 191 tests passed
  • npm run build: succeeds
  • Live: RequestyEngine.generateCommitMessage with openai/gpt-4o-mini returned 200 and a commit message (feat: add greeting to a.txt). fetchRequestyModels returned 876 models without a key and 921 with one.

Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.

Requesty is an OpenAI-compatible gateway, so RequestyEngine reuses
OpenAiEngine with the Requesty base URL (https://router.requesty.ai/v1)
by default while still allowing OCO_API_URL to override it (for example
the EU endpoint).

Registered alongside OpenRouter and OrcaRouter in the provider enum,
config validators, model list, key and billing URLs, recommended model,
engine factory, setup picker and model cache. Model discovery merges the
managed policies list with the full catalog, fetching each on its own.
Includes unit tests, README docs and the rebuilt bundle.
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