Skip to content

connect: ai& is a provider of its own, asked for a key and nothing else - #1736

Closed
fenilmodi00 wants to merge 1 commit into
Agent-Field:devfrom
fenilmodi00:aiand-provider
Closed

fenilmodi00 wants to merge 1 commit into
Agent-Field:devfrom
fenilmodi00:aiand-provider

Conversation

@fenilmodi00

Copy link
Copy Markdown

ai& is now a provider of its own. It is asked for a key and nothing else — no region, no plan door, no second question.

What is now true

ai& appears in the providers group in /connect, in codeaf connect aiand, and on the Providers tab in /settings. It asks for your key, lists its models, and moves the conversation onto one of them at once the way every other provider does.

aiand is connected · 13 models is the shape of the receipt — with the count being whatever answered that day, because the list is organised by organisation and moves as the vendor adds and retires them.

It reaches models from several labs behind one key, so a person who would otherwise open four accounts opens one. Models are picked by hand from /model; nothing here chooses one for a task or plans a crew around them.

The whole change is one row, plus what that row exposed

internal/modelsource/modelsource.go gains a single Source. Everything else follows from it: the connect panel, the providers group, the picker group, the Providers tab and codeaf connect are all derived from the vendored catalog.

Config.Direct already switches off the router's lane sheet, its generation-receipt fetch, its price ceiling and its routing vocabulary (internal/provider/client.go:258, receipt.go:169, velocity.go:284), so internal/provider needed no change and a direct vendor remains a base-URL swap. internal/session needed none either — clientdoor.go keys its adapter pool on the resolved connection. internal/taxonomy needed none: a 402 is already classified by paymentrefusal's generic rule.

Two facts the catalog alone does not give

ai& is the first connection here that is itself a router. Its ids already name the lab — zai-org/glm-5.3, deepseek-ai/deepseek-v4.1-flash. crewVendors maps a connection to the catalog's vendor words, because that is what the router weighs (internal/config/crew.go:791), and the catalog says deepseek/ and z-ai/ where ai& says deepseek-ai/ and zai-org/. So crewVendorWire carries that rename on the send.

This is not a tidiness fix. Asked on 2026-10-02:

bare  deepseek-v4-flash            → 404 model_not_found
bare  glm-5.3-flash                → 404 model_not_found
bare  kimi-k3                      → 404 model_not_found
      deepseek-ai/deepseek-v4-flash → 200
      zai-org/glm-5.3-flash         → 200

Without the rename every crew seat on ai& would 404. Moonshot and Codex are absent from the table, so their sends are byte-identical to before.

Two of ai&'s seven organisations are carried by no connected provider. motif-technologies is unknown to this catalog; google is a vendor word the catalog knows while no connection serves it. Both are still pickable by hand. The manual says so rather than implying coverage.

The one-door claim is deliberate

Nothing on the wire separates a plan from metered credit — the same host, bearer, model and request spend the balance either way. That is MiniMax's position, and the row says so in the same terms: a money label codeaf cannot check is worse than none. A 402 insufficient_credits is the balance speaking, not a bad key, and the existing refusal path already words it correctly.

Verified against the live API on 2026-10-02

The listing, a streamed reply with its usage frame, tool calling, max_tokens, stream_options.include_usage, the OpenAI /responses and Anthropic /messages surfaces, ephemeral cache breakpoints, the refusal of an unlisted reasoning_effort, and the refusal of a bare model name.

One thing recorded because the docs imply otherwise: X-Cost is named in access-control-expose-headers and never sent on a 200, streamed or not. A direct provider's cost cannot be read off a response here, so this change claims none.

Also unverified, and said so in the entry: whether cache_control actually caches on a repeat call, and a real 402 (needs an empty wallet).

Tests

internal/modelsource's two index-coupled laws updated. The Ollama KeyOptional check was reading rows[6] by position — inserting any row before it failed with only Ollama may omit its key. It now looks the row up by id, so the next provider is free.

New: a mutation-checked crew-send test, an aiand case in TestEveryOneDoorServiceKeepsItsHostAndBearer, and TestTheClientDoorReachesAiandWithItsBareVendorSlug — which proves the wire slug is the bare zai-org/glm-5.3 and not aiand/zai-org/glm-5.3, and that the direct vendor is asked for the chat road and nothing else.

Known limits, stated rather than hidden

  • ai&'s model list is org-scoped and dynamic. motif-technologies and google models are pickable by hand but unroutable by crew.
  • The manual's new section couples to three fields in another package (Preferred, Listing: ListingModels, empty Regions). If any moves, that page is wrong.
  • crewVendorWire carries two spellings that are a table of facts from one day's listing. A future ai& change to either is a one-line edit there.

make pr-ready is green. Two internal/session timing tests fail on the branch and are attributed away by the classifier because they fail identically on the base commit — they are #1664 ("the 40ms check-clock cut"), untouched by this change. Full suites and the tmux e2e were not run locally; CI runs them on the way to staging.

ai& (api.aiand.com) is a Japan-hosted, OpenAI- and Anthropic-compatible
inference service selling one prepaid credit per token. Its list reaches
models from several labs at once, so one key covers what would otherwise take
four accounts.

It needed exactly one row in modelsource.Vendored() and the rest of the
product follows from that one fact: the connect panel, the providers group,
the picker group, the Providers tab and `codeaf connect aiand` are all
derived from the vendored catalog. Config.Direct already switches off the
router's lane sheet, generation-receipt fetch, price ceiling and routing
vocabulary, so the provider layer needed no change and a direct vendor
stays a base-URL swap. internal/session needed none either — clientdoor.go
keys its adapter pool on the resolved connection.

TWO FACTS THE CATALOG ALONE DOES NOT GIVE.

ai& is the first connection here that is itself a router: its ids already
name the lab (`zai-org/glm-5.3`, `deepseek-ai/deepseek-v4.1-flash`), so a
send is the provider segment over the vendor's own id. crewVendors maps a
connection to the CATALOG's vendor words, because that is what the router
weighs — but the catalog says `deepseek/` and `z-ai/` where ai& says
`deepseek-ai/` and `zai-org/`. crewVendorWire carries that rename on the
send. It is not a tidiness fix: a bare name was asked for on 2026-10-02 and
answered 404 model_not_found for deepseek-v4-flash, glm-5.3-flash and
kimi-k3, while the qualified ids answered 200.

The same listing means `motif-technologies` and `google` are organisations no
connected provider carries, so crew routing reaches neither. They are still
pickable by hand, and the manual says so rather than implying coverage.

The one-door claim is deliberate and says why in the row: nothing on the wire
separates a plan from metered credit, which is MiniMax's position too. A
402 insufficient_credits is already read correctly by paymentrefusal's
generic 402 rule.

Verified live against the API on 2026-10-02: the listing, a streamed reply
with its usage frame, tool calling, `max_tokens`, `stream_options`, and the
refusal of a bare model name. Also observed and recorded because the docs
imply otherwise: X-Cost is advertised in access-control-expose-headers and
never sent, so a direct provider's cost cannot be read off a response.
@CLAassistant

CLAassistant commented Oct 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@santoshkumarradha

Copy link
Copy Markdown
Member

Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it?

@fenilmodi00 fenilmodi00 closed this Oct 2, 2026
@fenilmodi00
fenilmodi00 deleted the aiand-provider branch October 2, 2026 04:20
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.

3 participants