Vercel AI Gateway 把 Baseten 的两个决策模型 Mammoth-1、Elephant-1 放到免费档,changelog 写明免费到 2026 年 10 月 27 日。模型名是 baseten/mammoth-1 和 baseten/elephant-1。2026 年 10 月 23 日早上拉了一遍公开模型列表,两条的 pricing.input、pricing.output 都是 "0"。
依据是 Vercel 10 月 21 日的 changelog Baseten's Mammoth-1 and Elephant-1 now available on AI Gateway for free,调用方式写在 Decision 文档里。条款和价表是 10 月 23 日对着 changelog、文档和 GET https://ai-gateway.vercel.sh/v1/models 核的。
限免窗口和模型规格
changelog 原文是 “Free access is available through October 27”,并写了 “for free on AI Gateway for one week”。Mammoth-1 是 27B,Elephant-1 是 9B,上下文都是 16k。它们回答的是 Choice、Boolean、Score 这类带概率的结构化问题,不是自由文本生成。文档里写,决策请求不走 Chat Completions、Responses,也不走 Anthropic、Cohere 兼容接口,要走 POST /v1/evaluate,或者 OpenAI 兼容的 POST /v1/decisions。
当天公开模型列表里,两条相关记录是这样的:
[
{
"id": "baseten/mammoth-1",
"type": "evaluation",
"pricing": {
"input": "0",
"output": "0"
},
"context_window": 16384
},
{
"id": "baseten/elephant-1",
"type": "evaluation",
"pricing": {
"input": "0",
"output": "0"
},
"context_window": 16384
}
]
changelog 举例里用的是 AI SDK 的 decide,HTTP 侧则是 /v1/evaluate,请求体带 model、state、questions。鉴权文档写的是 AI Gateway API Key,或者 Vercel OIDC token,放在 Authorization: Bearer ... 里。
用 Spring Boot 调 /v1/evaluate
Spring Boot 4.1.1、JDK 21,依赖只用 web 和 restclient。Key 从环境变量读:
ai.gateway.api-key=${AI_GATEWAY_API_KEY:}
ai.gateway.model=baseten/mammoth-1
server.port=8080
package com.example.decide;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestClient;
@Component
public class DecideClient {
public record EvaluateRequest(String model, String state, Map<String, Question> questions) {}
public record Question(String type, String instructions) {}
private final RestClient restClient;
private final String model;
public DecideClient(RestClient.Builder builder,
@Value("${ai.gateway.api-key}") String apiKey,
@Value("${ai.gateway.model}") String model) {
RestClient.Builder b = builder.baseUrl("https://ai-gateway.vercel.sh");
if (!apiKey.isBlank()) {
b = b.defaultHeader("Authorization", "Bearer " + apiKey);
}
this.restClient = b.build();
this.model = model;
}
public String evaluate(String state, String instructions) {
EvaluateRequest body = new EvaluateRequest(
model,
state,
Map.of("refund", new Question("boolean", instructions)));
return restClient.post()
.uri("/v1/evaluate")
.contentType(MediaType.APPLICATION_JSON)
.body(body)
.retrieve()
.body(String.class);
}
}
控制器把网关返回的状态码和响应体原样透出来:
@RestController
public class DecideController {
private final DecideClient client;
public DecideController(DecideClient client) {
this.client = client;
}
@GetMapping("/decide")
public ResponseEntity<?> decide(
@RequestParam(defaultValue = "I was charged twice. Please refund the duplicate.") String state) {
try {
return ResponseEntity.ok(client.evaluate(state, "Is the customer asking for a refund?"));
} catch (HttpStatusCodeException e) {
return ResponseEntity.status(e.getStatusCode()).body(e.getResponseBodyAsString());
}
}
}
Maven 打包日志里有 BUILD SUCCESS,结束时间是 2026-10-23T08:05:42+08:00。随后启动到 8080:
2026-10-23T08:05:51.416+08:00 INFO ... o.s.boot.tomcat.TomcatWebServer : Tomcat started on port 8080 (http) with context path '/'
2026-10-23T08:05:51.424+08:00 INFO ... com.example.decide.DecideApplication : Started DecideApplication in 1.351 seconds (process running for 1.793)
这次没有可用的 AI Gateway Key,请求是真发到网关的,但没有拿到决策结果。不设 AI_GATEWAY_API_KEY,以及填一个假 Key,访问本地 /decide 时网关都回:
{"error":{"message":"Authentication failed","param":null,"type":"authentication_error"}}
HTTP 401
文档示例里成功响应大致是这样(取自 Decision 文档,模型名按示例保留):
{
"model": "typesafe-ai/jev",
"answers": { "refund": { "type": "boolean", "probability": 0.98 } },
"usage": { "inputTokens": 275, "outputTokens": 20 }
}
前几天写过 AI Gateway 上 MiniMax M3.1 Flash 限免,那条走 Chat Completions,而且限免日已经到了。这次是决策模型,接口换成 /v1/evaluate。更早还有 LangChain4j 接 OpenAI Decisions,形状接近,只是模型换成 Baseten 这两条免费档。
一起交流
分享你的思考,让讨论更进一步。