Skip to content

feat(ai-providers): add Requesty as an AI provider - #3128

Open
Thibaultjaigu wants to merge 1 commit into
TableProApp:mainfrom
Thibaultjaigu:add-requesty-provider
Open

Thibaultjaigu wants to merge 1 commit into
TableProApp:mainfrom
Thibaultjaigu:add-requesty-provider

Conversation

@Thibaultjaigu

Copy link
Copy Markdown

Adds Requesty, an OpenAI-compatible LLM router, as an AI provider. It is wired exactly like OpenRouter and goes through the same OpenAICompatibleProvider transport, so there is no new client code.

Changes

  • AIModels.swift: new requesty case on AIProviderType, placed after openRouter, with display name, default endpoint https://router.requesty.ai (resolves to /v1/chat/completions and /v1/models) and the arrow.triangle.branch symbol. Auth and endpoint style fall through to the defaults OpenRouter uses (API key, chat completions).
  • AIProviderRegistration.swift: .requesty added to the OpenAI-compatible family loop next to .openRouter, so it gets the same capabilities (chat, models, reasoning, images, configurable Base URL, max output tokens, model list fetch).
  • Tests: .requesty added to the HTTP API-key provider capability test, and an endpoint resolution case next to the OpenRouter one.
  • docs/security/privacy.mdx: router.requesty.ai added to the list of preset endpoints.
  • CHANGELOG.md: entry under Unreleased, Added.

It is not the default provider and is only used when picked from Add Provider.

How to test

  1. Settings > AI > Add Provider > Requesty.
  2. Paste a key from https://app.requesty.ai/api-keys (the key is sent as Authorization: Bearer).
  3. Pick a model from the fetched list or type one, for example openai/gpt-4o-mini or anthropic/claude-sonnet-4-5, then Test Connection.
  4. EU routing: set the Base URL to https://router.eu.requesty.ai.

Checks

  • swiftlint lint --strict on the four touched Swift files: clean.
  • docs/scripts checks (writing style, docs against source, links): all pass.
  • Not built locally: this machine has no Xcode, only the Command Line Tools with Swift 5.10, so I could not run xcodebuild build or the test target. I did a manual compile review instead: the three exhaustive switches over AIProviderType (displayName, defaultEndpoint, symbolName) each get a .requesty arm, authStyle and endpointStyle keep their default: arms, and no other switch names openRouter. AIProviderCapabilitiesTests.everyTypeHasDescriptor and AIEndpointTests.resolvesEveryDefaultEndpoint cover the new case through allCases.
  • Live check: I compiled OpenAICompatibleProvider.swift unchanged together with AIModels.swift, AIEndpoint.swift and the chat wire types it depends on into a small command line harness, built an AIProviderConfig(type: .requesty, model: "openai/gpt-4o-mini") and used its endpoint. fetchAvailableModels() returned 762 models, testConnection() returned true, and streamChat streamed a reply with usage (14 input, 4 output tokens).

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

@datlechin

Copy link
Copy Markdown
Member

Hi @Thibaultjaigu, thanks for the contribution. Why we don't just use the OpenAI Compatible provider instead of creating new providers?

@Thibaultjaigu

Copy link
Copy Markdown
Author

Fair question. Custom works for Requesty today, so this is only about setup, and the delta is small. It is the same footprint as the OpenRouter entry and reuses OpenAICompatibleProvider, no new transport code:

  1. It shows up by name with its own icon in Add Provider…, with https://router.requesty.ai prefilled, so nobody has to look up the base URL.
  2. The key is required, like OpenRouter. Custom treats it as optional, and our /v1/models answers without a key, so on Custom a keyless setup saves and fills the model picker, then the first chat gets a 401. With the preset, Save stays disabled until a key is there.
  3. The host is listed in privacy.mdx next to the other presets.

It does not add pricing, curated models or extra headers. I checked the requests the app builds against the live API: GET /v1/models returns the OpenAI list shape (about 780 models), streaming /v1/chat/completions works, a bad key gets a 403, and the EU endpoint https://router.eu.requesty.ai works the same if you edit the endpoint field.

I also rebased onto main (v0.76.0) and moved the changelog line under Unreleased.

If you would rather keep the provider list short, that is fine too: I can close this and send a docs PR instead, with a row in ai-assistant.mdx showing Requesty through Add Custom Provider… with https://router.requesty.ai/v1.

This branch has not been deployed

No deployments
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.

2 participants