qwen3.6-35b-a3b. AI Gateway is in beta with pay-per-token billing.
Prerequisites
- Node.js 22.13.0 or newer
- A SaladCloud account, credits, and an organization-specific AI Gateway API key from Pay-Per-Token Onboarding
Step 1: Install the Packages
In a new project directory:@mastra/core version 1.47.0; this guide uses the newer 1.67.0 release line. See
Mastra’s AI SDK 7 support documentation.
Step 2: Set Your API Key
Create.env:
.env to .gitignore. Keep this key server-side and do not use your regular SaladCloud API key in its place. The
SaladCloud provider supplies the Gateway endpoint and Bearer authentication automatically.
Step 3: Create the Agent
Createagent.js:
agent.js
Pass the model object returned by
saladCloud(...). Do not replace it with the string salad-cloud/qwen3.6-35b-a3b:
the models.dev listing does not currently add SaladCloud to Mastra’s built-in model registry. This direct SDK setup
does not depend on that registry.Step 4: Generate a Response
Createtest.js:
test.js
Stream a Response
Createstream.js:
stream.js
Troubleshooting
- Unknown provider or model: use
saladCloud('qwen3.6-35b-a3b')as shown, not a model-router string. - Unsupported model version: upgrade
@mastra/coreto the version range above. The SaladCloud0.2.0package uses the AI SDK 7 provider interface. - Missing API key or HTTP 401: check that
.envcontainsSALAD_CLOUD_API_KEY, run Node with--env-file=.env, and use your organization’s AI Gateway key.