From e57913f5a6474337aca9d71deb1538c7066a779c Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 1 Oct 2026 22:09:57 -0500 Subject: [PATCH 01/19] feat(ai): add native Vercel AI Gateway language models --- packages/ai/README.md | 47 ++- packages/ai/src/cache-policy.ts | 6 + .../src/protocols/utils/gateway-protocol.ts | 104 ++++++ .../providers/vercel-ai-gateway-options.ts | 68 ++++ .../ai/src/providers/vercel-ai-gateway.ts | 244 +++++++++++++- .../src/providers/vercel-ai-gateway/chat.ts | 2 + .../providers/vercel-ai-gateway/messages.ts | 2 + .../providers/vercel-ai-gateway/responses.ts | 2 + ...-caches-distinct-claude-system-blocks.json | 49 +++ ...inues-chat-claude-reasoning-and-tools.json | 49 +++ ...s-messages-claude-reasoning-and-tools.json | 49 +++ ...s-messages-gemini-reasoning-and-tools.json | 49 +++ ...ues-responses-gpt-reasoning-and-tools.json | 49 +++ ...es-responses-grok-reasoning-and-tools.json | 49 +++ ...es-responses-muse-reasoning-and-tools.json | 49 +++ ...ials-without-retryable-classification.json | 31 ++ .../vercel-ai-gateway.types.ts | 32 ++ .../vercel-ai-gateway.recorded.test.ts | 108 ++++++ .../test/provider/vercel-ai-gateway.test.ts | 317 ++++++++++++++++++ 19 files changed, 1300 insertions(+), 6 deletions(-) create mode 100644 packages/ai/src/protocols/utils/gateway-protocol.ts create mode 100644 packages/ai/src/providers/vercel-ai-gateway-options.ts create mode 100644 packages/ai/src/providers/vercel-ai-gateway/chat.ts create mode 100644 packages/ai/src/providers/vercel-ai-gateway/messages.ts create mode 100644 packages/ai/src/providers/vercel-ai-gateway/responses.ts create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json create mode 100644 packages/ai/test/provider-options/vercel-ai-gateway.types.ts create mode 100644 packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts create mode 100644 packages/ai/test/provider/vercel-ai-gateway.test.ts diff --git a/packages/ai/README.md b/packages/ai/README.md index cf8b6bcd3600..42c591e3fbe3 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1283,7 +1283,52 @@ const gateway = CloudflareAIGateway.configure({ }).model("workers-ai/@cf/meta/llama-3.1-8b-instruct") ``` -Included LLM providers: OpenAI, Anthropic, Google (Gemini), Google Vertex, Amazon Bedrock, Azure OpenAI, Baseten, Cerebras, Cohere, Cloudflare AI Gateway, Cloudflare Workers AI, DeepInfra, DeepSeek, Fireworks, Groq, Mistral, OpenRouter, TogetherAI, and xAI. Z.ai currently exposes image generation. Generic Chat Completions, Responses, and Anthropic Messages-compatible entrypoints support custom endpoints. +Included LLM providers: OpenAI, Anthropic, Google (Gemini), Google Vertex, Amazon Bedrock, Azure OpenAI, Baseten, Cerebras, Cohere, Cloudflare AI Gateway, Cloudflare Workers AI, DeepInfra, DeepSeek, Fireworks, Groq, Mistral, OpenRouter, TogetherAI, Vercel AI Gateway, and xAI. Z.ai currently exposes image generation. Generic Chat Completions, Responses, and Anthropic Messages-compatible entrypoints support custom endpoints. + +### Vercel AI Gateway + +Gateway supports Messages, Responses, and Chat directly, without the AI SDK transport: + +```ts +import { VercelAIGateway } from "@opencode/ai/providers" + +const gateway = VercelAIGateway.configure({ + // Optional: otherwise reads AI_GATEWAY_API_KEY, then VERCEL_OIDC_TOKEN. + apiKey, + providerOptions: { + gateway: { only: ["anthropic", "bedrock"], caching: "auto" }, + }, +}) + +gateway.model("anthropic/claude-sonnet-4.6") // Messages +gateway.model("openai/gpt-5-nano") // Responses +gateway.model("meta/muse-spark-1.3") // Responses +gateway.model("xai/grok-4.1-fast-reasoning") // Responses +gateway.chat("anthropic/claude-sonnet-4.6") // Explicit Chat override +gateway.responses("google/gemini-2.5-flash") // Explicit Responses override +gateway.messages("openai/gpt-5-nano") // Explicit Messages override +``` + +Default routing sends `openai/gpt-*`, `meta/muse-*`, and `xai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. + +Set request `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. Choose values the selected model supports; the Gateway may translate effort across upstreams. Older Claude models may require budget-based thinking instead of adaptive thinking. + +```ts +LLM.request({ + model: gateway.messages("anthropic/claude-sonnet-4.6"), + prompt: "Review this algorithm.", + generation: { maxTokens: 4096 }, + providerOptions: { thinking: { type: "enabled", budgetTokens: 2048 } }, +}) +``` + +Messages and Chat expose `thinking` for on/off or token-budget controls. Responses uses `reasoningEffort` and `reasoningSummary`; native upstream controls can be passed as `upstream: { google: { thinkingConfig: ... } }`, etc. A budget translated by Gateway is **not** necessarily a hard reasoning-token cap. Explicit upstream options may override shared settings. + +Gateway controls live under `providerOptions.gateway`: routing `only`/`order`/`sort`, fallback `models`, `byok`, `providerTimeouts`, `zeroDataRetention`, regional inference, and usage tags/user. Upstream options live under `providerOptions.upstream` and lower into the original provider namespaces on the wire. + +Automatic Gateway caching is enabled by default. Request `cache: "none"` suppresses that default, but does not disable upstream implicit caching or manually placed cache hints. Messages preserves distinct system blocks and explicit hints. Responses additionally exposes `cacheTTL` and `cacheAnchorItems` (wire input-item count, not canonical message count). `promptCacheKey` supplies session affinity and the supported OpenAI-style cache-key field. + +Gateway routing, cost, and warnings are retained on terminal events' `providerMetadata.gateway`. Reasoning signatures and encrypted state remain on the corresponding content parts for replay. Existing experimental evaluation remains available. These language-model routes currently use HTTP/SSE; Gateway WebSocket, native compaction, and additional media modalities are not exposed by this facade yet. Each named provider owns its module, endpoint, authentication, and route setup. Providers with the same wire format compose the shared protocol directly: diff --git a/packages/ai/src/cache-policy.ts b/packages/ai/src/cache-policy.ts index dc2340559cad..11439b5be162 100644 --- a/packages/ai/src/cache-policy.ts +++ b/packages/ai/src/cache-policy.ts @@ -52,6 +52,8 @@ const RESPECTS_INLINE_HINTS = new Set([ "bedrock-converse", "openrouter", "digitalocean", + "vercel-ai-gateway-messages", + "vercel-ai-gateway-chat", ]) // OpenRouter upstreams other than Anthropic and Alibaba Qwen cache without breakpoints. Gemini uses only the last @@ -171,6 +173,10 @@ const countHints = (request: LLMRequest) => export const applyCachePolicy = (request: LLMRequest): LLMRequest => { if (!RESPECTS_INLINE_HINTS.has(request.model.route.id)) return request + // Gateway owns automatic marker placement. Only place our own breakpoints when the caller + // explicitly selects a policy, avoiding competing automatic breakpoint budgets. + if (request.model.provider === "vercel-ai-gateway" && (request.cache === undefined || request.cache === "auto")) + return request const policy = request.model.route.id === "openrouter" && (request.cache === undefined || request.cache === "auto") ? openRouterPolicy(request.model.id) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts new file mode 100644 index 000000000000..0eb9fe928686 --- /dev/null +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -0,0 +1,104 @@ +import { Effect, Schema } from "effect" +import { Protocol } from "../../route/protocol.js" +import { LLMEvent, ProviderMetadata, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" +import { ProviderShared } from "../shared.js" + +const MetadataFields = { + provider_metadata: Schema.optional(ProviderMetadata), + providerMetadata: Schema.optional(ProviderMetadata), +} +const Envelope = Schema.StructWithRest(Schema.Struct(MetadataFields), [Schema.Record(Schema.String, Schema.Unknown)]) +const Event = Schema.StructWithRest( + Schema.Struct({ + ...MetadataFields, + message: Schema.optional(Envelope), + response: Schema.optional(Envelope), + choices: Schema.optional( + Schema.Array( + Schema.StructWithRest(Schema.Struct({ delta: Schema.optional(Envelope) }), [ + Schema.Record(Schema.String, Schema.Unknown), + ]), + ), + ), + }), + [Schema.Record(Schema.String, Schema.Unknown)], +) + +/** Retain gateway accounting/routing metadata without replacing the upstream parser's replay metadata. */ +export function gatewayProtocol( + protocol: Protocol, + input: { + readonly id: string + readonly from: (request: LLMRequest) => Effect.Effect, AIError> + }, +) { + const decode = Schema.decodeUnknownEffect(protocol.stream.event) + const initial = (request: LLMRequest) => ({ + inner: protocol.stream.initial(request), + metadata: undefined as ProviderMetadata | undefined, + }) + const onHalt = protocol.stream.onHalt + const merge = (...items: ReadonlyArray): ProviderMetadata | undefined => { + const defined = items.filter((item) => item !== undefined) + if (defined.length === 0) return undefined + return Object.fromEntries( + Array.from(new Set(defined.flatMap((item) => Object.keys(item)))).map((key) => [ + key, + mergeJsonRecords(...defined.map((item) => item[key])) ?? {}, + ]), + ) + } + const enrich = (events: ReadonlyArray, metadata: ProviderMetadata | undefined) => + events.map((event) => + LLMEvent.is.finish(event) || LLMEvent.is.stepFinish(event) + ? { ...event, providerMetadata: merge(event.providerMetadata, metadata) } + : event, + ) + return Protocol.make({ + id: input.id, + body: { + schema: Schema.Record(Schema.String, Schema.Unknown), + from: input.from, + }, + sanitizer: protocol.sanitizer, + // Gateway feature support is verified separately; do not inherit upstream-only chronological effort updates. + stream: { + event: Schema.Union([Schema.Literal("[DONE]"), Protocol.jsonEvent(Event)]), + initial, + step: Effect.fn("GatewayProtocol.step")(function* ( + state: ReturnType, + event: typeof Event.Type | "[DONE]", + ) { + const decoded = yield* decode(event === "[DONE]" ? event : ProviderShared.encodeJson(event)).pipe( + Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", undefined, cause)), + ) + const metadata = + event === "[DONE]" + ? state.metadata + : merge( + state.metadata, + event.provider_metadata, + event.providerMetadata, + event.message?.provider_metadata, + event.message?.providerMetadata, + event.response?.provider_metadata, + event.response?.providerMetadata, + ...(event.choices ?? []).flatMap((choice) => [ + choice.delta?.provider_metadata, + choice.delta?.providerMetadata, + ]), + ) + const result = yield* protocol.stream.step(state.inner, decoded) + return [{ inner: result[0], metadata }, enrich(result[1], metadata)] as const + }), + terminal: (event) => + event === "[DONE]" || + event.type === "response.completed" || + event.type === "response.incomplete" || + event.type === "response.failed", + onHalt: onHalt + ? (state) => onHalt(state.inner).pipe(Effect.map((events) => enrich(events, state.metadata))) + : undefined, + }, + }) +} diff --git a/packages/ai/src/providers/vercel-ai-gateway-options.ts b/packages/ai/src/providers/vercel-ai-gateway-options.ts new file mode 100644 index 000000000000..1fda48533e82 --- /dev/null +++ b/packages/ai/src/providers/vercel-ai-gateway-options.ts @@ -0,0 +1,68 @@ +import { Schema } from "effect" +import type { AnthropicMessages } from "../protocols/anthropic-messages.js" +import { ReasoningEffort } from "../schema/index.js" +import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js" + +/** Gateway routing controls are independent of the selected wire API. */ +const Credential = Schema.StructWithRest( + Schema.Struct({ + apiKey: Schema.optional(Schema.String), + resourceName: Schema.optional(Schema.String), + accessKeyId: Schema.optional(Schema.String), + secretAccessKey: Schema.optional(Schema.String), + region: Schema.optional(Schema.String), + project: Schema.optional(Schema.String), + location: Schema.optional(Schema.String), + googleCredentials: Schema.optional(Schema.Struct({ privateKey: Schema.String, clientEmail: Schema.String })), + modelMappings: Schema.optional( + Schema.Array(Schema.Struct({ gatewayModelSlug: Schema.String, customModelId: Schema.String })), + ), + }), + [Schema.Record(Schema.String, Schema.Unknown)], +) + +export const GatewayOptions = Schema.StructWithRest( + Schema.Struct({ + caching: Schema.optional(Schema.Literal("auto")), + only: Schema.optional(Schema.Array(Schema.String)), + order: Schema.optional(Schema.Array(Schema.String)), + sort: Schema.optional(Schema.String), + models: Schema.optional(Schema.Array(Schema.String)), + zeroDataRetention: Schema.optional(Schema.Boolean), + user: Schema.optional(Schema.String), + tags: Schema.optional(Schema.Array(Schema.String)), + byok: Schema.optional(Schema.Record(Schema.String, Schema.Array(Credential))), + inferenceRegion: Schema.optional(Schema.String), + providerTimeouts: Schema.optional( + Schema.Struct({ + byok: Schema.optional( + Schema.Record(Schema.String, Schema.Int.check(Schema.isBetween({ minimum: 1000, maximum: 789000 }))), + ), + }), + ), + }), + [Schema.Record(Schema.String, Schema.Unknown)], +) +export type GatewayOptions = typeof GatewayOptions.Type + +export const Options = Schema.Struct({ + gateway: Schema.optional(GatewayOptions), + upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), + reasoningEffort: Schema.optional(ReasoningEffort), + effort: Schema.optional(ReasoningEffort), + cacheTTL: Schema.optional(Schema.Literals(["5m", "1h"])), + cacheAnchorItems: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))), +}) + +export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & + Pick & { + readonly gateway?: GatewayOptions + /** AI SDK upstream settings, forwarded under their original provider namespace. */ + readonly upstream?: Readonly>>> + /** Responses automatic-cache lifetime; not the lifetime of manually marked blocks. */ + readonly cacheTTL?: "5m" | "1h" + /** Responses input-item count, not a canonical message count. */ + readonly cacheAnchorItems?: number + } + +export * as VercelAIGatewayOptions from "./vercel-ai-gateway-options.js" diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index c435c8e1295c..d4ea64de7585 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -10,6 +10,19 @@ import { } from "../experimental/evaluation.js" import { Auth } from "../route/auth.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" +import { Route, type RouteDefaultsInput } from "../route/client.js" +import { Endpoint } from "../route/endpoint.js" +import { AnthropicMessages } from "../protocols/anthropic-messages.js" +import { OpenAIResponses } from "../protocols/openai-responses.js" +import { MetaResponses } from "../protocols/meta-responses.js" +import { XAIResponses } from "../protocols/xai-responses.js" +import { OpenResponses } from "../protocols/open-responses.js" +import { OpenAIChat } from "../protocols/openai-chat.js" +import { cacheControl } from "../protocols/utils/cache.js" +import { gatewayProtocol } from "../protocols/utils/gateway-protocol.js" +import { VercelAIGatewayOptions, type ProviderOptionsInput } from "./vercel-ai-gateway-options.js" +import { ProviderShared } from "../protocols/shared.js" +import type { ProviderPackage } from "../provider-package.js" import { AIError, HttpContext, @@ -20,8 +33,11 @@ import { ProviderID, ProviderMetadata, Usage, + LLMRequest, } from "../schema/index.js" +export type { GatewayOptions, ProviderOptionsInput } from "./vercel-ai-gateway-options.js" + export const id = ProviderID.make("vercel-ai-gateway") const baseURL = "https://ai-gateway.vercel.sh/v1" @@ -34,12 +50,183 @@ export interface EvaluationOptions { }> } -export type Options = ProviderAuthOption<"optional"> & { - readonly baseURL?: string - readonly headers?: Record - readonly http?: HttpOptions.Input +export type Options = Omit & + ProviderAuthOption<"optional"> & { + readonly baseURL?: string + readonly providerOptions?: ProviderOptionsInput + } + +export type Settings = ProviderPackage.Settings & ProviderOptionsInput & { readonly apiKey?: string } + +const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(VercelAIGatewayOptions.Options)) + +const lower = Effect.fn("VercelAIGateway.lower")(function* ( + request: LLMRequest, + api: "messages" | "responses" | "chat", +) { + const options = yield* decodeOptions(request.providerOptions ?? {}) + if (api !== "responses" && (options.cacheTTL !== undefined || options.cacheAnchorItems !== undefined)) + return yield* ProviderShared.invalidRequest("cacheTTL and cacheAnchorItems require the Gateway Responses API") + if (api === "responses" && request.providerOptions?.thinking !== undefined) + return yield* ProviderShared.invalidRequest( + "Responses uses reasoningEffort; put native thinking settings under upstream", + ) + const chatReasoning = + api === "chat" && request.providerOptions?.thinking !== undefined + ? yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking))(request.providerOptions.thinking) + : undefined + const effective = options.reasoningEffort ?? options.effort + const normalized = LLMRequest.update(request, { + providerOptions: { + ...request.providerOptions, + ...(effective === undefined ? {} : { reasoningEffort: effective }), + ...(api === "messages" && effective !== undefined + ? { + effort: effective === "none" ? undefined : effective, + thinking: + request.providerOptions?.thinking ?? (effective === "none" ? { type: "disabled" } : { type: "adaptive" }), + } + : {}), + }, + }) + const body = yield* api === "messages" + ? AnthropicMessages.protocol.body + .from(normalized) + .pipe( + Effect.flatMap( + ProviderShared.validateWith(Schema.decodeUnknownEffect(AnthropicMessages.protocol.body.schema)), + ), + ) + : api === "chat" + ? OpenAIChat.fromRequest(normalized, { cacheControl: cacheControl() }).pipe( + Effect.flatMap(ProviderShared.validateWith(Schema.decodeUnknownEffect(OpenAIChat.protocol.body.schema))), + ) + : request.model.id.startsWith("meta/muse-") + ? MetaResponses.protocol.body.from(normalized) + : request.model.id.startsWith("xai/grok-") + ? XAIResponses.protocol.body.from(normalized) + : request.model.id.startsWith("openai/") + ? OpenAIResponses.protocol.body.from(normalized) + : OpenResponses.protocol.body.from(normalized) + const caching = request.cache === undefined || request.cache === "auto" ? "auto" : undefined + return { + ...body, + ...(chatReasoning !== undefined + ? { + reasoning: { + enabled: chatReasoning.type !== "disabled", + ...(chatReasoning.type === "enabled" ? { max_tokens: chatReasoning.budgetTokens } : {}), + }, + } + : {}), + providerOptions: { + ...options.upstream, + gateway: { ...(caching === undefined ? {} : { caching }), ...options.gateway }, + }, + ...(api === "responses" && options.cacheTTL !== undefined ? { cache_ttl: options.cacheTTL } : {}), + ...(api === "responses" && options.cacheAnchorItems !== undefined + ? { cache_anchor_items: options.cacheAnchorItems } + : {}), + } +}) + +const ChatThinking = Schema.Union([ + Schema.Struct({ type: Schema.Literal("disabled") }), + Schema.Struct({ type: Schema.Literal("adaptive") }), + Schema.Struct({ type: Schema.Literal("enabled"), budgetTokens: Schema.Int.check(Schema.isGreaterThan(0)) }), +]) + +const messagesProtocol = gatewayProtocol(AnthropicMessages.protocol, { + id: "vercel-ai-gateway-messages", + from: (request) => lower(request, "messages"), +}) +const responsesProtocol = gatewayProtocol(OpenAIResponses.protocol, { + id: "vercel-ai-gateway-responses", + from: (request) => lower(request, "responses"), +}) +const openResponsesProtocol = gatewayProtocol(OpenResponses.protocol, { + id: "vercel-ai-gateway-openresponses", + from: (request) => lower(request, "responses"), +}) +const metaProtocol = gatewayProtocol(MetaResponses.protocol, { + id: "vercel-ai-gateway-meta-responses", + from: (request) => lower(request, "responses"), +}) +const xaiProtocol = gatewayProtocol(XAIResponses.protocol, { + id: "vercel-ai-gateway-xai-responses", + from: (request) => lower(request, "responses"), +}) +const chatProtocol = gatewayProtocol(OpenAIChat.protocol, { + id: "vercel-ai-gateway-chat", + from: (request) => lower(request, "chat"), +}) + +const messagesRoute = Route.make({ + id: "vercel-ai-gateway-messages", + provider: id, + providerMetadataKey: "vercel-ai-gateway", + protocol: messagesProtocol, + endpoint: Endpoint.path("/messages", { baseURL }), + framing: AnthropicMessages.framing, + defaults: { headers: { "anthropic-version": "2023-06-01" } }, + headers: affinity, +}) +const responsesRoute = Route.make({ + id: "vercel-ai-gateway-responses", + provider: id, + providerMetadataKey: "vercel-ai-gateway", + protocol: responsesProtocol, + endpoint: Endpoint.path("/responses", { baseURL }), + framing: OpenAIChat.framing, + defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, + headers: affinity, +}) +const metaRoute = Route.make({ + id: "vercel-ai-gateway-meta-responses", + provider: id, + providerMetadataKey: "vercel-ai-gateway", + protocol: metaProtocol, + endpoint: Endpoint.path("/responses", { baseURL }), + framing: OpenAIChat.framing, + defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, + headers: affinity, +}) +const openResponsesRoute = Route.make({ + id: "vercel-ai-gateway-openresponses", + provider: id, + providerMetadataKey: "vercel-ai-gateway", + protocol: openResponsesProtocol, + endpoint: Endpoint.path("/responses", { baseURL }), + framing: OpenAIChat.framing, + defaults: { providerOptions: { store: false } }, + headers: affinity, +}) +const xaiRoute = Route.make({ + id: "vercel-ai-gateway-xai-responses", + provider: id, + providerMetadataKey: "vercel-ai-gateway", + protocol: xaiProtocol, + endpoint: Endpoint.path("/responses", { baseURL }), + framing: OpenAIChat.framing, + defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, + headers: affinity, +}) +const chatRoute = Route.make({ + id: "vercel-ai-gateway-chat", + provider: id, + providerMetadataKey: "vercel-ai-gateway", + protocol: chatProtocol, + endpoint: Endpoint.path("/chat/completions", { baseURL }), + framing: OpenAIChat.framing, + headers: affinity, +}) + +function affinity({ request }: { readonly request: LLMRequest }): Record { + return request.promptCacheKey && request.cache !== "none" ? { "x-session-affinity": request.promptCacheKey } : {} } +export const routes = [messagesRoute, responsesRoute, openResponsesRoute, metaRoute, xaiRoute, chatRoute] + const Request = Schema.StructWithRest( Schema.Struct({ model: Schema.String, @@ -63,6 +250,35 @@ const Response = Schema.Struct({ }) export const configure = (input: Options = {}) => { + const { apiKey: _apiKey, auth: _auth, baseURL: endpoint, ...defaults } = input + const configured = { + ...defaults, + endpoint: { baseURL: (endpoint ?? baseURL).replace(/\/$/, "").replace(/\/v1$/, "") + "/v1" }, + auth: AuthOptions.bearer(input, ["AI_GATEWAY_API_KEY", "VERCEL_OIDC_TOKEN"]), + } + const messages = (modelID: string | ModelID) => + messagesRoute.with(configured).model({ + id: modelID, + compatibility: { requireSignature: modelID.startsWith("anthropic/") }, + }) + const responses = (modelID: string | ModelID) => + (modelID.startsWith("meta/muse-") + ? metaRoute + : modelID.startsWith("xai/grok-") + ? xaiRoute + : modelID.startsWith("openai/") + ? responsesRoute + : openResponsesRoute + ) + .with(configured) + .model({ id: modelID }) + const chat = (modelID: string | ModelID) => + chatRoute.with(configured).model({ + id: modelID, + compatibility: { supportsPromptCacheKey: true, supportsStore: false, reasoningField: "reasoning" }, + }) + const model = (modelID: string | ModelID) => + /^(openai\/gpt-|meta\/muse-|xai\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) const evaluation = (modelID: string | ModelID) => EvaluationModel.make({ id: modelID, @@ -139,10 +355,28 @@ export const configure = (input: Options = {}) => { }), }, }) - return { id, experimental: { evaluation }, configure } + return { id, model, messages, responses, chat, experimental: { evaluation }, configure } } export const provider = configure() export const experimental = provider.experimental +export const messages = provider.messages +export const responses = provider.responses +export const chat = provider.chat + +export const model: ProviderPackage.Definition["model"] = (modelID, settings) => + fromSettings(settings).model(modelID) +export const messagesModel: ProviderPackage.Definition["model"] = (modelID, settings) => + fromSettings(settings).messages(modelID) +export const responsesModel: ProviderPackage.Definition["model"] = ( + modelID, + settings, +) => fromSettings(settings).responses(modelID) +export const chatModel: ProviderPackage.Definition["model"] = (modelID, settings) => + fromSettings(settings).chat(modelID) + +function fromSettings({ apiKey, baseURL, headers, body, ...providerOptions }: Settings) { + return configure({ apiKey, baseURL, headers, http: { body }, providerOptions }) +} export * as VercelAIGateway from "./vercel-ai-gateway.js" diff --git a/packages/ai/src/providers/vercel-ai-gateway/chat.ts b/packages/ai/src/providers/vercel-ai-gateway/chat.ts new file mode 100644 index 000000000000..d2dab164d30b --- /dev/null +++ b/packages/ai/src/providers/vercel-ai-gateway/chat.ts @@ -0,0 +1,2 @@ +export { chatModel as model } from "../vercel-ai-gateway.js" +export type { Settings } from "../vercel-ai-gateway.js" diff --git a/packages/ai/src/providers/vercel-ai-gateway/messages.ts b/packages/ai/src/providers/vercel-ai-gateway/messages.ts new file mode 100644 index 000000000000..13341ff11bd4 --- /dev/null +++ b/packages/ai/src/providers/vercel-ai-gateway/messages.ts @@ -0,0 +1,2 @@ +export { messagesModel as model } from "../vercel-ai-gateway.js" +export type { Settings } from "../vercel-ai-gateway.js" diff --git a/packages/ai/src/providers/vercel-ai-gateway/responses.ts b/packages/ai/src/providers/vercel-ai-gateway/responses.ts new file mode 100644 index 000000000000..7e03a2910996 --- /dev/null +++ b/packages/ai/src/providers/vercel-ai-gateway/responses.ts @@ -0,0 +1,2 @@ +export { responsesModel as model } from "../vercel-ai-gateway.js" +export type { Settings } from "../vercel-ai-gateway.js" diff --git a/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json b/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json new file mode 100644 index 000000000000..d0f138fa4045 --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/automatically-caches-distinct-claude-system-blocks", + "recordedAt": "2026-10-02T02:43:51.540Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7Y66JVRQ88PYQ7P0GFEWW\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":3,\"output_tokens\":4,\"cache_creation_input_tokens\":4512,\"cache_creation\":{\"ephemeral_5m_input_tokens\":4512,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":3,\"cache_creation_input_tokens\":4512,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":4512,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\"},\"cacheCreationInputTokens\":4512,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790909028616,\"endTime\":1790909029976,\"providerRequestId\":\"req_011CfceBZ694B5LQ7hSk1nGD\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfceBZnKbmvJSs2eiQBfA\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"no_pin\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.016989\",\"marketCost\":\"0.016989\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.016989\",\"inferenceCost\":\"0.016989\",\"inputInferenceCost\":\"0.016929\",\"outputInferenceCost\":\"0.00006\",\"generationId\":\"gen_01M3X7Y66JVRQ88PYQ7P0GFEWW\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7Y7P6Y6G3CWZF4SASAMBF\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":3,\"output_tokens\":4,\"cache_read_input_tokens\":4512,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":3,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":4512,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\"},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790909030110,\"endTime\":1790909031544,\"providerRequestId\":\"req_011CfceBfa5ByuQuKQ1p1vRH\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfceBfvQrtjqajNiiHJSV\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"confirmed\",\"pinnedProvider\":\"anthropic\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0014226\",\"marketCost\":\"0.0014226\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0014226\",\"inferenceCost\":\"0.0014226\",\"inputInferenceCost\":\"0.0013626\",\"outputInferenceCost\":\"0.00006\",\"generationId\":\"gen_01M3X7Y7P6Y6G3CWZF4SASAMBF\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json new file mode 100644 index 000000000000..dad7c42d4ece --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-chat-claude-reasoning-and-tools", + "recordedAt": "2026-10-02T02:42:04.727Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/chat/completions", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_completion_tokens\":2048,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "data: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"The user wants\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\" to know the weather in Paris. I\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\" to know the weather in Paris. I\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"'ll use the get_weather tool.\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"'ll use the get_weather tool.\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"\",\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgB+7P81QYSDCL1v4HKm+UaAR7A0BoMpsWG9hdxt8gxDKdcIjAOwKCpp2Pzt3LN+RCw03So0sD3pEhLvZgxPeq8SJDk5H9bvCOwg0PB9PX4IB2phkoqWwl8PT4yYMLkrLrS5KmwEUnZoX3Uxpjambz5VJCGRtsDaj8VXEHy21ODPDcU4pBG7phiuAGwkw0By+kX7N8WMcoJFc56/RLj1d74QhCE6lxFu6x290FUBY4pypkYAQ==\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Sure! Let me check the current weather in Paris for you.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"toolu_01FZQfjpZVbBRto4FhVXAct1\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"city\\\": \\\"Paris\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":623,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":94,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":24}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"claudeaws\",\"fallbacksAvailable\":[\"anthropic\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: claudeaws, anthropic, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908921805,\"endTime\":1790908923604,\"providerRequestId\":\"req_011Cfce3giZNyymtG8ycvDGn\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfce3hThfJANDpxVhXbCA\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.003279\",\"marketCost\":\"0.003279\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.003279\",\"inferenceCost\":\"0.003279\",\"inputInferenceCost\":\"0.001869\",\"outputInferenceCost\":\"0.00141\",\"generationId\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\"}}},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"prompt_tokens\":623,\"completion_tokens\":94,\"total_tokens\":717,\"cost\":0.003279,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":24,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.003279,\"gateway_cost\":0.003279},\"system_fingerprint\":\"fp_infvwgx9cp\",\"generationId\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\"}\n\ndata: [DONE]\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/chat/completions", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"Sure! Let me check the current weather in Paris for you.\",\"tool_calls\":[{\"id\":\"toolu_01FZQfjpZVbBRto4FhVXAct1\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"format\":\"anthropic-claude-v1\",\"index\":0,\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgB+7P81QYSDCL1v4HKm+UaAR7A0BoMpsWG9hdxt8gxDKdcIjAOwKCpp2Pzt3LN+RCw03So0sD3pEhLvZgxPeq8SJDk5H9bvCOwg0PB9PX4IB2phkoqWwl8PT4yYMLkrLrS5KmwEUnZoX3Uxpjambz5VJCGRtsDaj8VXEHy21ODPDcU4pBG7phiuAGwkw0By+kX7N8WMcoJFc56/RLj1d74QhCE6lxFu6x290FUBY4pypkYAQ==\"}],\"reasoning\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\"},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01FZQfjpZVbBRto4FhVXAct1\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_completion_tokens\":2048,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "data: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_5s966xdefo\"}\n\ndata: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Paris\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_5s966xdefo\"}\n\ndata: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is sunny.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_5s966xdefo\"}\n\ndata: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":738,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":7,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: anthropic, claudeaws, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908923773,\"endTime\":1790908924730,\"providerRequestId\":\"req_011Cfce3qBYhrY5vvrBgPpJG\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfce3qoWJjHwqPgYSXkBq\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.002319\",\"marketCost\":\"0.002319\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.002319\",\"inferenceCost\":\"0.002319\",\"inputInferenceCost\":\"0.002214\",\"outputInferenceCost\":\"0.000105\",\"generationId\":\"gen_01M3X7TZT9997WWR189MSKK5MY\"}}},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":738,\"completion_tokens\":7,\"total_tokens\":745,\"cost\":0.002319,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.002319,\"gateway_cost\":0.002319},\"system_fingerprint\":\"fp_5s966xdefo\",\"generationId\":\"gen_01M3X7TZT9997WWR189MSKK5MY\"}\n\ndata: [DONE]\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json new file mode 100644 index 000000000000..8780fb2b444b --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-messages-claude-reasoning-and-tools", + "recordedAt": "2026-10-02T02:41:10.004Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7S7P4KNZXH16ZH2P5D0AV\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"The user wants\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" to know the weather in Paris. I'll use the get_weather tool.\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"signature_delta\",\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgBxLP81QYSDOEX5k4DrHPqTBRqPBoM9SvPOUL6/F1RW4ZjIjD2mSygL1r6KDWAaXN1Zb4szwebG01H6kEYKJ1WL0on5CvHGYcFKhis7Xok6MmqqjEqW7yaP068H2EiK4nrQSlYZt9ASOft9Qz7fSSTY45YIPj0yaJxHJMLZ6BCVnzTcZPFR9c+TEwgk2PCpjqEfFaUv+QiQ4+/W1xcuI4VCVlGBxec8ufHZe5MU2HLsX8YAQ==\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"Sure! Let me check the weather in Paris for you!\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":2,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01YA4k9TRWr1YQJDPxivgeqL\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\": \\\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":2}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":623,\"output_tokens\":93,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":623,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":93,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":24}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"claudeaws\",\"fallbacksAvailable\":[\"anthropic\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: claudeaws, anthropic, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908867155,\"endTime\":1790908869003,\"providerRequestId\":\"req_011CfcdyerKwqNiFkuW7jC2P\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfcdyfjufFuzf8f2sjePk\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.003264\",\"marketCost\":\"0.003264\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.003264\",\"inferenceCost\":\"0.003264\",\"inputInferenceCost\":\"0.001869\",\"outputInferenceCost\":\"0.001395\",\"generationId\":\"gen_01M3X7S7P4KNZXH16ZH2P5D0AV\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgBxLP81QYSDOEX5k4DrHPqTBRqPBoM9SvPOUL6/F1RW4ZjIjD2mSygL1r6KDWAaXN1Zb4szwebG01H6kEYKJ1WL0on5CvHGYcFKhis7Xok6MmqqjEqW7yaP068H2EiK4nrQSlYZt9ASOft9Qz7fSSTY45YIPj0yaJxHJMLZ6BCVnzTcZPFR9c+TEwgk2PCpjqEfFaUv+QiQ4+/W1xcuI4VCVlGBxec8ufHZe5MU2HLsX8YAQ==\"},{\"type\":\"text\",\"text\":\"Sure! Let me check the weather in Paris for you!\"},{\"type\":\"tool_use\",\"id\":\"toolu_01YA4k9TRWr1YQJDPxivgeqL\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_01YA4k9TRWr1YQJDPxivgeqL\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7SAFEX1HW56NRSZTMFHP9\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":737,\"output_tokens\":7,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":737,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":7,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"claudeaws\",\"fallbacksAvailable\":[\"anthropic\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: claudeaws, anthropic, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908869133,\"endTime\":1790908870008,\"providerRequestId\":\"req_011CfcdyoTkYvsQ2LD7r8D1u\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfcdyp3iwVCXxFZNuVX8i\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.002316\",\"marketCost\":\"0.002316\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.002316\",\"inferenceCost\":\"0.002316\",\"inputInferenceCost\":\"0.002211\",\"outputInferenceCost\":\"0.000105\",\"generationId\":\"gen_01M3X7SAFEX1HW56NRSZTMFHP9\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json new file mode 100644 index 000000000000..87f9cba592de --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-messages-gemini-reasoning-and-tools", + "recordedAt": "2026-10-02T02:41:12.275Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"google/gemini-2.5-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7SBEGKTZ127JKTQH5ETXQ\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"google/gemini-2.5-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"**Fetching Weather Information**\\n\\nI'm focusing on retrieving Paris's weather. I've identified the `get_weather` tool and will set the city to 'Paris'. Following the tool's execution, I'll present the specific response: \\\"Paris is sunny.\\\"\\n\\n\"}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"signature_delta\",\"signature\":\"CiwBjz1rX80VzoN/eWSik0eiEcNO/PcG2yjqmp45W3geMIru6xS6QmvS5PjQHgpoAY89a1/boZwQbUXiM8oVMlAN5jpJvFml9b7nZP87z/pBo1Oxrfp5rEqUyWmZM9VFkeAxjQi8HnFviL5bl/EUjmfgU0aKKbOCd9hLvdvXFbaSBnm2caSUtEg5qiX8c3h8mPcfUPagXaEKggEBjz1rXzKilL2SFBnApdbIowWHUplTJQsqXytZV9ox5gGftaEvMSDeDDo/pi1nAQg74kDLXLUwITAP44ZmkVzACY9cumuj8MRqq9DmqphV0ojnN0oRc6JwGjj4hoIlfaxxT5RV5Td5hbeZ5/+NN7+jfINk72bjayBaKtVhwCwB4irVCnIBjz1rXyY3M5fsZkCfn39MKMllPSQk/g98gH0Gx4LtMbzDQ8ZNverS/62FUzX1EoGD70ju6zQg+MNO2CDqAdfaVW0lD9oWGKpobgczKE22yi+9AgEl8UMuM/I9A6qa3/auuqoDXAYC/9hVRqR0ApxJQUs=\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":2,\"content_block\":{\"type\":\"tool_use\",\"id\":\"36iwqhwSe4xJCtdc\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":2}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":42,\"output_tokens\":66},\"provider_metadata\":{\"vertex\":{\"promptFeedback\":null,\"groundingMetadata\":null,\"urlContextMetadata\":null,\"safetyRatings\":null,\"usageMetadata\":{\"thoughtsTokenCount\":61,\"promptTokenCount\":42,\"candidatesTokenCount\":5,\"totalTokenCount\":108,\"trafficType\":\"ON_DEMAND\",\"promptTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":42}],\"candidatesTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":5}]},\"finishMessage\":null,\"serviceTier\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"google/gemini-2.5-flash\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[\"google\"],\"planningReasoning\":\"System credentials planned for: vertex, google. Total execution order: vertex(system) → google(system)\",\"canonicalSlug\":\"google/gemini-2.5-flash\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"google/gemini-2.5-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908870139,\"endTime\":1790908871432,\"statusCode\":200,\"providerResponseId\":\"xhm_atjxD-PUle0PovGE8Ao\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0001776\",\"marketCost\":\"0.0001776\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0001776\",\"inferenceCost\":\"0.0001776\",\"inputInferenceCost\":\"0.0000126\",\"outputInferenceCost\":\"0.000165\",\"generationId\":\"gen_01M3X7SBEGKTZ127JKTQH5ETXQ\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"google/gemini-2.5-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"**Fetching Weather Information**\\n\\nI'm focusing on retrieving Paris's weather. I've identified the `get_weather` tool and will set the city to 'Paris'. Following the tool's execution, I'll present the specific response: \\\"Paris is sunny.\\\"\\n\\n\",\"signature\":\"\"},{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"CiwBjz1rX80VzoN/eWSik0eiEcNO/PcG2yjqmp45W3geMIru6xS6QmvS5PjQHgpoAY89a1/boZwQbUXiM8oVMlAN5jpJvFml9b7nZP87z/pBo1Oxrfp5rEqUyWmZM9VFkeAxjQi8HnFviL5bl/EUjmfgU0aKKbOCd9hLvdvXFbaSBnm2caSUtEg5qiX8c3h8mPcfUPagXaEKggEBjz1rXzKilL2SFBnApdbIowWHUplTJQsqXytZV9ox5gGftaEvMSDeDDo/pi1nAQg74kDLXLUwITAP44ZmkVzACY9cumuj8MRqq9DmqphV0ojnN0oRc6JwGjj4hoIlfaxxT5RV5Td5hbeZ5/+NN7+jfINk72bjayBaKtVhwCwB4irVCnIBjz1rXyY3M5fsZkCfn39MKMllPSQk/g98gH0Gx4LtMbzDQ8ZNverS/62FUzX1EoGD70ju6zQg+MNO2CDqAdfaVW0lD9oWGKpobgczKE22yi+9AgEl8UMuM/I9A6qa3/auuqoDXAYC/9hVRqR0ApxJQUs=\"},{\"type\":\"tool_use\",\"id\":\"36iwqhwSe4xJCtdc\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"36iwqhwSe4xJCtdc\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7SCWJ23M3CM66XMANB662\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"google/gemini-2.5-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":184,\"output_tokens\":4},\"provider_metadata\":{\"vertex\":{\"promptFeedback\":null,\"groundingMetadata\":null,\"urlContextMetadata\":null,\"safetyRatings\":null,\"usageMetadata\":{\"promptTokenCount\":184,\"candidatesTokenCount\":4,\"totalTokenCount\":188,\"trafficType\":\"ON_DEMAND\",\"promptTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":184}],\"candidatesTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":4}]},\"finishMessage\":null,\"serviceTier\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"google/gemini-2.5-flash\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[\"google\"],\"planningReasoning\":\"System credentials planned for: vertex, google. Total execution order: vertex(system) → google(system)\",\"canonicalSlug\":\"google/gemini-2.5-flash\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"google/gemini-2.5-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908871639,\"endTime\":1790908872278,\"statusCode\":200,\"providerResponseId\":\"xxm_aoTFMbyqw8cPrM69oAY\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000652\",\"marketCost\":\"0.0000652\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000652\",\"inferenceCost\":\"0.0000652\",\"inputInferenceCost\":\"0.0000552\",\"outputInferenceCost\":\"0.00001\",\"generationId\":\"gen_01M3X7SCWJ23M3CM66XMANB662\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json new file mode 100644 index 000000000000..bd81f8a1b2de --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-responses-gpt-reasoning-and-tools", + "recordedAt": "2026-10-02T02:41:14.510Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"openai/gpt-5-nano\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\",\"object\":\"response\",\"created_at\":1790908872,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\",\"object\":\"response\",\"created_at\":1790908872,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[],\"encrypted_content\":\"gAAAAABqvxnISO9uEqQqvo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IB-AX0UX9EkDCfCN6OVMWv3p7TrorW0DArdknWkvb7qcL2ygpw8LzUy3eriEMz0BH2-B_LBibKwx_Q48Gu8dIjEvusqDyzNpt1Oc6KwkwuF8_bPtD0RqgDAyGEozv40FtocuHqQj4uYbnXhfh97NQGta9M-db1yvECLRq4AV8=\"}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"{\\\"\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"city\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"\\\":\\\"\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"Paris\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":12,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":13,\"output_index\":1,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":14,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"gAAAAABqvxnJ06ebl4J7SrbSSuIlZxC4T4VuhVnFIGrFyAY0mmttxVsngBuy-6zKZMSfdpdl5BZ3sr8znFnvaNRyxj1u_iiwBpQLXPXxx721Mi-XRJEgDSUBuDuPcgQgZe22jkEGqFGNXUailrL82aECa3kkDbVMnq1tLwi0o76XmH_raR9xNdxw6UU9rffP0BbMVcy-kE6jcY_6t2TsWr5yPc73XMak1q6mmVeiBhbabW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1QyudSPiT--7zQZzsacigXRNdMjWSwQlPfnEdBdQNjMPrpjE0ulMCVs-1KVpSE0pOAj0RhZYSaT1nCHhFqZ19NFahoLTp23G32NkGXk0qYz3pFlX_X1pRpXXUVd2vrO6Ss7FHRfL9OE0QK8h1TMzbvL-ybHNKga9IqcnyLo1AORTcgzExJfDkHDTZxwd6WNurjhBigoAysF8gqG2xQ96nKMLmLCz6T3G_QzG4oufZJm4WQwex4lpSyhjWJ_fP49e9shsL41Ed0GMD9NMHrrvMTE0kSa9YQDt6d7qkQhzUQtyX1f0fCb1Esc4CXZyGrOhgcZY5_RM19AmdfUDzczpb8FbGSGMoSw2rAn1zzUlIKZnDj7Ixx3lmFi4cGu8gb2cX7fNEX7vD_H06brwQZDkJAEAeIXUCgifUqpxP_Jg6UiEYHL0fBVYmC6D0owxn2PUYqcT7vcVyqfa6a1S_8PCbR6kAWYOpIm0M5oS7pkful6HvLRTx1o-LACdpkGIDLNsNvXzYXtjNu2VEiWcpSo1B-mJqP7OYfZm_3lMhvjGWVkvWidr_NiPxe2ZaOkR0KRoftR4LClF3bd8jTRoXCsygB6fdOb25jC7nvi00ezZMfaMU_CHZxuSwnpa5Mu4FZ_gy-bybcT8YwcRaGiUUTi4dd7FeIr6IiFKxVBLXUqcwSA=\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":15,\"response\":{\"id\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\",\"object\":\"response\",\"created_at\":1790908872,\"status\":\"completed\",\"completed_at\":1790908873,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"gAAAAABqvxnJ06ebl4J7SrbSSuIlZxC4T4VuhVnFIGrFyAY0mmttxVsngBuy-6zKZMSfdpdl5BZ3sr8znFnvaNRyxj1u_iiwBpQLXPXxx721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LD696D8LQfxzqNLteoYLKxFm3qWRW_KZp8jh_hWvj0Olru1HkvulOhgkc8ph8LEyO2oNe4FDJt0eqKqJe91qhGHA4Lx-82-V5e6IKCfCm-YvR3NTcB0bgNspawXuWwY1QyudSPiT--7zQZzsacigXRNdMjWSwQlPfnEdBdQNjMPrpjE0ulMCVs-1KVpSE0pOAj0RhZYSaT1nCHhFqZ19NFahoLTp23G32NkGXk0qYz3pFlX_X1pRpXXUVd2vrO6Ss7FHRfL9OE0QK8h1TMzbvL-ybHNKga9IqcnyLo1AORTcgzExJfDkHDTZxwd6WNurjhBigoAysF8gqG2xQ96nKMLmLCz6T3G_QzG4oufZJm4WQwex4lpSyhjWJ_fP49e9shsL41Ed0GMD9NMHrrvMTE0kSa9YQDt6d7qkQhzUQtyX1f0fCb1Esc4CXZyGrOhgcZY5_RM19AmdfUDzczpb8FbGSGMoSw2rAn1zzUlIKZnDj7Ixx3lmFi4cGu8gb2cX7fNEX7vD_H06brwQZDkJAEAeIXUCgifUqpxP_Jg6UiEYHL0fBVYmC6D0owxn2PUYqcT7vcVyqfa6a1S_8PCbR6kAWYOpIm0M5oS7pkful6HvLRTx1o-LACdpkGIDLNsNvXzYXtjNu2VEiWcpSo1B-mJqP7OYfZm_3lMhvjGWVkvWidr_NiPxe2ZaOkR0KRoftR4LClF3bd8jTRoXCsygB6fdOb25jC7nvi00ezZMfaMU_CHZxuSwnpa5Mu4FZ_gy-bybcT8YwcRaGiUUTi4dd7FeIr6IiFKxVBLXUqcwSA=\"},{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":74,\"output_tokens\":126,\"total_tokens\":200,\"input_tokens_details\":{\"cached_tokens\":0,\"cache_write_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":64}},\"model\":\"gpt-5-nano-2025-08-07\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_00c73043b2e92f54016abf19c8781c87d188290ad958f519b0\",\"serviceTier\":\"default\",\"reasoningContext\":\"current_turn\"},\"gateway\":{\"routing\":{\"originalModelId\":\"openai/gpt-5-nano\",\"resolvedProvider\":\"openai\",\"fallbacksAvailable\":[\"azure\"],\"planningReasoning\":\"System credentials planned for: openai, azure. Total execution order: openai(system) → azure(system)\",\"canonicalSlug\":\"openai/gpt-5-nano\",\"finalProvider\":\"openai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"openai/gpt-5-nano\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"openai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908872406,\"endTime\":1790908873695,\"providerRequestId\":\"req_69437ce1c26449ca96dc0645134389f3\",\"statusCode\":200,\"providerResponseId\":\"resp_00c73043b2e92f54016abf19c8781c87d188290ad958f519b0\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000541\",\"marketCost\":\"0.0000541\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000541\",\"inferenceCost\":\"0.0000541\",\"inputInferenceCost\":\"0.0000037\",\"outputInferenceCost\":\"0.0000504\",\"generationId\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\"}}}}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"openai/gpt-5-nano\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[],\"encrypted_content\":\"gAAAAABqvxnJ06ebl4J7SrbSSuIlZxC4T4VuhVnFIGrFyAY0mmttxVsngBuy-6zKZMSfdpdl5BZ3sr8znFnvaNRyxj1u_iiwBpQLXPXxx721Mi-XRJEgDSUBuDuPcgQgZe22jkEGqFGNXUailrL82aECa3kkDbVMnq1tLwi0o76XmH_raR9xNdxw6UU9rffP0BbMVcy-kE6jcY_6t2TsWr5yPc73XMak1q6mmVeiBhbabWmYH--mE9X-_Pv0JYSR8m3Yq7Ix9yuaTJmCi35VDVE31GCKFbhuTR_bs6XF94oyvsS3dhaLv3VA--lNO82-5LavpdVqVoAF8l74psptq-SPLNdO5YNsb3rH8k-QAxVWI-eB3fMqQP9YxXHgdaoBKacZLa-h4ZMq5CQV6hgr3eCyuyzRlHQ_3sQQu_-9PIWyeaTf8JqxAH4qeqxnrontjSIO0GNZ8Y2TV0DDrFkrgi6tqjKP0wEMvRt31_psSGXNliYELwKxd568t4XSrNhhThlJrHAOnT404XXbiwaiVQ3Cge0HT-s28H6EZvCPa0s_KMGsa7rYhIIn0E_Kr4R90nGZ0UcnoZcEU1SPTMrzjA5Yls-zz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x3lmFi4cGu8gb2cX7fNEX7vD_H06brwQZDkJAEAeIXUCgifUqpxP_Jg6UiEYHL0fBVYmC6D0owxn2PUYqcT7vcVyqfa6a1S_8PCbR6kAWYOpIm0M5oS7pkful6HvLRTx1o-LACdpkGIDLNsNvXzYXtjNu2VEiWcpSo1B-mJqP7OYfZm_3lMhvjGWVkvWidr_NiPxe2ZaOkR0KRoftR4LClF3bd8jTRoXCsygB6fdOb25jC7nvi00ezZMfaMU_CHZxuSwnpa5Mu4FZ_gy-bybcT8YwcRaGiUUTi4dd7FeIr6IiFKxVBLXUqcwSA=\"},{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\",\"object\":\"response\",\"created_at\":1790908874,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\",\"object\":\"response\",\"created_at\":1790908874,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908874359_82312mad8qc\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":8,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":10,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908874359_82312mad8qc\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":11,\"response\":{\"id\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\",\"object\":\"response\",\"created_at\":1790908874,\"status\":\"completed\",\"completed_at\":1790908874,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"message\",\"id\":\"msg_1790908874359_82312mad8qc\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":218,\"output_tokens\":8,\"total_tokens\":226,\"input_tokens_details\":{\"cached_tokens\":0,\"cache_write_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"gpt-5-nano-2025-08-07\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_0d644ec918746958016abf19c9edb487d1b5fd771700d5fc21\",\"serviceTier\":\"default\",\"reasoningContext\":\"current_turn\"},\"gateway\":{\"routing\":{\"originalModelId\":\"openai/gpt-5-nano\",\"resolvedProvider\":\"openai\",\"fallbacksAvailable\":[\"azure\"],\"planningReasoning\":\"System credentials planned for: openai, azure. Total execution order: openai(system) → azure(system)\",\"canonicalSlug\":\"openai/gpt-5-nano\",\"finalProvider\":\"openai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"openai/gpt-5-nano\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"openai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908873804,\"endTime\":1790908874516,\"providerRequestId\":\"req_18d8433248e545da84f7e3fbbc9efdc1\",\"statusCode\":200,\"providerResponseId\":\"resp_0d644ec918746958016abf19c9edb487d1b5fd771700d5fc21\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000141\",\"marketCost\":\"0.0000141\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000141\",\"inferenceCost\":\"0.0000141\",\"inputInferenceCost\":\"0.0000109\",\"outputInferenceCost\":\"0.0000032\",\"generationId\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\"}}}}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json new file mode 100644 index 000000000000..f8e87e635f77 --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-responses-grok-reasoning-and-tools", + "recordedAt": "2026-10-02T02:41:23.506Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"xai/grok-4.1-fast-reasoning\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SQ25GKASNSK847DB7M03\",\"object\":\"response\",\"created_at\":1790908882,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SQ25GKASNSK847DB7M03\",\"object\":\"response\",\"created_at\":1790908882,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_1790908882863_fdlmcnnqwng\",\"output_index\":0,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":4,\"item_id\":\"fc_1790908882863_fdlmcnnqwng\",\"output_index\":0,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":5,\"output_index\":0,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":6,\"response\":{\"id\":\"gen_01M3X7SQ25GKASNSK847DB7M03\",\"object\":\"response\",\"created_at\":1790908882,\"status\":\"completed\",\"completed_at\":1790908882,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":878,\"output_tokens\":160,\"total_tokens\":1038,\"input_tokens_details\":{\"cached_tokens\":650},\"output_tokens_details\":{\"reasoning_tokens\":135}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"googleVertex\":{\"acceptedPredictionTokens\":0,\"rejectedPredictionTokens\":0},\"gateway\":{\"routing\":{\"originalModelId\":\"xai/grok-4.1-fast-reasoning\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: vertex. Total execution order: vertex(system)\",\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908882008,\"endTime\":1790908882871,\"statusCode\":200,\"providerResponseId\":\"c77b27ff-5655-4511-a28e-eb7c45becd19\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0001581\",\"marketCost\":\"0.0001581\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0001581\",\"inferenceCost\":\"0.0001581\",\"inputInferenceCost\":\"0.0000781\",\"outputInferenceCost\":\"0.00008\",\"generationId\":\"gen_01M3X7SQ25GKASNSK847DB7M03\"}}}}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"xai/grok-4.1-fast-reasoning\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_99316591\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\",\"object\":\"response\",\"created_at\":1790908883,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\",\"object\":\"response\",\"created_at\":1790908883,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908883480_mtiul363bl\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":8,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":10,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908883480_mtiul363bl\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":11,\"response\":{\"id\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\",\"object\":\"response\",\"created_at\":1790908883,\"status\":\"completed\",\"completed_at\":1790908883,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"message\",\"id\":\"msg_1790908883480_mtiul363bl\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":1058,\"output_tokens\":44,\"total_tokens\":1102,\"input_tokens_details\":{\"cached_tokens\":1039},\"output_tokens_details\":{\"reasoning_tokens\":40}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"googleVertex\":{\"acceptedPredictionTokens\":0,\"rejectedPredictionTokens\":0},\"gateway\":{\"routing\":{\"originalModelId\":\"xai/grok-4.1-fast-reasoning\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: vertex. Total execution order: vertex(system)\",\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908882982,\"endTime\":1790908883510,\"statusCode\":200,\"providerResponseId\":\"c24f92be-02fd-4313-8971-861897f4f9ab\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00007775\",\"marketCost\":\"0.00007775\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00007775\",\"inferenceCost\":\"0.00007775\",\"inputInferenceCost\":\"0.00005575\",\"outputInferenceCost\":\"0.000022\",\"generationId\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\"}}}}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json new file mode 100644 index 000000000000..915706075250 --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-responses-muse-reasoning-and-tools", + "recordedAt": "2026-10-02T02:41:21.896Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\",\"object\":\"response\",\"created_at\":1790908876,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\",\"object\":\"response\",\"created_at\":1790908876,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"delta\":\"I'll check the weather in Paris now.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"text\":\"I'll check the weather in Paris now.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":12,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_1790908879574_5sr4f8zk7yt\",\"output_index\":2,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":14,\"item_id\":\"fc_1790908879574_5sr4f8zk7yt\",\"output_index\":2,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":15,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":16,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFI1vMhVfuCXmcgmO3hobnnPv75dt-JebnUD9Gfxx70PEUET9EXywInIYxEKo1ivh475TXj7aShCMgy4oCZ0607aIneDAggRBcbSuA-6nLeRU81T1VHvX4-3yYlO65vzDoMTqgjCe6WmM-MJhxR8jR0X74uJcyhI8yf0Idf0m7XypFcBrnmy7dJQ9siLa0EkgjopckvUOfAe9_-3G8JoBgZ1bFX1vE8ThfSikoqwrgM2kIvRK9nR6O4szj94kYK7K6c4vqelz8eVIZMjp02JQzWai8BflgmdWkqmkIViljbcYMX5yM9nonYpyteBn9E7tKOBk6Zh5FaSROo8UvsinD7c3yv0LUbPZTGhkXoxRTEIKJ8yL8JAVz--5D_aOfq-FMwSnGxGdjlNm5VdRd7-3dI7XvKa4nQf5vttB4EFotVx__waEBSFY9YR87Hep-fpgdl435q0VDekTRcpgniVsTGQlFqL_lAVaiUI_RgLE15FuHgQI8fq-MsXPSB0X1TNchYOOL0nQmx2VqzSnNUKbzE1oAKS86sz71BnHDjCO-BCCiWqscrHudEhnvFq7Di5SmYSVJZ3BQwqHXKtYZUoLKQ2ZahuM2LSNVTIV_Indqa8sKJn8VNWmX6_hFSEX7aTtrV7N1OybzH8-edzY0UMI1jpM3E-xOSHKfX1vuGYf2Zq69qLJbHw3Ifk0sar_qjTSHQ1rvT8-SJY9aQnapU6amedBg6-CXEo-DQR9o_mNvXpntaD8M3QEsyKYJSDMR35A1pv0syFINmBmitgfegIPPYH35o3Waorin2ZlcfYYYC8ZVfB9N6oWEXuX7G1nLAKqMmc-jHcZax6zRgr_WUAkNjaMK3h_O3BzutHejB02TyVQp5na6mBSMVEHn0vnbwKRxSV47nrS5wvfbALtRvQDvBDjo6R-68lPL3TEH3JX8uSF3N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_s1IAODxdi43LTZrMppqjT061bM0pjSoMc4t6FkUk2UeOXesjUXsLOBEkjrOUBXm6J4yOe6K5FKRWnq3UTvoy6gXrFOdzpa1ROvLCbVDvIA7CUXfgu9XCG4VSrVahUPnNkS7HqDAKsmRdAVJu4TcR_NazBbmBqmxkszSyMwj6_SaEoBEDFeaslehX7iCBgMCeG9kEoLxPLRoWoVjF-EGDPsE5g2O3jcaxeXGV9U6j7P1COcwMeclnJxCA\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":17,\"response\":{\"id\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\",\"object\":\"response\",\"created_at\":1790908876,\"status\":\"completed\",\"completed_at\":1790908879,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFI1vMhVfuCXmcgmO3hobnnPv75dt-JebnUD9Gfxx70PEUET9EXywInIYxEKo1ivh475TXj7aShCMgy4oCZ0607aIneDAggRBcbSuA-6nLeRU81T1VHvX4-3yYlO65vzDoMTqgjCe6WmM-MJhxR8jR0X74uJcyhI8yf0Idf0m7XypFcBrnmy7dJQ9siLa0EkgjopckvUOfAe9_-3G8JoBgZ1bFX1vE8ThfSikoqwrgM2kIvRK9nR6O4szj94kYK7K6c4vqelz8eVIZMjp02JQzWai8BflgmdWkqmkIViljbcYMX5yM9nonYpyteBn9E7tKOBk6Zh5FaSROo8UvsinD7c3yv0LUbPZTGhkXoxRTEIKJ8yL8JAVz--5D_aOfq-FMwSnGxGdjlNm5VdRd7-3dI7XvKa4nQf5vttB4EFotVx__waEBSFY9YR87Hep-fpgdl435q0VDekTRcpgniVsTGQlFqL_lAVaiUI_RgLE15FuHgQI8fq-MsXPSB0X1TNchYOOL0nQmx2VqzSnNUKbzE1oAKS86sz71BnHDjCO-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UpI6pqlDigfzaDUwZzo5Rnscu08sVNaETo5Ng_OHJKVlJ319Wu9z6raNF30nPqYnaNBxz1-raJBOKbj804cu5bvvndrQU-k888hGVQPRUaq8l8gakZTRhTSSy96TlOf3a_7DzOxvqYAw-Iq4j20hsGG2kNxHRHSNXdJ5UNZDNk4e3IQIujx_CEwkdPIlQafcWB5BvjqwduQgsQqO80xVXBcCoj1hQRYVW8avaZgib8po5xXNazHiU3Lc1rSytPX95GL73wIWsYwwpi9vX3BZpjhE7C0gUkGr9GeURBKVf1r6CHeo1S-P94CFxvmQNRf7H0MG6ynlKhtUXgtHKBV1vT0L4qTN2KqRqf3uL2g9UaO18DI1zp1iFmkA65hYTDaMoEEopRDJOOx_s1IAODxdi43LTZrMppqjT061bM0pjSoMc4t6FkUk2UeOXesjUXsLOBEkjrOUBXm6J4yOe6K5FKRWnq3UTvoy6gXrFOdzpa1ROvLCbVDvIA7CUXfgu9XCG4VSrVahUPnNkS7HqDAKsmRdAVJu4TcR_NazBbmBqmxkszSyMwj6_SaEoBEDFeaslehX7iCBgMCeG9kEoLxPLRoWoVjF-EGDPsE5g2O3jcaxeXGV9U6j7P1COcwMeclnJxCA\"},{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":566,\"output_tokens\":449,\"total_tokens\":1015,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":382}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf19cc202122c66ab34169\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908874650,\"endTime\":1790908879817,\"providerRequestId\":\"b27d7c9f-dc28-4f48-8bee-e21b1f140689\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf19cc202122c66ab34169\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00249145\",\"marketCost\":\"0.00249145\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00249145\",\"inferenceCost\":\"0.00249145\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.00190825\",\"generationId\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\"}}}}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/responses", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[],\"encrypted_content\":\"Q-PaDgFI1vMhVfuCXmcgmO3hobnnPv75dt-JebnUD9Gfxx70PEUET9EXywInIYxEKo1ivh475TXj7aShCMgy4oCZ0607aIneDAggRBcbSuA-6nLeRU81T1VHvX4-3yYlO65vzDoMTqgjCe6WmM-MJhxR8jR0X74uJcyhI8yf0Idf0m7XypFcBrnmy7dJQ9siLa0EkgjopckvUOfAe9_-3G8JoBgZ1bFX1vE8ThfSikoqwrgM2kIvRK9nR6O4szj94kYK7K6c4vqelz8eVIZMjp02JQzWai8BflgmdWkqmkIViljbcYMX5yM9nonYpyteBn9E7tKOBk6Zh5FaSROo8UvsinD7c3yv0LUbPZTGhkXoxRTEIKJ8yL8JAVz--5D_aOfq-FMwSnGxGdjlNm5VdRd7-3dI7XvKa4nQf5vttB4EFotVx__waEBSFY9YR87Hep-fpgdl435q0VDekTRcpgniVsTGQlFqL_lAVaiUI_RgLE15FuHgQI8fq-MsXPSB0X1TNchYOOL0nQmx2VqzSnNUKbzE1oAKS86sz71BnHDjCO-BCCiWqscrHudEhnvFq7Di5SmYSVJZ3BQwqHXKtYZUoLKQ2ZahuM2LSNVTIV_Indqa8sKJn8VNWmX6_hFSEX7aTtrV7N1OybzH8-edzY0UMI1jpM3E-xOSHKfX1vuGYf2Zq69qLJbHw3Ifk0sar_qjTSHQ1rvT8-SJY9a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IQIujx_CEwkdPIlQafcWB5BvjqwduQgsQqO80xVXBcCoj1hQRYVW8avaZgib8po5xXNazHiU3Lc1rSytPX95GL73wIWsYwwpi9vX3BZpjhE7C0gUkGr9GeURBKVf1r6CHeo1S-P94CFxvmQNRf7H0MG6ynlKhtUXgtHKBV1vT0L4qTN2KqRqf3uL2g9UaO18DI1zp1iFmkA65hYTDaMoEEopRDJOOx_s1IAODxdi43LTZrMppqjT061bM0pjSoMc4t6FkUk2UeOXesjUXsLOBEkjrOUBXm6J4yOe6K5FKRWnq3UTvoy6gXrFOdzpa1ROvLCbVDvIA7CUXfgu9XCG4VSrVahUPnNkS7HqDAKsmRdAVJu4TcR_NazBbmBqmxkszSyMwj6_SaEoBEDFeaslehX7iCBgMCeG9kEoLxPLRoWoVjF-EGDPsE5g2O3jcaxeXGV9U6j7P1COcwMeclnJxCA\"},{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\"}],\"phase\":\"commentary\",\"status\":\"completed\"},{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\",\"object\":\"response\",\"created_at\":1790908880,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\",\"object\":\"response\",\"created_at\":1790908880,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908881803_wi9wz1jy91\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908881803_wi9wz1jy91\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":12,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"summary\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I1NdxZWU3WWMaAoBBjh50JV846P2WisNY1j3UcGha7hEy40j3ozbjSpj9MwIwFCWiTsEoDRTfoADpInFWqRSqxMZszMoKsaKa41-BgpcEkpoz7C4tXloFoKDVIUsZHYcTS8z-Zu4SaDZCnvw6YN2dCv5_KgBBOFGCiTx674mRufjjhvMrY3YT3I2KwalPyxKRWrskhuNOLTHNjlDw6yV_CWDyQdGj6-uE_UjaX8dmT6x8tFZoGxQrykQ8XgIg_QsJh_AyD0YqnxoqTWv4ii7i-cZT2l31-9OvXNl837uHDjreR5jZZuS9gR04SaGc2C_AtgmK7LTeDmbXKRXGISb5wTFcm-h09HgvDZnP8k_Bn8nhFslQY1FzmACNf1AGmQ97ySPA1QItCwRPxRmMlsYsRdtco94W4tVCrjzWBPQdEVQlTJ3w3HQiEdOhbta2aGPUDJJa70FVSQznGMz_tmtq5x0DdraQKJEeON3kGIToqPOrgcFPVfDmBrIDfCj7ANlty0MN3_RMXMOiIBooP1pmbKzcl_iT_MxzXgoWDrPusg93dfqaEtPedTOoW9aSLruEiVQAXfl3Nk_UtP_WQMwadEbLrMWy4CckljFBZOwj0UhAmVBnLq4MS0hmpnaKxnlj7vtWITsDrr7dy1UUtRtwkAUA97oZ5M8LXYsMMowSYsRlZk3jD2khBg\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":13,\"response\":{\"id\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\",\"object\":\"response\",\"created_at\":1790908880,\"status\":\"completed\",\"completed_at\":1790908881,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFhVCiJVbb8JmRpCUy6bGayvspWo3HlhfmBBtTMU8wxDZL2rKzs5ZsxhBBtlOVDB9fYtQZ3JJbH3ik3k1q1Hh3mE7H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2dCv5_KgBBOFGCiTx674mRufjjhvMrY3YT3I2KwalPyxKRWrskhuNOLTHNjlDw6yV_CWDyQdGj6-uE_UjaX8dmT6x8tFZoGxQrykQ8XgIg_QsJh_AyD0YqnxoqTWv4ii7i-cZT2l31-9OvXNl837uHDjreR5jZZuS9gR04SaGc2C_AtgmK7LTeDmbXKRXGISb5wTFcm-h09HgvDZnP8k_Bn8nhFslQY1FzmACNf1AGmQ97ySPA1QItCwRPxRmMlsYsRdtco94W4tVCrjzWBPQdEVQlTJ3w3HQiEdOhbta2aGPUDJJa70FVSQznGMz_tmtq5x0DdraQKJEeON3kGIToqPOrgcFPVfDmBrIDfCj7ANlty0MN3_RMXMOiIBooP1pmbKzcl_iT_MxzXgoWDrPusg93dfqaEtPedTOoW9aSLruEiVQAXfl3Nk_UtP_WQMwadEbLrMWy4CckljFBZOwj0UhAmVBnLq4MS0hmpnaKxnlj7vtWITsDrr7dy1UUtRtwkAUA97oZ5M8LXYsMMowSYsRlZk3jD2khBg\"},{\"type\":\"message\",\"id\":\"msg_1790908881803_wi9wz1jy91\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":659,\"output_tokens\":193,\"total_tokens\":852,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":179}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf19d0db3568e880e4472a\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908879950,\"endTime\":1790908881900,\"providerRequestId\":\"ea883605-3e7e-44b0-8ee7-dc7c8a9e349f\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf19d0db3568e880e4472a\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0015197\",\"marketCost\":\"0.0015197\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0015197\",\"inferenceCost\":\"0.0015197\",\"inputInferenceCost\":\"0.00069945\",\"outputInferenceCost\":\"0.00082025\",\"generationId\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\"}}}}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json b/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json new file mode 100644 index 000000000000..36d9c44133da --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json @@ -0,0 +1,31 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/rejects-invalid-credentials-without-retryable-classification", + "recordedAt": "2026-10-02T02:41:25.673Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello\"}]}],\"stream\":true,\"max_tokens\":32,\"providerOptions\":{\"gateway\":{\"caching\":\"auto\"}}}" + }, + "response": { + "status": 401, + "headers": { + "content-type": "application/json" + }, + "body": "{\"error\":{\"message\":\"Authentication failed. Create an API key and set in AI_GATEWAY_API_KEY environment variable: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys%3FshowCreateKeyModal\",\"type\":\"authentication_error\"}}" + } + } + ] +} diff --git a/packages/ai/test/provider-options/vercel-ai-gateway.types.ts b/packages/ai/test/provider-options/vercel-ai-gateway.types.ts new file mode 100644 index 000000000000..86d2233ba50c --- /dev/null +++ b/packages/ai/test/provider-options/vercel-ai-gateway.types.ts @@ -0,0 +1,32 @@ +import { LLM } from "../../src/index.js" +import { VercelAIGateway } from "../../src/providers/vercel-ai-gateway.js" + +const gateway = VercelAIGateway.configure({ + apiKey: "fixture", + providerOptions: { gateway: { only: ["anthropic", "bedrock"], caching: "auto" }, reasoningEffort: "high" }, +}) +LLM.request({ + model: gateway.model("meta/muse-spark-1.3"), + prompt: "Hello", + providerOptions: { reasoningEffort: "max" }, +}) +LLM.request({ + model: gateway.messages("anthropic/claude-sonnet-4.6"), + prompt: "Hello", + providerOptions: { thinking: { type: "enabled", budgetTokens: 2048 } }, +}) +LLM.request({ + model: gateway.responses("openai/gpt-5-nano"), + prompt: "Hello", + providerOptions: { reasoningSummary: "detailed", cacheTTL: "1h" }, +}) +VercelAIGateway.configure({ + providerOptions: { + gateway: { byok: { anthropic: [{ apiKey: "fixture" }] } }, + upstream: { google: { thinkingConfig: { includeThoughts: true, thinkingBudget: 1024 } } }, + }, +}) +// @ts-expect-error Gateway caching has one supported mode. +VercelAIGateway.configure({ providerOptions: { gateway: { caching: "forever" } } }) +// @ts-expect-error A thinking budget is numeric. +VercelAIGateway.configure({ providerOptions: { thinking: { type: "enabled", budgetTokens: "many" } } }) diff --git a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts new file mode 100644 index 000000000000..41e2c42b6d22 --- /dev/null +++ b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts @@ -0,0 +1,108 @@ +import { expect } from "bun:test" +import { Effect } from "effect" +import { LLM, LLMClient, LLMEvent, LLMRequest } from "../../src/index.js" +import { isRetryable } from "../../src/provider-error.js" +import { VercelAIGateway } from "../../src/providers/vercel-ai-gateway.js" +import { recordedTests } from "../recorded-test.js" +import { expectWeatherToolLoop, goldenWeatherToolLoopRequest, runWeatherToolLoop } from "../recorded-scenarios.js" + +const gateway = VercelAIGateway.configure({ apiKey: process.env.AI_GATEWAY_API_KEY ?? "fixture" }) +const recorded = recordedTests({ + prefix: "vercel-native", + provider: "vercel-ai-gateway", + requires: ["AI_GATEWAY_API_KEY"], +}) + +for (const item of [ + { + name: "messages Claude", + model: gateway.messages("anthropic/claude-sonnet-4.6"), + options: { thinking: { type: "enabled", budgetTokens: 1024 } }, + }, + { + name: "messages Gemini", + model: gateway.messages("google/gemini-2.5-flash"), + options: { thinking: { type: "enabled", budgetTokens: 1024 } }, + }, + { name: "responses GPT", model: gateway.model("openai/gpt-5-nano"), options: { reasoningEffort: "low" } }, + { name: "responses Muse", model: gateway.model("meta/muse-spark-1.3"), options: {} }, + { name: "responses Grok", model: gateway.model("xai/grok-4.1-fast-reasoning"), options: {} }, + { + name: "chat Claude", + model: gateway.chat("anthropic/claude-sonnet-4.6"), + options: { thinking: { type: "enabled", budgetTokens: 1024 } }, + }, +] as const) { + recorded.effect( + `continues ${item.name} reasoning and tools`, + () => + Effect.gen(function* () { + const events = yield* runWeatherToolLoop( + LLMRequest.update( + goldenWeatherToolLoopRequest({ + id: item.name, + model: item.model, + maxTokens: 2048, + temperature: false, + }), + { providerOptions: item.options }, + ), + ) + expectWeatherToolLoop(events) + expect(events.filter(LLMEvent.is.finish).every((event) => event.providerMetadata?.gateway !== undefined)).toBe( + true, + ) + if (item.name !== "responses Grok") expect(events.some(LLMEvent.is.reasoningEnd)).toBe(true) + if (item.name === "responses Grok") + expect(events.filter(LLMEvent.is.finish).some((event) => (event.usage?.reasoningTokens ?? 0) > 0)).toBe(true) + }), + 120_000, + ) +} + +recorded.effect( + "rejects invalid credentials without retryable classification", + () => + Effect.gen(function* () { + const result = yield* LLMClient.generate( + LLM.request({ + model: VercelAIGateway.configure({ apiKey: "invalid-gateway-key" }).messages("anthropic/claude-sonnet-4.6"), + prompt: "Hello", + generation: { maxTokens: 32 }, + }), + ).pipe(Effect.result) + expect(result._tag).toBe("Failure") + if (result._tag === "Failure") { + expect(result.failure.reason.http?.status).toBe(401) + expect(isRetryable(result.failure)).toBe(false) + } + }), + 30_000, +) + +recorded.effect( + "automatically caches distinct Claude system blocks", + () => + Effect.gen(function* () { + const request = LLM.request({ + model: gateway.messages("anthropic/claude-sonnet-4.6"), + system: [ + { + type: "text", + text: Array.from( + { length: 250 }, + (_, i) => `Rule ${i}: Preserve provider reasoning state and keep stable prompt prefixes intact.`, + ).join("\n"), + }, + { type: "text", text: "Reply with OK only." }, + ], + prompt: "Confirm.", + generation: { maxTokens: 32 }, + providerOptions: { gateway: { only: ["anthropic"] } }, + }) + yield* LLMClient.generate(request) + const second = yield* LLMClient.generate(request) + expect(second.usage?.cacheReadInputTokens).toBeGreaterThan(0) + }), + 60_000, +) diff --git a/packages/ai/test/provider/vercel-ai-gateway.test.ts b/packages/ai/test/provider/vercel-ai-gateway.test.ts new file mode 100644 index 000000000000..42f686ee8b9e --- /dev/null +++ b/packages/ai/test/provider/vercel-ai-gateway.test.ts @@ -0,0 +1,317 @@ +import { expect } from "bun:test" +import { ConfigProvider, Effect } from "effect" +import { LLM, LLMClient, LLMEvent, Message, CacheHint } from "../../src/index.js" +import { VercelAIGateway } from "../../src/providers/vercel-ai-gateway.js" +import { compileRequest } from "../../src/route/client.js" +import { it } from "../lib/effect.js" +import { dynamicResponse } from "../lib/http.js" +import { sseEvents } from "../lib/sse.js" +import { isRetryable } from "../../src/provider-error.js" + +it.effect("Gateway defaults preserve full model IDs and select the requested families", () => + Effect.gen(function* () { + const gateway = VercelAIGateway.configure({ apiKey: "fixture" }) + for (const [id, path] of [ + ["openai/gpt-6.1", "/responses"], + ["meta/muse-spark-1.3", "/responses"], + ["xai/grok-4", "/responses"], + ["meta/llama-4", "/messages"], + ["openai/gpt-oss-120b", "/responses"], + ["anthropic/claude-sonnet-4.6", "/messages"], + ["google/gemini-2.5-flash", "/messages"], + ["moonshotai/kimi-k3", "/messages"], + ]) { + const model = gateway.model(id) + expect(model.id).toBe(id) + expect(model.provider).toBe("vercel-ai-gateway") + expect(model.route.endpoint.path).toBe(path) + const compiled = yield* compileRequest(LLM.request({ model, prompt: "Hello" })) + expect(compiled.body.model).toBe(id) + expect(compiled.body.providerOptions).toEqual({ gateway: { caching: "auto" } }) + } + }), +) + +it.effect("Gateway selectors normalize host and version URLs without affecting custom paths", () => + Effect.gen(function* () { + for (const baseURL of ["https://gateway.test", "https://gateway.test/", "https://gateway.test/v1/"]) { + const gateway = VercelAIGateway.configure({ apiKey: "fixture", baseURL }) + for (const select of [gateway.messages, gateway.responses, gateway.chat]) { + const model = select("anthropic/claude-sonnet-4.6") + expect(model.route.endpoint.baseURL).toBe("https://gateway.test/v1") + yield* compileRequest(LLM.request({ model, prompt: "Hello" })) + } + } + }), +) + +it.effect("Gateway keeps distinct system blocks, cache hints, and upstream-scoped controls", () => + Effect.gen(function* () { + const compiled = yield* compileRequest( + LLM.request({ + model: VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-4.6"), + system: [ + { type: "text", text: "Stable", cache: new CacheHint({ type: "ephemeral" }) }, + { type: "text", text: "Project" }, + ], + prompt: "Hello", + cache: "none", + providerOptions: { + gateway: { only: ["anthropic", "bedrock"], order: ["bedrock"], zeroDataRetention: true }, + upstream: { + anthropic: { thinking: { type: "adaptive" } }, + bedrock: { reasoningConfig: { type: "adaptive" } }, + }, + }, + }), + ) + expect(compiled.body.system).toEqual([ + { type: "text", text: "Stable", cache_control: { type: "ephemeral" } }, + { type: "text", text: "Project" }, + ]) + expect(compiled.body.providerOptions).toEqual({ + gateway: { only: ["anthropic", "bedrock"], order: ["bedrock"], zeroDataRetention: true }, + anthropic: { thinking: { type: "adaptive" } }, + bedrock: { reasoningConfig: { type: "adaptive" } }, + }) + }), +) + +it.effect("Gateway effort settings lower to the selected API", () => + Effect.gen(function* () { + const gateway = VercelAIGateway.configure({ apiKey: "fixture", providerOptions: { reasoningEffort: "high" } }) + const messages = yield* compileRequest( + LLM.request({ model: gateway.messages("anthropic/claude-sonnet-4.6"), prompt: "Hello" }), + ) + expect(messages.body).toMatchObject({ thinking: { type: "adaptive" }, output_config: { effort: "high" } }) + const responses = yield* compileRequest( + LLM.request({ model: gateway.responses("openai/gpt-5-nano"), prompt: "Hello" }), + ) + expect(responses.body).toMatchObject({ + reasoning: { effort: "high" }, + store: false, + include: ["reasoning.encrypted_content"], + }) + const chat = yield* compileRequest(LLM.request({ model: gateway.chat("google/gemini-2.5-flash"), prompt: "Hello" })) + expect(chat.body).toMatchObject({ reasoning_effort: "high" }) + }), +) + +it.effect("Gateway honors explicit cache policies without duplicating automatic markers", () => + Effect.gen(function* () { + const model = VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-4.6") + const automatic = yield* compileRequest(LLM.request({ model, system: "Stable", prompt: "Hello" })) + expect(automatic.body.system).toEqual([{ type: "text", text: "Stable" }]) + const explicit = yield* compileRequest( + LLM.request({ + model, + system: "Stable", + prompt: "Hello", + cache: { system: true, ttlSeconds: 3600 }, + }), + ) + expect(explicit.body.system).toEqual([ + { type: "text", text: "Stable", cache_control: { type: "ephemeral", ttl: "1h" } }, + ]) + expect(explicit.body.providerOptions).toEqual({ gateway: {} }) + }), +) + +it.effect("Gateway Responses keeps cache-key and cache controls out of upstream namespaces", () => + Effect.gen(function* () { + const compiled = yield* compileRequest( + LLM.request({ + model: VercelAIGateway.configure({ apiKey: "fixture" }).responses("openai/gpt-5-nano"), + prompt: "Hello", + promptCacheKey: "opaque-session", + providerOptions: { cacheTTL: "1h", cacheAnchorItems: 1 }, + }), + ) + expect(compiled.body).toMatchObject({ prompt_cache_key: "opaque-session", cache_ttl: "1h", cache_anchor_items: 1 }) + expect(compiled.body.providerOptions).toEqual({ gateway: { caching: "auto" } }) + const rejected = yield* compileRequest( + LLM.request({ + model: VercelAIGateway.configure({ apiKey: "fixture" }).messages("google/gemini-2.5-flash"), + prompt: "Hello", + providerOptions: { cacheTTL: "1h" }, + }), + ).pipe(Effect.result) + expect(rejected._tag).toBe("Failure") + }), +) + +it.effect("Gateway Messages preserves signatures and billing metadata through tool continuation", () => + Effect.gen(function* () { + const model = VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-4.6") + const response = yield* LLMClient.generate(LLM.request({ model, prompt: "Hello" })).pipe( + Effect.provide( + dynamicResponse((input) => + Effect.sync(() => { + expect(input.request.url).toBe("https://ai-gateway.vercel.sh/v1/messages") + expect(input.request.headers.authorization).toBe("Bearer fixture") + return input.respond( + sseEvents( + { + type: "message_start", + message: { + usage: { input_tokens: 10, cache_read_input_tokens: 20 }, + provider_metadata: { gateway: { cost: "0.001", routing: { finalProvider: "bedrock" } } }, + }, + }, + { + type: "content_block_start", + index: 0, + content_block: { type: "thinking", thinking: "Plan", signature: "signed-state" }, + }, + { type: "content_block_stop", index: 0 }, + { + type: "content_block_start", + index: 1, + content_block: { type: "tool_use", id: "tool_1", name: "lookup", input: {} }, + }, + { type: "content_block_stop", index: 1 }, + { type: "message_delta", delta: { stop_reason: "tool_use" }, usage: { output_tokens: 5 } }, + { type: "message_stop" }, + ), + { headers: { "content-type": "text/event-stream" } }, + ) + }), + ), + ), + ) + expect(response.events.find(LLMEvent.is.finish)?.providerMetadata?.gateway).toMatchObject({ + cost: "0.001", + routing: { finalProvider: "bedrock" }, + }) + expect(response.usage?.cacheReadInputTokens).toBe(20) + const compiled = yield* compileRequest( + LLM.request({ + model, + messages: [ + Message.user("Hello"), + response.message, + Message.tool({ id: "tool_1", name: "lookup", result: { found: true } }), + ], + }), + ) + expect(compiled.body.messages).toContainEqual({ + role: "assistant", + content: [ + { type: "thinking", thinking: "Plan", signature: "signed-state" }, + { type: "tool_use", id: "tool_1", name: "lookup", input: {} }, + ], + }) + }), +) + +it.effect("Gateway Responses replays encrypted reasoning alongside tool calls", () => + Effect.gen(function* () { + const model = VercelAIGateway.configure({ apiKey: "fixture" }).responses("openai/gpt-5-nano") + const response = yield* LLMClient.generate(LLM.request({ model, prompt: "Hello" })).pipe( + Effect.provide( + dynamicResponse((input) => + Effect.sync(() => + input.respond( + sseEvents( + { + type: "response.output_item.done", + output_index: 0, + item: { type: "reasoning", id: "rs_1", encrypted_content: "opaque-state", summary: [] }, + }, + { + type: "response.output_item.done", + output_index: 1, + item: { type: "function_call", id: "fc_1", call_id: "call_1", name: "lookup", arguments: "{}" }, + }, + { + type: "response.completed", + response: { + id: "resp_1", + output: [], + usage: { input_tokens: 10, output_tokens: 5 }, + provider_metadata: { gateway: { cost: "0.001" } }, + }, + }, + ), + { headers: { "content-type": "text/event-stream" } }, + ), + ), + ), + ), + ) + const compiled = yield* compileRequest(LLM.request({ model, messages: [Message.user("Hello"), response.message] })) + expect(compiled.body.input).toContainEqual({ + type: "reasoning", + id: "rs_1", + encrypted_content: "opaque-state", + summary: [], + }) + expect(compiled.body.input).toContainEqual({ + type: "function_call", + id: "fc_1", + call_id: "call_1", + name: "lookup", + arguments: "{}", + }) + }), +) + +it.effect("Gateway 401 and 403 failures are terminal and retain HTTP context", () => + Effect.gen(function* () { + for (const status of [401, 403]) { + const result = yield* LLMClient.generate( + LLM.request({ + model: VercelAIGateway.configure({ apiKey: "fixture" }).chat("openai/gpt-5-nano"), + prompt: "Hello", + }), + ).pipe( + Effect.result, + Effect.provide( + dynamicResponse((input) => + Effect.succeed( + input.respond( + JSON.stringify({ error: { type: "authentication_error", message: "Invalid credentials" } }), + { status, headers: { "content-type": "application/json" } }, + ), + ), + ), + ), + ) + expect(result._tag).toBe("Failure") + if (result._tag === "Failure") { + expect(result.failure.reason.http?.status).toBe(status) + expect(isRetryable(result.failure)).toBe(false) + } + } + }), +) + +it.effect("Gateway authentication supports OIDC fallback and affinity without reading session state", () => + Effect.gen(function* () { + for (const api of ["messages", "responses", "chat"] as const) { + yield* LLMClient.generate( + LLM.request({ + model: VercelAIGateway.configure()[api]("openai/gpt-5-nano"), + prompt: "Hello", + promptCacheKey: "opaque-session", + }), + ).pipe( + Effect.result, + Effect.provide( + dynamicResponse((input) => + Effect.sync(() => { + expect(input.request.headers.authorization).toBe("Bearer oidc-fixture") + expect(input.request.headers["x-session-affinity"]).toBe("opaque-session") + return input.respond("{}", { status: 400, headers: { "content-type": "application/json" } }) + }), + ), + ), + ) + } + }).pipe( + Effect.provideService( + ConfigProvider.ConfigProvider, + ConfigProvider.fromUnknown({ VERCEL_OIDC_TOKEN: "oidc-fixture" }), + ), + ), +) From 121800ca9f56ae8166a909d1f7aa0ab5d43aaa47 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 1 Oct 2026 22:20:15 -0500 Subject: [PATCH 02/19] refactor(ai): simplify Vercel AI Gateway provider --- packages/ai/README.md | 10 +- packages/ai/src/cache-policy.ts | 6 - .../src/protocols/utils/gateway-protocol.ts | 123 +++---- .../providers/vercel-ai-gateway-options.ts | 72 ++--- .../ai/src/providers/vercel-ai-gateway.ts | 302 ++++++++---------- .../vercel-ai-gateway.types.ts | 2 - .../test/provider/vercel-ai-gateway.test.ts | 53 +-- 7 files changed, 209 insertions(+), 359 deletions(-) diff --git a/packages/ai/README.md b/packages/ai/README.md index 42c591e3fbe3..c02162ea201a 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1311,7 +1311,7 @@ gateway.messages("openai/gpt-5-nano") // Explicit Messages override Default routing sends `openai/gpt-*`, `meta/muse-*`, and `xai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. -Set request `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. Choose values the selected model supports; the Gateway may translate effort across upstreams. Older Claude models may require budget-based thinking instead of adaptive thinking. +Set `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. ```ts LLM.request({ @@ -1322,13 +1322,11 @@ LLM.request({ }) ``` -Messages and Chat expose `thinking` for on/off or token-budget controls. Responses uses `reasoningEffort` and `reasoningSummary`; native upstream controls can be passed as `upstream: { google: { thinkingConfig: ... } }`, etc. A budget translated by Gateway is **not** necessarily a hard reasoning-token cap. Explicit upstream options may override shared settings. +Messages and Chat accept `thinking` for on/off or token-budget controls. Native upstream settings go under `upstream`, for example `upstream: { google: { thinkingConfig: ... } }`. -Gateway controls live under `providerOptions.gateway`: routing `only`/`order`/`sort`, fallback `models`, `byok`, `providerTimeouts`, `zeroDataRetention`, regional inference, and usage tags/user. Upstream options live under `providerOptions.upstream` and lower into the original provider namespaces on the wire. +Gateway controls go under `providerOptions.gateway`. Gateway caching is enabled unless the request uses `cache: "none"`. Responses also accepts `cacheTTL` and `cacheAnchorItems`. `promptCacheKey` is sent as `x-session-affinity`. -Automatic Gateway caching is enabled by default. Request `cache: "none"` suppresses that default, but does not disable upstream implicit caching or manually placed cache hints. Messages preserves distinct system blocks and explicit hints. Responses additionally exposes `cacheTTL` and `cacheAnchorItems` (wire input-item count, not canonical message count). `promptCacheKey` supplies session affinity and the supported OpenAI-style cache-key field. - -Gateway routing, cost, and warnings are retained on terminal events' `providerMetadata.gateway`. Reasoning signatures and encrypted state remain on the corresponding content parts for replay. Existing experimental evaluation remains available. These language-model routes currently use HTTP/SSE; Gateway WebSocket, native compaction, and additional media modalities are not exposed by this facade yet. +Gateway metadata from `provider_metadata.gateway` is retained on the finish event's `providerMetadata.gateway`. Existing experimental evaluation remains available. Each named provider owns its module, endpoint, authentication, and route setup. Providers with the same wire format compose the shared protocol directly: diff --git a/packages/ai/src/cache-policy.ts b/packages/ai/src/cache-policy.ts index 11439b5be162..dc2340559cad 100644 --- a/packages/ai/src/cache-policy.ts +++ b/packages/ai/src/cache-policy.ts @@ -52,8 +52,6 @@ const RESPECTS_INLINE_HINTS = new Set([ "bedrock-converse", "openrouter", "digitalocean", - "vercel-ai-gateway-messages", - "vercel-ai-gateway-chat", ]) // OpenRouter upstreams other than Anthropic and Alibaba Qwen cache without breakpoints. Gemini uses only the last @@ -173,10 +171,6 @@ const countHints = (request: LLMRequest) => export const applyCachePolicy = (request: LLMRequest): LLMRequest => { if (!RESPECTS_INLINE_HINTS.has(request.model.route.id)) return request - // Gateway owns automatic marker placement. Only place our own breakpoints when the caller - // explicitly selects a policy, avoiding competing automatic breakpoint budgets. - if (request.model.provider === "vercel-ai-gateway" && (request.cache === undefined || request.cache === "auto")) - return request const policy = request.model.route.id === "openrouter" && (request.cache === undefined || request.cache === "auto") ? openRouterPolicy(request.model.id) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index 0eb9fe928686..b681d6e3d120 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -1,103 +1,76 @@ import { Effect, Schema } from "effect" import { Protocol } from "../../route/protocol.js" -import { LLMEvent, ProviderMetadata, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" +import { LLMEvent, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" import { ProviderShared } from "../shared.js" -const MetadataFields = { - provider_metadata: Schema.optional(ProviderMetadata), - providerMetadata: Schema.optional(ProviderMetadata), -} -const Envelope = Schema.StructWithRest(Schema.Struct(MetadataFields), [Schema.Record(Schema.String, Schema.Unknown)]) -const Event = Schema.StructWithRest( - Schema.Struct({ - ...MetadataFields, - message: Schema.optional(Envelope), - response: Schema.optional(Envelope), - choices: Schema.optional( - Schema.Array( - Schema.StructWithRest(Schema.Struct({ delta: Schema.optional(Envelope) }), [ - Schema.Record(Schema.String, Schema.Unknown), - ]), - ), - ), - }), - [Schema.Record(Schema.String, Schema.Unknown)], -) +const ProviderMetadata = Schema.Struct({ + provider_metadata: Schema.optional( + Schema.Struct({ gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) }), + ), +}) +const Metadata = Schema.Struct({ + ...ProviderMetadata.fields, + response: Schema.optional(ProviderMetadata), + choices: Schema.optional(Schema.Array(Schema.Struct({ delta: Schema.optional(ProviderMetadata) }))), +}) +const decodeMetadata = Schema.decodeUnknownOption(Schema.fromJsonString(Metadata)) -/** Retain gateway accounting/routing metadata without replacing the upstream parser's replay metadata. */ -export function gatewayProtocol( - protocol: Protocol, +export function gatewayProtocol( + protocol: Protocol, input: { readonly id: string - readonly from: (request: LLMRequest) => Effect.Effect, AIError> + readonly prepare: ( + request: LLMRequest, + ) => Effect.Effect<{ readonly request: LLMRequest; readonly body: Record }, AIError> }, ) { - const decode = Schema.decodeUnknownEffect(protocol.stream.event) + const decodeEvent = Schema.decodeUnknownEffect(protocol.stream.event) + const validateBody = ProviderShared.validateWith(Schema.decodeUnknownEffect(protocol.body.schema)) const initial = (request: LLMRequest) => ({ inner: protocol.stream.initial(request), - metadata: undefined as ProviderMetadata | undefined, + gateway: undefined as Record | undefined, }) const onHalt = protocol.stream.onHalt - const merge = (...items: ReadonlyArray): ProviderMetadata | undefined => { - const defined = items.filter((item) => item !== undefined) - if (defined.length === 0) return undefined - return Object.fromEntries( - Array.from(new Set(defined.flatMap((item) => Object.keys(item)))).map((key) => [ - key, - mergeJsonRecords(...defined.map((item) => item[key])) ?? {}, - ]), - ) - } - const enrich = (events: ReadonlyArray, metadata: ProviderMetadata | undefined) => - events.map((event) => - LLMEvent.is.finish(event) || LLMEvent.is.stepFinish(event) - ? { ...event, providerMetadata: merge(event.providerMetadata, metadata) } - : event, - ) + const withGateway = (events: ReadonlyArray, gateway: Record | undefined) => + gateway === undefined + ? events + : events.map((event) => + LLMEvent.is.finish(event) ? { ...event, providerMetadata: { ...event.providerMetadata, gateway } } : event, + ) + return Protocol.make({ id: input.id, body: { schema: Schema.Record(Schema.String, Schema.Unknown), - from: input.from, + from: Effect.fn("GatewayProtocol.body")(function* (request: LLMRequest) { + const prepared = yield* input.prepare(request) + const body = yield* protocol.body.from(prepared.request).pipe(Effect.flatMap(validateBody)) + return { ...body, ...prepared.body } + }), }, sanitizer: protocol.sanitizer, - // Gateway feature support is verified separately; do not inherit upstream-only chronological effort updates. stream: { - event: Schema.Union([Schema.Literal("[DONE]"), Protocol.jsonEvent(Event)]), + event: Schema.String, initial, - step: Effect.fn("GatewayProtocol.step")(function* ( - state: ReturnType, - event: typeof Event.Type | "[DONE]", - ) { - const decoded = yield* decode(event === "[DONE]" ? event : ProviderShared.encodeJson(event)).pipe( - Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", undefined, cause)), + step: Effect.fn("GatewayProtocol.step")(function* (state: ReturnType, frame: string) { + const event = yield* decodeEvent(frame).pipe( + Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", frame, cause)), ) - const metadata = - event === "[DONE]" - ? state.metadata - : merge( - state.metadata, - event.provider_metadata, - event.providerMetadata, - event.message?.provider_metadata, - event.message?.providerMetadata, - event.response?.provider_metadata, - event.response?.providerMetadata, - ...(event.choices ?? []).flatMap((choice) => [ - choice.delta?.provider_metadata, - choice.delta?.providerMetadata, - ]), + const metadata = decodeMetadata(frame) + const gateway = + metadata._tag === "None" + ? state.gateway + : mergeJsonRecords( + state.gateway, + metadata.value.provider_metadata?.gateway, + metadata.value.response?.provider_metadata?.gateway, + ...(metadata.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), ) - const result = yield* protocol.stream.step(state.inner, decoded) - return [{ inner: result[0], metadata }, enrich(result[1], metadata)] as const + const [inner, events] = yield* protocol.stream.step(state.inner, event) + return [{ inner, gateway }, withGateway(events, gateway)] as const }), - terminal: (event) => - event === "[DONE]" || - event.type === "response.completed" || - event.type === "response.incomplete" || - event.type === "response.failed", onHalt: onHalt - ? (state) => onHalt(state.inner).pipe(Effect.map((events) => enrich(events, state.metadata))) + ? (state) => onHalt(state.inner).pipe(Effect.map((events) => withGateway(events, state.gateway))) : undefined, }, }) diff --git a/packages/ai/src/providers/vercel-ai-gateway-options.ts b/packages/ai/src/providers/vercel-ai-gateway-options.ts index 1fda48533e82..fe56400496de 100644 --- a/packages/ai/src/providers/vercel-ai-gateway-options.ts +++ b/packages/ai/src/providers/vercel-ai-gateway-options.ts @@ -3,65 +3,37 @@ import type { AnthropicMessages } from "../protocols/anthropic-messages.js" import { ReasoningEffort } from "../schema/index.js" import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js" -/** Gateway routing controls are independent of the selected wire API. */ -const Credential = Schema.StructWithRest( - Schema.Struct({ - apiKey: Schema.optional(Schema.String), - resourceName: Schema.optional(Schema.String), - accessKeyId: Schema.optional(Schema.String), - secretAccessKey: Schema.optional(Schema.String), - region: Schema.optional(Schema.String), - project: Schema.optional(Schema.String), - location: Schema.optional(Schema.String), - googleCredentials: Schema.optional(Schema.Struct({ privateKey: Schema.String, clientEmail: Schema.String })), - modelMappings: Schema.optional( - Schema.Array(Schema.Struct({ gatewayModelSlug: Schema.String, customModelId: Schema.String })), - ), - }), - [Schema.Record(Schema.String, Schema.Unknown)], -) - -export const GatewayOptions = Schema.StructWithRest( - Schema.Struct({ - caching: Schema.optional(Schema.Literal("auto")), - only: Schema.optional(Schema.Array(Schema.String)), - order: Schema.optional(Schema.Array(Schema.String)), - sort: Schema.optional(Schema.String), - models: Schema.optional(Schema.Array(Schema.String)), - zeroDataRetention: Schema.optional(Schema.Boolean), - user: Schema.optional(Schema.String), - tags: Schema.optional(Schema.Array(Schema.String)), - byok: Schema.optional(Schema.Record(Schema.String, Schema.Array(Credential))), - inferenceRegion: Schema.optional(Schema.String), - providerTimeouts: Schema.optional( - Schema.Struct({ - byok: Schema.optional( - Schema.Record(Schema.String, Schema.Int.check(Schema.isBetween({ minimum: 1000, maximum: 789000 }))), - ), - }), - ), - }), - [Schema.Record(Schema.String, Schema.Unknown)], -) -export type GatewayOptions = typeof GatewayOptions.Type +export interface GatewayOptions { + readonly [key: string]: unknown + readonly caching?: "auto" + readonly only?: ReadonlyArray + readonly order?: ReadonlyArray + readonly sort?: string + readonly models?: ReadonlyArray + readonly zeroDataRetention?: boolean + readonly user?: string + readonly tags?: ReadonlyArray + readonly byok?: Readonly>>>> + readonly inferenceRegion?: string + readonly providerTimeouts?: { readonly byok?: Readonly> } +} export const Options = Schema.Struct({ - gateway: Schema.optional(GatewayOptions), + gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), reasoningEffort: Schema.optional(ReasoningEffort), - effort: Schema.optional(ReasoningEffort), - cacheTTL: Schema.optional(Schema.Literals(["5m", "1h"])), - cacheAnchorItems: Schema.optional(Schema.Int.check(Schema.isGreaterThan(0))), + cacheTTL: Schema.optional(Schema.String), + cacheAnchorItems: Schema.optional(Schema.Number), }) export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & - Pick & { + AnthropicMessages.OptionsInput & { readonly gateway?: GatewayOptions - /** AI SDK upstream settings, forwarded under their original provider namespace. */ + /** Upstream options forwarded under their Gateway provider namespace. */ readonly upstream?: Readonly>>> - /** Responses automatic-cache lifetime; not the lifetime of manually marked blocks. */ - readonly cacheTTL?: "5m" | "1h" - /** Responses input-item count, not a canonical message count. */ + /** Responses automatic-cache lifetime. */ + readonly cacheTTL?: "5m" | "1h" | (string & {}) + /** Number of stable Responses input items. */ readonly cacheAnchorItems?: number } diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index d4ea64de7585..a1455ae2cc15 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -8,33 +8,33 @@ import { EvaluationResponse, EvaluationRounding, } from "../experimental/evaluation.js" -import { Auth } from "../route/auth.js" -import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" -import { Route, type RouteDefaultsInput } from "../route/client.js" -import { Endpoint } from "../route/endpoint.js" import { AnthropicMessages } from "../protocols/anthropic-messages.js" -import { OpenAIResponses } from "../protocols/openai-responses.js" import { MetaResponses } from "../protocols/meta-responses.js" -import { XAIResponses } from "../protocols/xai-responses.js" -import { OpenResponses } from "../protocols/open-responses.js" import { OpenAIChat } from "../protocols/openai-chat.js" -import { cacheControl } from "../protocols/utils/cache.js" -import { gatewayProtocol } from "../protocols/utils/gateway-protocol.js" -import { VercelAIGatewayOptions, type ProviderOptionsInput } from "./vercel-ai-gateway-options.js" +import { OpenAIResponses } from "../protocols/openai-responses.js" +import { OpenResponses } from "../protocols/open-responses.js" import { ProviderShared } from "../protocols/shared.js" +import { gatewayProtocol } from "../protocols/utils/gateway-protocol.js" +import { XAIResponses } from "../protocols/xai-responses.js" import type { ProviderPackage } from "../provider-package.js" +import { Auth } from "../route/auth.js" +import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" +import { Route, type RouteDefaultsInput } from "../route/client.js" +import { Endpoint } from "../route/endpoint.js" +import { Framing } from "../route/framing.js" import { AIError, HttpContext, HttpOptions, InvalidProviderOutputError, InvalidRequestError, + LLMRequest, ModelID, ProviderID, ProviderMetadata, Usage, - LLMRequest, } from "../schema/index.js" +import { VercelAIGatewayOptions, type ProviderOptionsInput } from "./vercel-ai-gateway-options.js" export type { GatewayOptions, ProviderOptionsInput } from "./vercel-ai-gateway-options.js" @@ -59,173 +59,128 @@ export type Options = Omit & export type Settings = ProviderPackage.Settings & ProviderOptionsInput & { readonly apiKey?: string } const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(VercelAIGatewayOptions.Options)) +const ChatThinking = Schema.Union([ + Schema.Struct({ type: Schema.Literals(["adaptive", "disabled"]) }), + Schema.Struct({ type: Schema.Literal("enabled"), budgetTokens: Schema.Number }), +]) +const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) -const lower = Effect.fn("VercelAIGateway.lower")(function* ( - request: LLMRequest, - api: "messages" | "responses" | "chat", -) { - const options = yield* decodeOptions(request.providerOptions ?? {}) - if (api !== "responses" && (options.cacheTTL !== undefined || options.cacheAnchorItems !== undefined)) - return yield* ProviderShared.invalidRequest("cacheTTL and cacheAnchorItems require the Gateway Responses API") - if (api === "responses" && request.providerOptions?.thinking !== undefined) - return yield* ProviderShared.invalidRequest( - "Responses uses reasoningEffort; put native thinking settings under upstream", - ) - const chatReasoning = - api === "chat" && request.providerOptions?.thinking !== undefined - ? yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking))(request.providerOptions.thinking) - : undefined - const effective = options.reasoningEffort ?? options.effort - const normalized = LLMRequest.update(request, { - providerOptions: { - ...request.providerOptions, - ...(effective === undefined ? {} : { reasoningEffort: effective }), - ...(api === "messages" && effective !== undefined +const prepare = (api: "messages" | "responses" | "chat") => + Effect.fn("VercelAIGateway.prepare")(function* (request: LLMRequest) { + const options = yield* decodeOptions(request.providerOptions ?? {}) + const thinking = + api === "chat" && request.providerOptions?.thinking !== undefined + ? yield* decodeChatThinking(request.providerOptions.thinking) + : undefined + const effort = options.reasoningEffort + const providerOptions = + api === "messages" && effort !== undefined ? { - effort: effective === "none" ? undefined : effective, - thinking: - request.providerOptions?.thinking ?? (effective === "none" ? { type: "disabled" } : { type: "adaptive" }), + ...request.providerOptions, + effort: effort === "none" ? undefined : effort, + thinking: request.providerOptions?.thinking ?? { type: effort === "none" ? "disabled" : "adaptive" }, } - : {}), - }, + : request.providerOptions + return { + request: LLMRequest.update(request, { providerOptions }), + body: { + ...(thinking === undefined + ? {} + : { + reasoning: { + enabled: thinking.type !== "disabled", + ...(thinking.type === "enabled" ? { max_tokens: thinking.budgetTokens } : {}), + }, + }), + providerOptions: { + ...options.upstream, + gateway: { ...(request.cache === "none" ? {} : { caching: "auto" }), ...options.gateway }, + }, + ...(api === "responses" && options.cacheTTL !== undefined ? { cache_ttl: options.cacheTTL } : {}), + ...(api === "responses" && options.cacheAnchorItems !== undefined + ? { cache_anchor_items: options.cacheAnchorItems } + : {}), + }, + } }) - const body = yield* api === "messages" - ? AnthropicMessages.protocol.body - .from(normalized) - .pipe( - Effect.flatMap( - ProviderShared.validateWith(Schema.decodeUnknownEffect(AnthropicMessages.protocol.body.schema)), - ), - ) - : api === "chat" - ? OpenAIChat.fromRequest(normalized, { cacheControl: cacheControl() }).pipe( - Effect.flatMap(ProviderShared.validateWith(Schema.decodeUnknownEffect(OpenAIChat.protocol.body.schema))), - ) - : request.model.id.startsWith("meta/muse-") - ? MetaResponses.protocol.body.from(normalized) - : request.model.id.startsWith("xai/grok-") - ? XAIResponses.protocol.body.from(normalized) - : request.model.id.startsWith("openai/") - ? OpenAIResponses.protocol.body.from(normalized) - : OpenResponses.protocol.body.from(normalized) - const caching = request.cache === undefined || request.cache === "auto" ? "auto" : undefined - return { - ...body, - ...(chatReasoning !== undefined - ? { - reasoning: { - enabled: chatReasoning.type !== "disabled", - ...(chatReasoning.type === "enabled" ? { max_tokens: chatReasoning.budgetTokens } : {}), - }, - } - : {}), - providerOptions: { - ...options.upstream, - gateway: { ...(caching === undefined ? {} : { caching }), ...options.gateway }, - }, - ...(api === "responses" && options.cacheTTL !== undefined ? { cache_ttl: options.cacheTTL } : {}), - ...(api === "responses" && options.cacheAnchorItems !== undefined - ? { cache_anchor_items: options.cacheAnchorItems } - : {}), - } -}) -const ChatThinking = Schema.Union([ - Schema.Struct({ type: Schema.Literal("disabled") }), - Schema.Struct({ type: Schema.Literal("adaptive") }), - Schema.Struct({ type: Schema.Literal("enabled"), budgetTokens: Schema.Int.check(Schema.isGreaterThan(0)) }), -]) +const route = (input: { + readonly id: string + readonly protocol: Parameters>[0] + readonly api: "messages" | "responses" | "chat" + readonly path: string + readonly framing: typeof Framing.sse | typeof AnthropicMessages.framing | typeof OpenAIChat.framing + readonly defaults?: RouteDefaultsInput +}) => + Route.make({ + id: input.id, + provider: id, + providerMetadataKey: id, + protocol: gatewayProtocol(input.protocol, { id: input.id, prepare: prepare(input.api) }), + endpoint: Endpoint.path(input.path, { baseURL }), + framing: input.framing, + headers: ({ request }): Record => + request.promptCacheKey ? { "x-session-affinity": request.promptCacheKey } : {}, + defaults: input.defaults, + }) -const messagesProtocol = gatewayProtocol(AnthropicMessages.protocol, { +const responsesDefaults = { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } } +const messagesRoute = route({ id: "vercel-ai-gateway-messages", - from: (request) => lower(request, "messages"), -}) -const responsesProtocol = gatewayProtocol(OpenAIResponses.protocol, { - id: "vercel-ai-gateway-responses", - from: (request) => lower(request, "responses"), + protocol: AnthropicMessages.protocol, + api: "messages", + path: "/messages", + framing: AnthropicMessages.framing, + defaults: { headers: { "anthropic-version": "2023-06-01" } }, }) -const openResponsesProtocol = gatewayProtocol(OpenResponses.protocol, { - id: "vercel-ai-gateway-openresponses", - from: (request) => lower(request, "responses"), +const openAIResponsesRoute = route({ + id: "vercel-ai-gateway-openai-responses", + protocol: OpenAIResponses.protocol, + api: "responses", + path: "/responses", + framing: Framing.sse, + defaults: responsesDefaults, }) -const metaProtocol = gatewayProtocol(MetaResponses.protocol, { +const metaResponsesRoute = route({ id: "vercel-ai-gateway-meta-responses", - from: (request) => lower(request, "responses"), + protocol: MetaResponses.protocol, + api: "responses", + path: "/responses", + framing: Framing.sse, + defaults: responsesDefaults, }) -const xaiProtocol = gatewayProtocol(XAIResponses.protocol, { +const xaiResponsesRoute = route({ id: "vercel-ai-gateway-xai-responses", - from: (request) => lower(request, "responses"), -}) -const chatProtocol = gatewayProtocol(OpenAIChat.protocol, { - id: "vercel-ai-gateway-chat", - from: (request) => lower(request, "chat"), -}) - -const messagesRoute = Route.make({ - id: "vercel-ai-gateway-messages", - provider: id, - providerMetadataKey: "vercel-ai-gateway", - protocol: messagesProtocol, - endpoint: Endpoint.path("/messages", { baseURL }), - framing: AnthropicMessages.framing, - defaults: { headers: { "anthropic-version": "2023-06-01" } }, - headers: affinity, + protocol: XAIResponses.protocol, + api: "responses", + path: "/responses", + framing: Framing.sse, + defaults: responsesDefaults, }) -const responsesRoute = Route.make({ +const responsesRoute = route({ id: "vercel-ai-gateway-responses", - provider: id, - providerMetadataKey: "vercel-ai-gateway", - protocol: responsesProtocol, - endpoint: Endpoint.path("/responses", { baseURL }), - framing: OpenAIChat.framing, - defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, - headers: affinity, -}) -const metaRoute = Route.make({ - id: "vercel-ai-gateway-meta-responses", - provider: id, - providerMetadataKey: "vercel-ai-gateway", - protocol: metaProtocol, - endpoint: Endpoint.path("/responses", { baseURL }), - framing: OpenAIChat.framing, - defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, - headers: affinity, -}) -const openResponsesRoute = Route.make({ - id: "vercel-ai-gateway-openresponses", - provider: id, - providerMetadataKey: "vercel-ai-gateway", - protocol: openResponsesProtocol, - endpoint: Endpoint.path("/responses", { baseURL }), - framing: OpenAIChat.framing, + protocol: OpenResponses.protocol, + api: "responses", + path: "/responses", + framing: Framing.sse, defaults: { providerOptions: { store: false } }, - headers: affinity, }) -const xaiRoute = Route.make({ - id: "vercel-ai-gateway-xai-responses", - provider: id, - providerMetadataKey: "vercel-ai-gateway", - protocol: xaiProtocol, - endpoint: Endpoint.path("/responses", { baseURL }), - framing: OpenAIChat.framing, - defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, - headers: affinity, -}) -const chatRoute = Route.make({ +const chatRoute = route({ id: "vercel-ai-gateway-chat", - provider: id, - providerMetadataKey: "vercel-ai-gateway", - protocol: chatProtocol, - endpoint: Endpoint.path("/chat/completions", { baseURL }), + protocol: OpenAIChat.protocol, + api: "chat", + path: "/chat/completions", framing: OpenAIChat.framing, - headers: affinity, }) -function affinity({ request }: { readonly request: LLMRequest }): Record { - return request.promptCacheKey && request.cache !== "none" ? { "x-session-affinity": request.promptCacheKey } : {} -} - -export const routes = [messagesRoute, responsesRoute, openResponsesRoute, metaRoute, xaiRoute, chatRoute] +export const routes = [ + messagesRoute, + openAIResponsesRoute, + metaResponsesRoute, + xaiResponsesRoute, + responsesRoute, + chatRoute, +] const Request = Schema.StructWithRest( Schema.Struct({ @@ -253,30 +208,29 @@ export const configure = (input: Options = {}) => { const { apiKey: _apiKey, auth: _auth, baseURL: endpoint, ...defaults } = input const configured = { ...defaults, - endpoint: { baseURL: (endpoint ?? baseURL).replace(/\/$/, "").replace(/\/v1$/, "") + "/v1" }, + endpoint: { baseURL: endpoint ?? baseURL }, auth: AuthOptions.bearer(input, ["AI_GATEWAY_API_KEY", "VERCEL_OIDC_TOKEN"]), } const messages = (modelID: string | ModelID) => messagesRoute.with(configured).model({ id: modelID, + // Recorded Gateway translations for non-Claude models return thinking with empty signatures. compatibility: { requireSignature: modelID.startsWith("anthropic/") }, }) - const responses = (modelID: string | ModelID) => - (modelID.startsWith("meta/muse-") - ? metaRoute - : modelID.startsWith("xai/grok-") - ? xaiRoute - : modelID.startsWith("openai/") - ? responsesRoute - : openResponsesRoute - ) - .with(configured) - .model({ id: modelID }) + const responses = (modelID: string | ModelID) => { + const selected = modelID.startsWith("openai/") + ? openAIResponsesRoute + : modelID.startsWith("meta/") + ? metaResponsesRoute + : modelID.startsWith("xai/") + ? xaiResponsesRoute + : responsesRoute + return selected.with(configured).model({ id: modelID }) + } const chat = (modelID: string | ModelID) => - chatRoute.with(configured).model({ - id: modelID, - compatibility: { supportsPromptCacheKey: true, supportsStore: false, reasoningField: "reasoning" }, - }) + chatRoute + .with(configured) + .model({ id: modelID, compatibility: { reasoningField: "reasoning" } }) const model = (modelID: string | ModelID) => /^(openai\/gpt-|meta\/muse-|xai\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) const evaluation = (modelID: string | ModelID) => diff --git a/packages/ai/test/provider-options/vercel-ai-gateway.types.ts b/packages/ai/test/provider-options/vercel-ai-gateway.types.ts index 86d2233ba50c..ebe6dcae16f4 100644 --- a/packages/ai/test/provider-options/vercel-ai-gateway.types.ts +++ b/packages/ai/test/provider-options/vercel-ai-gateway.types.ts @@ -26,7 +26,5 @@ VercelAIGateway.configure({ upstream: { google: { thinkingConfig: { includeThoughts: true, thinkingBudget: 1024 } } }, }, }) -// @ts-expect-error Gateway caching has one supported mode. -VercelAIGateway.configure({ providerOptions: { gateway: { caching: "forever" } } }) // @ts-expect-error A thinking budget is numeric. VercelAIGateway.configure({ providerOptions: { thinking: { type: "enabled", budgetTokens: "many" } } }) diff --git a/packages/ai/test/provider/vercel-ai-gateway.test.ts b/packages/ai/test/provider/vercel-ai-gateway.test.ts index 42f686ee8b9e..eeb5d1c8c138 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.test.ts @@ -32,19 +32,6 @@ it.effect("Gateway defaults preserve full model IDs and select the requested fam }), ) -it.effect("Gateway selectors normalize host and version URLs without affecting custom paths", () => - Effect.gen(function* () { - for (const baseURL of ["https://gateway.test", "https://gateway.test/", "https://gateway.test/v1/"]) { - const gateway = VercelAIGateway.configure({ apiKey: "fixture", baseURL }) - for (const select of [gateway.messages, gateway.responses, gateway.chat]) { - const model = select("anthropic/claude-sonnet-4.6") - expect(model.route.endpoint.baseURL).toBe("https://gateway.test/v1") - yield* compileRequest(LLM.request({ model, prompt: "Hello" })) - } - } - }), -) - it.effect("Gateway keeps distinct system blocks, cache hints, and upstream-scoped controls", () => Effect.gen(function* () { const compiled = yield* compileRequest( @@ -97,26 +84,6 @@ it.effect("Gateway effort settings lower to the selected API", () => }), ) -it.effect("Gateway honors explicit cache policies without duplicating automatic markers", () => - Effect.gen(function* () { - const model = VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-4.6") - const automatic = yield* compileRequest(LLM.request({ model, system: "Stable", prompt: "Hello" })) - expect(automatic.body.system).toEqual([{ type: "text", text: "Stable" }]) - const explicit = yield* compileRequest( - LLM.request({ - model, - system: "Stable", - prompt: "Hello", - cache: { system: true, ttlSeconds: 3600 }, - }), - ) - expect(explicit.body.system).toEqual([ - { type: "text", text: "Stable", cache_control: { type: "ephemeral", ttl: "1h" } }, - ]) - expect(explicit.body.providerOptions).toEqual({ gateway: {} }) - }), -) - it.effect("Gateway Responses keeps cache-key and cache controls out of upstream namespaces", () => Effect.gen(function* () { const compiled = yield* compileRequest( @@ -129,14 +96,6 @@ it.effect("Gateway Responses keeps cache-key and cache controls out of upstream ) expect(compiled.body).toMatchObject({ prompt_cache_key: "opaque-session", cache_ttl: "1h", cache_anchor_items: 1 }) expect(compiled.body.providerOptions).toEqual({ gateway: { caching: "auto" } }) - const rejected = yield* compileRequest( - LLM.request({ - model: VercelAIGateway.configure({ apiKey: "fixture" }).messages("google/gemini-2.5-flash"), - prompt: "Hello", - providerOptions: { cacheTTL: "1h" }, - }), - ).pipe(Effect.result) - expect(rejected._tag).toBe("Failure") }), ) @@ -153,10 +112,7 @@ it.effect("Gateway Messages preserves signatures and billing metadata through to sseEvents( { type: "message_start", - message: { - usage: { input_tokens: 10, cache_read_input_tokens: 20 }, - provider_metadata: { gateway: { cost: "0.001", routing: { finalProvider: "bedrock" } } }, - }, + message: { usage: { input_tokens: 10, cache_read_input_tokens: 20 } }, }, { type: "content_block_start", @@ -170,7 +126,12 @@ it.effect("Gateway Messages preserves signatures and billing metadata through to content_block: { type: "tool_use", id: "tool_1", name: "lookup", input: {} }, }, { type: "content_block_stop", index: 1 }, - { type: "message_delta", delta: { stop_reason: "tool_use" }, usage: { output_tokens: 5 } }, + { + type: "message_delta", + delta: { stop_reason: "tool_use" }, + usage: { output_tokens: 5 }, + provider_metadata: { gateway: { cost: "0.001", routing: { finalProvider: "bedrock" } } }, + }, { type: "message_stop" }, ), { headers: { "content-type": "text/event-stream" } }, From 8e9e03bea4e6b4cbc1900a8035ce249cc73169d3 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 1 Oct 2026 22:35:52 -0500 Subject: [PATCH 03/19] test(ai): record Gateway with current models --- packages/ai/README.md | 16 ++++---- .../ai/src/providers/vercel-ai-gateway.ts | 4 +- ...-caches-distinct-claude-system-blocks.json | 10 ++--- ...inues-chat-claude-reasoning-and-tools.json | 10 ++--- ...s-messages-claude-reasoning-and-tools.json | 10 ++--- ...s-messages-gemini-reasoning-and-tools.json | 10 ++--- ...ues-responses-gpt-reasoning-and-tools.json | 10 ++--- ...es-responses-grok-reasoning-and-tools.json | 10 ++--- ...es-responses-muse-reasoning-and-tools.json | 8 ++-- ...ials-without-retryable-classification.json | 4 +- .../vercel-ai-gateway.types.ts | 4 +- .../vercel-ai-gateway.recorded.test.ts | 39 ++++++++++++------- .../test/provider/vercel-ai-gateway.test.ts | 24 ++++++------ 13 files changed, 85 insertions(+), 74 deletions(-) diff --git a/packages/ai/README.md b/packages/ai/README.md index c02162ea201a..33df72600586 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1300,22 +1300,22 @@ const gateway = VercelAIGateway.configure({ }, }) -gateway.model("anthropic/claude-sonnet-4.6") // Messages -gateway.model("openai/gpt-5-nano") // Responses +gateway.model("anthropic/claude-sonnet-5.5") // Messages +gateway.model("openai/gpt-6-luna") // Responses gateway.model("meta/muse-spark-1.3") // Responses -gateway.model("xai/grok-4.1-fast-reasoning") // Responses -gateway.chat("anthropic/claude-sonnet-4.6") // Explicit Chat override -gateway.responses("google/gemini-2.5-flash") // Explicit Responses override -gateway.messages("openai/gpt-5-nano") // Explicit Messages override +gateway.model("spacexai/grok-4.7") // Responses +gateway.chat("anthropic/claude-sonnet-5.5") // Explicit Chat override +gateway.responses("google/gemini-3.8-flash") // Explicit Responses override +gateway.messages("openai/gpt-6-luna") // Explicit Messages override ``` -Default routing sends `openai/gpt-*`, `meta/muse-*`, and `xai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. +Default routing sends `openai/gpt-*`, `meta/muse-*`, and `xai/grok-*` / `spacexai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. Set `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. ```ts LLM.request({ - model: gateway.messages("anthropic/claude-sonnet-4.6"), + model: gateway.messages("anthropic/claude-sonnet-5.5"), prompt: "Review this algorithm.", generation: { maxTokens: 4096 }, providerOptions: { thinking: { type: "enabled", budgetTokens: 2048 } }, diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index a1455ae2cc15..3a05a12aac9b 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -222,7 +222,7 @@ export const configure = (input: Options = {}) => { ? openAIResponsesRoute : modelID.startsWith("meta/") ? metaResponsesRoute - : modelID.startsWith("xai/") + : /^(xai|spacexai)\//.test(modelID) ? xaiResponsesRoute : responsesRoute return selected.with(configured).model({ id: modelID }) @@ -232,7 +232,7 @@ export const configure = (input: Options = {}) => { .with(configured) .model({ id: modelID, compatibility: { reasoningField: "reasoning" } }) const model = (modelID: string | ModelID) => - /^(openai\/gpt-|meta\/muse-|xai\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) + /^(openai\/gpt-|meta\/muse-|(xai|spacexai)\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) const evaluation = (modelID: string | ModelID) => EvaluationModel.make({ id: modelID, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json b/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json index d0f138fa4045..57eef89c16ad 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/automatically-caches-distinct-claude-system-blocks", - "recordedAt": "2026-10-02T02:43:51.540Z" + "recordedAt": "2026-10-02T03:35:45.000Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7Y66JVRQ88PYQ7P0GFEWW\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":3,\"output_tokens\":4,\"cache_creation_input_tokens\":4512,\"cache_creation\":{\"ephemeral_5m_input_tokens\":4512,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":3,\"cache_creation_input_tokens\":4512,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":4512,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\"},\"cacheCreationInputTokens\":4512,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790909028616,\"endTime\":1790909029976,\"providerRequestId\":\"req_011CfceBZ694B5LQ7hSk1nGD\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfceBZnKbmvJSs2eiQBfA\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"no_pin\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.016989\",\"marketCost\":\"0.016989\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.016989\",\"inferenceCost\":\"0.016989\",\"inputInferenceCost\":\"0.016929\",\"outputInferenceCost\":\"0.00006\",\"generationId\":\"gen_01M3X7Y66JVRQ88PYQ7P0GFEWW\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAX5N6B8Q6P0R5ZEDHMNST\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"output_tokens\":4,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912141016,\"endTime\":1790912142628,\"providerRequestId\":\"req_011Cfci8yumRY5gGtVjwuLa5\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci8zFrdMhFnCAUvii3G\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"no_pin\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0017014\",\"marketCost\":\"0.0017014\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0017014\",\"inferenceCost\":\"0.0017014\",\"inputInferenceCost\":\"0.0016614\",\"outputInferenceCost\":\"0.00004\",\"generationId\":\"gen_01M3XAX5N6B8Q6P0R5ZEDHMNST\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7Y7P6Y6G3CWZF4SASAMBF\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":3,\"output_tokens\":4,\"cache_read_input_tokens\":4512,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":3,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":4512,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\"},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790909030110,\"endTime\":1790909031544,\"providerRequestId\":\"req_011CfceBfa5ByuQuKQ1p1vRH\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfceBfvQrtjqajNiiHJSV\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"confirmed\",\"pinnedProvider\":\"anthropic\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0014226\",\"marketCost\":\"0.0014226\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0014226\",\"inferenceCost\":\"0.0014226\",\"inputInferenceCost\":\"0.0013626\",\"outputInferenceCost\":\"0.00006\",\"generationId\":\"gen_01M3X7Y7P6Y6G3CWZF4SASAMBF\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAX7CPB1H6DXYGEN0QC59B\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"output_tokens\":4,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912142769,\"endTime\":1790912145050,\"providerRequestId\":\"req_011Cfci97Sx57GBnQeURMvhn\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci97oH2F2WDCJKPbrcX\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"confirmed\",\"pinnedProvider\":\"anthropic\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0017014\",\"marketCost\":\"0.0017014\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0017014\",\"inferenceCost\":\"0.0017014\",\"inputInferenceCost\":\"0.0016614\",\"outputInferenceCost\":\"0.00004\",\"generationId\":\"gen_01M3XAX7CPB1H6DXYGEN0QC59B\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json index dad7c42d4ece..0880d5f86b18 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-chat-claude-reasoning-and-tools", - "recordedAt": "2026-10-02T02:42:04.727Z" + "recordedAt": "2026-10-02T03:35:31.909Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_completion_tokens\":2048,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"The user wants\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\" to know the weather in Paris. I\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\" to know the weather in Paris. I\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"'ll use the get_weather tool.\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"'ll use the get_weather tool.\",\"signature\":\"\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"reasoning\":\"\",\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"\",\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgB+7P81QYSDCL1v4HKm+UaAR7A0BoMpsWG9hdxt8gxDKdcIjAOwKCpp2Pzt3LN+RCw03So0sD3pEhLvZgxPeq8SJDk5H9bvCOwg0PB9PX4IB2phkoqWwl8PT4yYMLkrLrS5KmwEUnZoX3Uxpjambz5VJCGRtsDaj8VXEHy21ODPDcU4pBG7phiuAGwkw0By+kX7N8WMcoJFc56/RLj1d74QhCE6lxFu6x290FUBY4pypkYAQ==\",\"format\":\"anthropic-claude-v1\",\"index\":0}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Sure! Let me check the current weather in Paris for you.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"toolu_01FZQfjpZVbBRto4FhVXAct1\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"city\\\": \\\"Paris\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_infvwgx9cp\"}\n\ndata: {\"id\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\",\"object\":\"chat.completion.chunk\",\"created\":1790908922,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":623,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":94,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":24}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"claudeaws\",\"fallbacksAvailable\":[\"anthropic\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: claudeaws, anthropic, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908921805,\"endTime\":1790908923604,\"providerRequestId\":\"req_011Cfce3giZNyymtG8ycvDGn\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfce3hThfJANDpxVhXbCA\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.003279\",\"marketCost\":\"0.003279\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.003279\",\"inferenceCost\":\"0.003279\",\"inputInferenceCost\":\"0.001869\",\"outputInferenceCost\":\"0.00141\",\"generationId\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\"}}},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"prompt_tokens\":623,\"completion_tokens\":94,\"total_tokens\":717,\"cost\":0.003279,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":24,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.003279,\"gateway_cost\":0.003279},\"system_fingerprint\":\"fp_infvwgx9cp\",\"generationId\":\"gen_01M3X7TXW6WWE2FEFE8GYRDMCJ\"}\n\ndata: [DONE]\n\n" + "body": "data: {\"id\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\",\"object\":\"chat.completion.chunk\",\"created\":1790912130,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_9rbv9d39c7\"}\n\ndata: {\"id\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\",\"object\":\"chat.completion.chunk\",\"created\":1790912130,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_9rbv9d39c7\"}\n\ndata: {\"id\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\",\"object\":\"chat.completion.chunk\",\"created\":1790912130,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"city\\\": \\\"Paris\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_9rbv9d39c7\"}\n\ndata: {\"id\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\",\"object\":\"chat.completion.chunk\",\"created\":1790912130,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_9rbv9d39c7\"}\n\ndata: {\"id\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\",\"object\":\"chat.completion.chunk\",\"created\":1790912130,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":420,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"bedrock\",\"vertexAnthropic\"],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. System credentials planned for: anthropic, claudeaws, bedrock, vertexAnthropic. Total execution order: anthropic(system) → claudeaws(system) → bedrock(system) → vertexAnthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912129901,\"endTime\":1790912130999,\"providerRequestId\":\"req_011Cfci8AT17gzqZn2jJEXeT\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci8AtJRw1vue5qnmohn\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00134\",\"marketCost\":\"0.00134\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00134\",\"inferenceCost\":\"0.00134\",\"inputInferenceCost\":\"0.00084\",\"outputInferenceCost\":\"0.0005\",\"generationId\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\"}}},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"prompt_tokens\":420,\"completion_tokens\":50,\"total_tokens\":470,\"cost\":0.00134,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.00134,\"gateway_cost\":0.00134},\"system_fingerprint\":\"fp_9rbv9d39c7\",\"generationId\":\"gen_01M3XAWTT89S61AZ5BSE3W3SA9\"}\n\ndata: [DONE]\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"Sure! Let me check the current weather in Paris for you.\",\"tool_calls\":[{\"id\":\"toolu_01FZQfjpZVbBRto4FhVXAct1\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning_details\":[{\"type\":\"reasoning.text\",\"text\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"format\":\"anthropic-claude-v1\",\"index\":0,\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgB+7P81QYSDCL1v4HKm+UaAR7A0BoMpsWG9hdxt8gxDKdcIjAOwKCpp2Pzt3LN+RCw03So0sD3pEhLvZgxPeq8SJDk5H9bvCOwg0PB9PX4IB2phkoqWwl8PT4yYMLkrLrS5KmwEUnZoX3Uxpjambz5VJCGRtsDaj8VXEHy21ODPDcU4pBG7phiuAGwkw0By+kX7N8WMcoJFc56/RLj1d74QhCE6lxFu6x290FUBY4pypkYAQ==\"}],\"reasoning\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\"},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01FZQfjpZVbBRto4FhVXAct1\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"max_completion_tokens\":2048,\"reasoning\":{\"enabled\":true,\"max_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"\"},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "data: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_5s966xdefo\"}\n\ndata: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Paris\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_5s966xdefo\"}\n\ndata: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\" is sunny.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_5s966xdefo\"}\n\ndata: {\"id\":\"gen_01M3X7TZT9997WWR189MSKK5MY\",\"object\":\"chat.completion.chunk\",\"created\":1790908924,\"model\":\"anthropic/claude-sonnet-4.6\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":738,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":7,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: anthropic, claudeaws, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908923773,\"endTime\":1790908924730,\"providerRequestId\":\"req_011Cfce3qBYhrY5vvrBgPpJG\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfce3qoWJjHwqPgYSXkBq\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.002319\",\"marketCost\":\"0.002319\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.002319\",\"inferenceCost\":\"0.002319\",\"inputInferenceCost\":\"0.002214\",\"outputInferenceCost\":\"0.000105\",\"generationId\":\"gen_01M3X7TZT9997WWR189MSKK5MY\"}}},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":738,\"completion_tokens\":7,\"total_tokens\":745,\"cost\":0.002319,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.002319,\"gateway_cost\":0.002319},\"system_fingerprint\":\"fp_5s966xdefo\",\"generationId\":\"gen_01M3X7TZT9997WWR189MSKK5MY\"}\n\ndata: [DONE]\n\n" + "body": "data: {\"id\":\"gen_01M3XAWW1EQYN8E229MXPGQ69V\",\"object\":\"chat.completion.chunk\",\"created\":1790912131,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_deco7uk6x4\"}\n\ndata: {\"id\":\"gen_01M3XAWW1EQYN8E229MXPGQ69V\",\"object\":\"chat.completion.chunk\",\"created\":1790912131,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Paris is sunny.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_deco7uk6x4\"}\n\ndata: {\"id\":\"gen_01M3XAWW1EQYN8E229MXPGQ69V\",\"object\":\"chat.completion.chunk\",\"created\":1790912131,\"model\":\"anthropic/claude-sonnet-5.5\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":493,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"bedrock\",\"vertexAnthropic\"],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. System credentials planned for: anthropic, claudeaws, bedrock, vertexAnthropic. Total execution order: anthropic(system) → claudeaws(system) → bedrock(system) → vertexAnthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912131152,\"endTime\":1790912131960,\"providerRequestId\":\"req_011Cfci8FjVzcog3yJtTFw81\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci8G5pr3sikiEmpeSSo\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.001086\",\"marketCost\":\"0.001086\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.001086\",\"inferenceCost\":\"0.001086\",\"inputInferenceCost\":\"0.000986\",\"outputInferenceCost\":\"0.0001\",\"generationId\":\"gen_01M3XAWW1EQYN8E229MXPGQ69V\"}}},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":493,\"completion_tokens\":10,\"total_tokens\":503,\"cost\":0.001086,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":0,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.001086,\"gateway_cost\":0.001086},\"system_fingerprint\":\"fp_deco7uk6x4\",\"generationId\":\"gen_01M3XAWW1EQYN8E229MXPGQ69V\"}\n\ndata: [DONE]\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json index 8780fb2b444b..d6a74be9a2b5 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-messages-claude-reasoning-and-tools", - "recordedAt": "2026-10-02T02:41:10.004Z" + "recordedAt": "2026-10-02T03:35:13.499Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7S7P4KNZXH16ZH2P5D0AV\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"The user wants\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" to know the weather in Paris. I'll use the get_weather tool.\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"signature_delta\",\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgBxLP81QYSDOEX5k4DrHPqTBRqPBoM9SvPOUL6/F1RW4ZjIjD2mSygL1r6KDWAaXN1Zb4szwebG01H6kEYKJ1WL0on5CvHGYcFKhis7Xok6MmqqjEqW7yaP068H2EiK4nrQSlYZt9ASOft9Qz7fSSTY45YIPj0yaJxHJMLZ6BCVnzTcZPFR9c+TEwgk2PCpjqEfFaUv+QiQ4+/W1xcuI4VCVlGBxec8ufHZe5MU2HLsX8YAQ==\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"Sure! Let me check the weather in Paris for you!\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":2,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01YA4k9TRWr1YQJDPxivgeqL\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\": \\\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":2}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":623,\"output_tokens\":93,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":623,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":93,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":24}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"claudeaws\",\"fallbacksAvailable\":[\"anthropic\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: claudeaws, anthropic, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908867155,\"endTime\":1790908869003,\"providerRequestId\":\"req_011CfcdyerKwqNiFkuW7jC2P\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfcdyfjufFuzf8f2sjePk\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.003264\",\"marketCost\":\"0.003264\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.003264\",\"inferenceCost\":\"0.003264\",\"inputInferenceCost\":\"0.001869\",\"outputInferenceCost\":\"0.001395\",\"generationId\":\"gen_01M3X7S7P4KNZXH16ZH2P5D0AV\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAW7ZD2NKJ3EJK6TDJZ2Y7\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011X7KQPt2EPYDcB88u73nKT\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\": \\\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":420,\"output_tokens\":50,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":420,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"bedrock\",\"vertexAnthropic\"],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. System credentials planned for: anthropic, claudeaws, bedrock, vertexAnthropic. Total execution order: anthropic(system) → claudeaws(system) → bedrock(system) → vertexAnthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912110619,\"endTime\":1790912111857,\"providerRequestId\":\"req_011Cfci6jzKJmMtckpt31maZ\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci6kek3VBu4ibLAJGcU\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00134\",\"marketCost\":\"0.00134\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00134\",\"inferenceCost\":\"0.00134\",\"inputInferenceCost\":\"0.00084\",\"outputInferenceCost\":\"0.0005\",\"generationId\":\"gen_01M3XAW7ZD2NKJ3EJK6TDJZ2Y7\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"The user wants to know the weather in Paris. I'll use the get_weather tool.\",\"signature\":\"EvYCCsgBCBIYAipAjKnRKpxkZ4eHrMPJ63IWEOYPSzb+XSHyG+vLK+2ks2O9T4N9M37Xn2kausQSH1rfsrdmKxgUlBg6yUFRgMVR7DIRY2xhdWRlLXNvbm5ldC00LTY4AEIIdGhpbmtpbmdaJDE5YTNjMDNiLWJmOGYtNDA2NC05MzdjLTg1ZjFlZjk0MDkzNHoedXByb2ZfMDExQ2Q4bUcxbmRaWThIUGFLTXl5NVNFmgETChFjbGF1ZGUtc29ubmV0LTQtNqgBxLP81QYSDOEX5k4DrHPqTBRqPBoM9SvPOUL6/F1RW4ZjIjD2mSygL1r6KDWAaXN1Zb4szwebG01H6kEYKJ1WL0on5CvHGYcFKhis7Xok6MmqqjEqW7yaP068H2EiK4nrQSlYZt9ASOft9Qz7fSSTY45YIPj0yaJxHJMLZ6BCVnzTcZPFR9c+TEwgk2PCpjqEfFaUv+QiQ4+/W1xcuI4VCVlGBxec8ufHZe5MU2HLsX8YAQ==\"},{\"type\":\"text\",\"text\":\"Sure! Let me check the weather in Paris for you!\"},{\"type\":\"tool_use\",\"id\":\"toolu_01YA4k9TRWr1YQJDPxivgeqL\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_01YA4k9TRWr1YQJDPxivgeqL\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011X7KQPt2EPYDcB88u73nKT\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_011X7KQPt2EPYDcB88u73nKT\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7SAFEX1HW56NRSZTMFHP9\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-4.6\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":737,\"output_tokens\":7,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":737,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":7,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-4.6\",\"resolvedProvider\":\"claudeaws\",\"fallbacksAvailable\":[\"anthropic\",\"vertexAnthropic\",\"bedrock\"],\"planningReasoning\":\"Weighted tie pick: claudeaws won tier 0 over anthropic. System credentials planned for: claudeaws, anthropic, vertexAnthropic, bedrock. Total execution order: claudeaws(system) → anthropic(system) → vertexAnthropic(system) → bedrock(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"finalProvider\":\"claudeaws\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-4.6\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"claudeaws\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908869133,\"endTime\":1790908870008,\"providerRequestId\":\"req_011CfcdyoTkYvsQ2LD7r8D1u\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfcdyp3iwVCXxFZNuVX8i\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.002316\",\"marketCost\":\"0.002316\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.002316\",\"inferenceCost\":\"0.002316\",\"inputInferenceCost\":\"0.002211\",\"outputInferenceCost\":\"0.000105\",\"generationId\":\"gen_01M3X7SAFEX1HW56NRSZTMFHP9\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAW9EQZ6HHBK5J1Y1VATAH\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":493,\"output_tokens\":10,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":493,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"bedrock\",\"vertexAnthropic\"],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. System credentials planned for: anthropic, claudeaws, bedrock, vertexAnthropic. Total execution order: anthropic(system) → claudeaws(system) → bedrock(system) → vertexAnthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912112646,\"endTime\":1790912113533,\"providerRequestId\":\"req_011Cfci6tdTiPKqAhS4mbNEJ\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci6u3mugVhTFZWBjibo\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.001086\",\"marketCost\":\"0.001086\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.001086\",\"inferenceCost\":\"0.001086\",\"inputInferenceCost\":\"0.000986\",\"outputInferenceCost\":\"0.0001\",\"generationId\":\"gen_01M3XAW9EQZ6HHBK5J1Y1VATAH\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json index 87f9cba592de..c54941ba0df8 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-messages-gemini-reasoning-and-tools", - "recordedAt": "2026-10-02T02:41:12.275Z" + "recordedAt": "2026-10-02T03:35:15.999Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"google/gemini-2.5-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"google/gemini-3.8-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7SBEGKTZ127JKTQH5ETXQ\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"google/gemini-2.5-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"**Fetching Weather Information**\\n\\nI'm focusing on retrieving Paris's weather. I've identified the `get_weather` tool and will set the city to 'Paris'. Following the tool's execution, I'll present the specific response: \\\"Paris is sunny.\\\"\\n\\n\"}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"signature_delta\",\"signature\":\"CiwBjz1rX80VzoN/eWSik0eiEcNO/PcG2yjqmp45W3geMIru6xS6QmvS5PjQHgpoAY89a1/boZwQbUXiM8oVMlAN5jpJvFml9b7nZP87z/pBo1Oxrfp5rEqUyWmZM9VFkeAxjQi8HnFviL5bl/EUjmfgU0aKKbOCd9hLvdvXFbaSBnm2caSUtEg5qiX8c3h8mPcfUPagXaEKggEBjz1rXzKilL2SFBnApdbIowWHUplTJQsqXytZV9ox5gGftaEvMSDeDDo/pi1nAQg74kDLXLUwITAP44ZmkVzACY9cumuj8MRqq9DmqphV0ojnN0oRc6JwGjj4hoIlfaxxT5RV5Td5hbeZ5/+NN7+jfINk72bjayBaKtVhwCwB4irVCnIBjz1rXyY3M5fsZkCfn39MKMllPSQk/g98gH0Gx4LtMbzDQ8ZNverS/62FUzX1EoGD70ju6zQg+MNO2CDqAdfaVW0lD9oWGKpobgczKE22yi+9AgEl8UMuM/I9A6qa3/auuqoDXAYC/9hVRqR0ApxJQUs=\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":2,\"content_block\":{\"type\":\"tool_use\",\"id\":\"36iwqhwSe4xJCtdc\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":2}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":42,\"output_tokens\":66},\"provider_metadata\":{\"vertex\":{\"promptFeedback\":null,\"groundingMetadata\":null,\"urlContextMetadata\":null,\"safetyRatings\":null,\"usageMetadata\":{\"thoughtsTokenCount\":61,\"promptTokenCount\":42,\"candidatesTokenCount\":5,\"totalTokenCount\":108,\"trafficType\":\"ON_DEMAND\",\"promptTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":42}],\"candidatesTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":5}]},\"finishMessage\":null,\"serviceTier\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"google/gemini-2.5-flash\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[\"google\"],\"planningReasoning\":\"System credentials planned for: vertex, google. Total execution order: vertex(system) → google(system)\",\"canonicalSlug\":\"google/gemini-2.5-flash\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"google/gemini-2.5-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908870139,\"endTime\":1790908871432,\"statusCode\":200,\"providerResponseId\":\"xhm_atjxD-PUle0PovGE8Ao\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0001776\",\"marketCost\":\"0.0001776\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0001776\",\"inferenceCost\":\"0.0001776\",\"inputInferenceCost\":\"0.0000126\",\"outputInferenceCost\":\"0.000165\",\"generationId\":\"gen_01M3X7SBEGKTZ127JKTQH5ETXQ\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAWAZ6J0VZ2XBQD2GHA031\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"google/gemini-3.8-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"signature_delta\",\"signature\":\"AY89a19bLXkNRJcCTLXJhlklpdU5hxo3vEit19RMmh8bC8Jm2SmGq6E5NZdq177AdJfOKRYxZkFuEaJ/ngpxoqLeB47ZMMK4VSZD2lhRbfFR6S8bITZ1\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"tool_use\",\"id\":\"call_355115\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":52,\"output_tokens\":16},\"provider_metadata\":{\"vertex\":{\"promptFeedback\":null,\"groundingMetadata\":null,\"urlContextMetadata\":null,\"safetyRatings\":null,\"usageMetadata\":{\"promptTokenCount\":52,\"candidatesTokenCount\":16,\"totalTokenCount\":68,\"trafficType\":\"ON_DEMAND\",\"promptTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":52}],\"candidatesTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":16}]},\"finishMessage\":null,\"serviceTier\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"google/gemini-3.8-flash\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[\"google\"],\"planningReasoning\":\"System credentials planned for: vertex, google. Total execution order: vertex(system) → google(system)\",\"canonicalSlug\":\"google/gemini-3.8-flash\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"google/gemini-3.8-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912113658,\"endTime\":1790912114756,\"statusCode\":200,\"providerResponseId\":\"cSa_avLEL-zFiLsP5L_a4Ak\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.000099\",\"marketCost\":\"0.000099\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.000099\",\"inferenceCost\":\"0.000099\",\"inputInferenceCost\":\"0.000039\",\"outputInferenceCost\":\"0.00006\",\"generationId\":\"gen_01M3XAWAZ6J0VZ2XBQD2GHA031\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"google/gemini-2.5-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"**Fetching Weather Information**\\n\\nI'm focusing on retrieving Paris's weather. I've identified the `get_weather` tool and will set the city to 'Paris'. Following the tool's execution, I'll present the specific response: \\\"Paris is sunny.\\\"\\n\\n\",\"signature\":\"\"},{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"CiwBjz1rX80VzoN/eWSik0eiEcNO/PcG2yjqmp45W3geMIru6xS6QmvS5PjQHgpoAY89a1/boZwQbUXiM8oVMlAN5jpJvFml9b7nZP87z/pBo1Oxrfp5rEqUyWmZM9VFkeAxjQi8HnFviL5bl/EUjmfgU0aKKbOCd9hLvdvXFbaSBnm2caSUtEg5qiX8c3h8mPcfUPagXaEKggEBjz1rXzKilL2SFBnApdbIowWHUplTJQsqXytZV9ox5gGftaEvMSDeDDo/pi1nAQg74kDLXLUwITAP44ZmkVzACY9cumuj8MRqq9DmqphV0ojnN0oRc6JwGjj4hoIlfaxxT5RV5Td5hbeZ5/+NN7+jfINk72bjayBaKtVhwCwB4irVCnIBjz1rXyY3M5fsZkCfn39MKMllPSQk/g98gH0Gx4LtMbzDQ8ZNverS/62FUzX1EoGD70ju6zQg+MNO2CDqAdfaVW0lD9oWGKpobgczKE22yi+9AgEl8UMuM/I9A6qa3/auuqoDXAYC/9hVRqR0ApxJQUs=\"},{\"type\":\"tool_use\",\"id\":\"36iwqhwSe4xJCtdc\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"36iwqhwSe4xJCtdc\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"enabled\",\"budget_tokens\":1024},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"google/gemini-3.8-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"AY89a19bLXkNRJcCTLXJhlklpdU5hxo3vEit19RMmh8bC8Jm2SmGq6E5NZdq177AdJfOKRYxZkFuEaJ/ngpxoqLeB47ZMMK4VSZD2lhRbfFR6S8bITZ1\"},{\"type\":\"tool_use\",\"id\":\"call_355115\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_355115\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3X7SCWJ23M3CM66XMANB662\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"google/gemini-2.5-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":184,\"output_tokens\":4},\"provider_metadata\":{\"vertex\":{\"promptFeedback\":null,\"groundingMetadata\":null,\"urlContextMetadata\":null,\"safetyRatings\":null,\"usageMetadata\":{\"promptTokenCount\":184,\"candidatesTokenCount\":4,\"totalTokenCount\":188,\"trafficType\":\"ON_DEMAND\",\"promptTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":184}],\"candidatesTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":4}]},\"finishMessage\":null,\"serviceTier\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"google/gemini-2.5-flash\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[\"google\"],\"planningReasoning\":\"System credentials planned for: vertex, google. Total execution order: vertex(system) → google(system)\",\"canonicalSlug\":\"google/gemini-2.5-flash\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"google/gemini-2.5-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908871639,\"endTime\":1790908872278,\"statusCode\":200,\"providerResponseId\":\"xxm_aoTFMbyqw8cPrM69oAY\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000652\",\"marketCost\":\"0.0000652\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000652\",\"inferenceCost\":\"0.0000652\",\"inputInferenceCost\":\"0.0000552\",\"outputInferenceCost\":\"0.00001\",\"generationId\":\"gen_01M3X7SCWJ23M3CM66XMANB662\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAWC57YKVKCYGSHBPW86GH\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"google/gemini-3.8-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\" sunny.\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":83,\"output_tokens\":4},\"provider_metadata\":{\"vertex\":{\"promptFeedback\":null,\"groundingMetadata\":null,\"urlContextMetadata\":null,\"safetyRatings\":null,\"usageMetadata\":{\"promptTokenCount\":83,\"candidatesTokenCount\":4,\"totalTokenCount\":87,\"trafficType\":\"ON_DEMAND\",\"promptTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":83}],\"candidatesTokensDetails\":[{\"modality\":\"TEXT\",\"tokenCount\":4}]},\"finishMessage\":null,\"serviceTier\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"google/gemini-3.8-flash\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[\"google\"],\"planningReasoning\":\"System credentials planned for: vertex, google. Total execution order: vertex(system) → google(system)\",\"canonicalSlug\":\"google/gemini-3.8-flash\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"google/gemini-3.8-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912114880,\"endTime\":1790912116051,\"statusCode\":200,\"providerResponseId\":\"cia_auGLOt3Mw8cPopm3wAY\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00007725\",\"marketCost\":\"0.00007725\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00007725\",\"inferenceCost\":\"0.00007725\",\"inputInferenceCost\":\"0.00006225\",\"outputInferenceCost\":\"0.000015\",\"generationId\":\"gen_01M3XAWC57YKVKCYGSHBPW86GH\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json index bd81f8a1b2de..2b372419bbb1 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-responses-gpt-reasoning-and-tools", - "recordedAt": "2026-10-02T02:41:14.510Z" + "recordedAt": "2026-10-02T03:35:17.693Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"openai/gpt-5-nano\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"openai/gpt-6-luna\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\",\"object\":\"response\",\"created_at\":1790908872,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\",\"object\":\"response\",\"created_at\":1790908872,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[],\"encrypted_content\":\"gAAAAABqvxnISO9uEqQqvoRwb2VV7NSbqFhZzxuJyq2-anC828BdRqBBOJooDqYoz5u4n3OAlgvITKnIEfFrPDiRiIO9yM7WvgcqV8IzHMx85Tn4DLFsrfi7CF6aHQMs_jQaWrh5BClhhWyd7-UbVFb3tfXXI1E5BXRdHNXwwjC_oIDO52XY5EZkLUQ2xoln_Iq5XUQi1vL4ygDCW-eZeDdJbI8P8ES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"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"{\\\"\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":8,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"city\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":9,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"\\\":\\\"\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":10,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"Paris\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"delta\":\"\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":12,\"item_id\":\"fc_1790908873569_ofzunox8p7g\",\"output_index\":1,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":13,\"output_index\":1,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":14,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"gAAAAABqvxnJ06ebl4J7SrbSSuIlZxC4T4VuhVnFIGrFyAY0mmttxVsngBuy-6zKZMSfdpdl5BZ3sr8znFnvaNRyxj1u_iiwBpQLXPXxx721Mi-XRJEgDSUBuDuPcgQgZe22jkEGqFGNXUailrL82aECa3kkDbVMnq1tLwi0o76XmH_raR9xNdxw6UU9rffP0BbMVcy-kE6jcY_6t2TsWr5yPc73XMak1q6mmVeiBhbabWmYH--mE9X-_Pv0JYSR8m3Yq7Ix9yuaTJmCi35VDVE31GCKFbhuTR_bs6XF94oyvsS3dhaLv3VA--lNO82-5LavpdVqVoAF8l74psptq-SPLNdO5YNsb3rH8k-QAxVWI-eB3fMqQP9YxXHgdaoBKacZLa-h4ZMq5CQV6hgr3eCyuyzRlHQ_3sQQu_-9PIWyeaTf8JqxAH4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2xQ96nKMLmLCz6T3G_QzG4oufZJm4WQwex4lpSyhjWJ_fP49e9shsL41Ed0GMD9NMHrrvMTE0kSa9YQDt6d7qkQhzUQtyX1f0fCb1Esc4CXZyGrOhgcZY5_RM19AmdfUDzczpb8FbGSGMoSw2rAn1zzUlIKZnDj7Ixx3lmFi4cGu8gb2cX7fNEX7vD_H06brwQZDkJAEAeIXUCgifUqpxP_Jg6UiEYHL0fBVYmC6D0owxn2PUYqcT7vcVyqfa6a1S_8PCbR6kAWYOpIm0M5oS7pkful6HvLRTx1o-LACdpkGIDLNsNvXzYXtjNu2VEiWcpSo1B-mJqP7OYfZm_3lMhvjGWVkvWidr_NiPxe2ZaOkR0KRoftR4LClF3bd8jTRoXCsygB6fdOb25jC7nvi00ezZMfaMU_CHZxuSwnpa5Mu4FZ_gy-bybcT8YwcRaGiUUTi4dd7FeIr6IiFKxVBLXUqcwSA=\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":15,\"response\":{\"id\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\",\"object\":\"response\",\"created_at\":1790908872,\"status\":\"completed\",\"completed_at\":1790908873,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"gAAAAABqvxnJ06ebl4J7SrbSSuIlZxC4T4VuhVnFIGrFyAY0mmttxVsngBuy-6zKZMSfdpdl5BZ3sr8znFnvaNRyxj1u_iiwBpQLXPXxx721Mi-XRJEgDSUBuDuPcgQgZe22jkEGqFGNXUailrL82aECa3kkDbVMnq1tLwi0o76XmH_raR9xNdxw6UU9rffP0BbMVcy-kE6jcY_6t2TsWr5yPc73XMak1q6mmVeiBhbabWmYH--mE9X-_Pv0JYSR8m3Yq7Ix9yuaTJmCi35VDVE31GCKFbhuTR_bs6XF94oyvsS3dhaLv3VA--lN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FqZ19NFahoLTp23G32NkGXk0qYz3pFlX_X1pRpXXUVd2vrO6Ss7FHRfL9OE0QK8h1TMzbvL-ybHNKga9IqcnyLo1AORTcgzExJfDkHDTZxwd6WNurjhBigoAysF8gqG2xQ96nKMLmLCz6T3G_QzG4oufZJm4WQwex4lpSyhjWJ_fP49e9shsL41Ed0GMD9NMHrrvMTE0kSa9YQDt6d7qkQhzUQtyX1f0fCb1Esc4CXZyGrOhgcZY5_RM19AmdfUDzczpb8FbGSGMoSw2rAn1zzUlIKZnDj7Ixx3lmFi4cGu8gb2cX7fNEX7vD_H06brwQZDkJAEAeIXUCgifUqpxP_Jg6UiEYHL0fBVYmC6D0owxn2PUYqcT7vcVyqfa6a1S_8PCbR6kAWYOpIm0M5oS7pkful6HvLRTx1o-LACdpkGIDLNsNvXzYXtjNu2VEiWcpSo1B-mJqP7OYfZm_3lMhvjGWVkvWidr_NiPxe2ZaOkR0KRoftR4LClF3bd8jTRoXCsygB6fdOb25jC7nvi00ezZMfaMU_CHZxuSwnpa5Mu4FZ_gy-bybcT8YwcRaGiUUTi4dd7FeIr6IiFKxVBLXUqcwSA=\"},{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":74,\"output_tokens\":126,\"total_tokens\":200,\"input_tokens_details\":{\"cached_tokens\":0,\"cache_write_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":64}},\"model\":\"gpt-5-nano-2025-08-07\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_00c73043b2e92f54016abf19c8781c87d188290ad958f519b0\",\"serviceTier\":\"default\",\"reasoningContext\":\"current_turn\"},\"gateway\":{\"routing\":{\"originalModelId\":\"openai/gpt-5-nano\",\"resolvedProvider\":\"openai\",\"fallbacksAvailable\":[\"azure\"],\"planningReasoning\":\"System credentials planned for: openai, azure. Total execution order: openai(system) → azure(system)\",\"canonicalSlug\":\"openai/gpt-5-nano\",\"finalProvider\":\"openai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"openai/gpt-5-nano\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"openai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908872406,\"endTime\":1790908873695,\"providerRequestId\":\"req_69437ce1c26449ca96dc0645134389f3\",\"statusCode\":200,\"providerResponseId\":\"resp_00c73043b2e92f54016abf19c8781c87d188290ad958f519b0\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000541\",\"marketCost\":\"0.0000541\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000541\",\"inferenceCost\":\"0.0000541\",\"inputInferenceCost\":\"0.0000037\",\"outputInferenceCost\":\"0.0000504\",\"generationId\":\"gen_01M3X7SDN3RAEVG5C26QDGC3P9\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWDCYY5RT4HEEH7PRA60S\",\"object\":\"response\",\"created_at\":1790912116,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-6-luna\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWDCYY5RT4HEEH7PRA60S\",\"object\":\"response\",\"created_at\":1790912116,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-6-luna\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912116805_gjpiv08fad6\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_1790912116805_gjpiv08fad6\",\"output_index\":0,\"delta\":\"{\\\"\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":4,\"item_id\":\"fc_1790912116805_gjpiv08fad6\",\"output_index\":0,\"delta\":\"city\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":5,\"item_id\":\"fc_1790912116805_gjpiv08fad6\",\"output_index\":0,\"delta\":\"\\\":\\\"\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":6,\"item_id\":\"fc_1790912116805_gjpiv08fad6\",\"output_index\":0,\"delta\":\"Paris\"}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":7,\"item_id\":\"fc_1790912116805_gjpiv08fad6\",\"output_index\":0,\"delta\":\"\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":8,\"item_id\":\"fc_1790912116805_gjpiv08fad6\",\"output_index\":0,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":9,\"output_index\":0,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912116805_gjpiv08fad6\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":10,\"response\":{\"id\":\"gen_01M3XAWDCYY5RT4HEEH7PRA60S\",\"object\":\"response\",\"created_at\":1790912116,\"status\":\"completed\",\"completed_at\":1790912116,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"function_call\",\"id\":\"fc_1790912116805_gjpiv08fad6\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":74,\"output_tokens\":18,\"total_tokens\":92,\"input_tokens_details\":{\"cached_tokens\":0,\"cache_write_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"gpt-6-luna\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_00f283291bb6009d016abf26743f0c87d1a9732d3e4a334cd2\",\"serviceTier\":\"default\",\"reasoningContext\":\"all_turns\"},\"gateway\":{\"routing\":{\"originalModelId\":\"openai/gpt-6-luna\",\"resolvedProvider\":\"openai\",\"fallbacksAvailable\":[\"bedrock\",\"azure\"],\"planningReasoning\":\"System credentials planned for: openai, bedrock, azure. Total execution order: openai(system) → bedrock(system) → azure(system)\",\"canonicalSlug\":\"openai/gpt-6-luna\",\"finalProvider\":\"openai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"openai/gpt-6-luna\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"openai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912116162,\"endTime\":1790912116955,\"providerRequestId\":\"req_354dcfb7edf042beab5d73d445d4f82d\",\"statusCode\":200,\"providerResponseId\":\"resp_00f283291bb6009d016abf26743f0c87d1a9732d3e4a334cd2\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000164\",\"marketCost\":\"0.0000164\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000164\",\"inferenceCost\":\"0.0000164\",\"inputInferenceCost\":\"0.0000074\",\"outputInferenceCost\":\"0.000009\",\"generationId\":\"gen_01M3XAWDCYY5RT4HEEH7PRA60S\"}}}}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"openai/gpt-5-nano\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_00c73043b2e92f54016abf19c8d26487d1bff8f0c71a4a93c1\",\"summary\":[],\"encrypted_content\":\"gAAAAABqvxnJ06ebl4J7SrbSSuIlZxC4T4VuhVnFIGrFyAY0mmttxVsngBuy-6zKZMSfdpdl5BZ3sr8znFnvaNRyxj1u_iiwBpQLXPXxx721Mi-XRJEgDSUBuDuPcgQgZe22jkEGqFGNXUailrL82aECa3kkDbVMnq1tLwi0o76XmH_raR9xNdxw6UU9rffP0BbMVcy-kE6jcY_6t2TsWr5yPc73XMak1q6mmVeiBhbabWmYH--mE9X-_Pv0JYSR8m3Yq7Ix9yuaTJmCi35VDVE31GCKFbhuTR_bs6XF94oyvsS3dhaLv3VA--lNO82-5LavpdVqVoAF8l74psptq-SPLNdO5YNsb3rH8k-QAxVWI-eB3fMqQP9YxXHgdaoBKacZLa-h4ZMq5CQV6hgr3eCyuyzRlHQ_3sQQu_-9PIWyeaTf8JqxAH4qeqxnrontjSIO0GNZ8Y2TV0DDrFkrgi6tqjKP0wEMvRt31_psSGXNliYELwKxd568t4XSrNhhThlJrHAOnT404XXbiwaiVQ3Cge0HT-s28H6EZvCPa0s_KMGsa7rYhIIn0E_Kr4R90nGZ0UcnoZcEU1SPTMrzjA5Yls-zz09MreTRGlrCgNjT4JaAdPKwUl2L6H3WDbyqjLSYDDYiLMDnfb47EkIjcAU-rKvpBQIgiJKqzWmEmF0FsZk4AQLcRyoOQl4yGZeWsHXIZfBjFZbTeyig-88u2WzoiHS6K8QaSwtMQo2u9Q7iBKx3vRtlSc2dJ9cq1m-9iyOx0Z_PV3EceFL6iFn9UJNOgAXOWKT6aI5woIIXV6z_2IAOH92RY5fhB4bqE-6OVyJA0MVGyiNOGOjZw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MU_CHZxuSwnpa5Mu4FZ_gy-bybcT8YwcRaGiUUTi4dd7FeIr6IiFKxVBLXUqcwSA=\"},{\"type\":\"function_call\",\"id\":\"fc_1790908873569_ofzunox8p7g\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_KWTsETdjIE5CwnlErFN9bPyw\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"openai/gpt-6-luna\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_1790912116805_gjpiv08fad6\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\",\"object\":\"response\",\"created_at\":1790908874,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\",\"object\":\"response\",\"created_at\":1790908874,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-5-nano\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908874359_82312mad8qc\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":8,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908874359_82312mad8qc\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":10,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908874359_82312mad8qc\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":11,\"response\":{\"id\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\",\"object\":\"response\",\"created_at\":1790908874,\"status\":\"completed\",\"completed_at\":1790908874,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"message\",\"id\":\"msg_1790908874359_82312mad8qc\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":218,\"output_tokens\":8,\"total_tokens\":226,\"input_tokens_details\":{\"cached_tokens\":0,\"cache_write_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"gpt-5-nano-2025-08-07\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_0d644ec918746958016abf19c9edb487d1b5fd771700d5fc21\",\"serviceTier\":\"default\",\"reasoningContext\":\"current_turn\"},\"gateway\":{\"routing\":{\"originalModelId\":\"openai/gpt-5-nano\",\"resolvedProvider\":\"openai\",\"fallbacksAvailable\":[\"azure\"],\"planningReasoning\":\"System credentials planned for: openai, azure. Total execution order: openai(system) → azure(system)\",\"canonicalSlug\":\"openai/gpt-5-nano\",\"finalProvider\":\"openai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"openai/gpt-5-nano\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"openai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908873804,\"endTime\":1790908874516,\"providerRequestId\":\"req_18d8433248e545da84f7e3fbbc9efdc1\",\"statusCode\":200,\"providerResponseId\":\"resp_0d644ec918746958016abf19c9edb487d1b5fd771700d5fc21\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000141\",\"marketCost\":\"0.0000141\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000141\",\"inferenceCost\":\"0.0000141\",\"inputInferenceCost\":\"0.0000109\",\"outputInferenceCost\":\"0.0000032\",\"generationId\":\"gen_01M3X7SF1C5X9264PCN2FTES5Z\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWEAE4DFVEN1PK4X2HPDN\",\"object\":\"response\",\"created_at\":1790912117,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-6-luna\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWEAE4DFVEN1PK4X2HPDN\",\"object\":\"response\",\"created_at\":1790912117,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"openai/gpt-6-luna\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912117592_ym79h2ia3op\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":8,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912117592_ym79h2ia3op\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":10,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912117592_ym79h2ia3op\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":11,\"response\":{\"id\":\"gen_01M3XAWEAE4DFVEN1PK4X2HPDN\",\"object\":\"response\",\"created_at\":1790912117,\"status\":\"completed\",\"completed_at\":1790912117,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"message\",\"id\":\"msg_1790912117592_ym79h2ia3op\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"final_answer\"}],\"usage\":{\"input_tokens\":113,\"output_tokens\":8,\"total_tokens\":121,\"input_tokens_details\":{\"cached_tokens\":0,\"cache_write_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"gpt-6-luna\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_052bed03e239f42b016abf26752c0087d1aef1c048d528c92e\",\"serviceTier\":\"default\",\"reasoningContext\":\"all_turns\"},\"gateway\":{\"routing\":{\"originalModelId\":\"openai/gpt-6-luna\",\"resolvedProvider\":\"openai\",\"fallbacksAvailable\":[\"bedrock\",\"azure\"],\"planningReasoning\":\"System credentials planned for: openai, bedrock, azure. Total execution order: openai(system) → bedrock(system) → azure(system)\",\"canonicalSlug\":\"openai/gpt-6-luna\",\"finalProvider\":\"openai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"openai/gpt-6-luna\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"openai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912117099,\"endTime\":1790912117745,\"providerRequestId\":\"req_4db547dd2dbc497491922d9bbb28c228\",\"statusCode\":200,\"providerResponseId\":\"resp_052bed03e239f42b016abf26752c0087d1aef1c048d528c92e\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0000153\",\"marketCost\":\"0.0000153\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0000153\",\"inferenceCost\":\"0.0000153\",\"inputInferenceCost\":\"0.0000113\",\"outputInferenceCost\":\"0.000004\",\"generationId\":\"gen_01M3XAWEAE4DFVEN1PK4X2HPDN\"}}}}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json index f8e87e635f77..da38e1b3b841 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-responses-grok-reasoning-and-tools", - "recordedAt": "2026-10-02T02:41:23.506Z" + "recordedAt": "2026-10-02T03:35:29.729Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"xai/grok-4.1-fast-reasoning\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"spacexai/grok-4.7\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SQ25GKASNSK847DB7M03\",\"object\":\"response\",\"created_at\":1790908882,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SQ25GKASNSK847DB7M03\",\"object\":\"response\",\"created_at\":1790908882,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":3,\"item_id\":\"fc_1790908882863_fdlmcnnqwng\",\"output_index\":0,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":4,\"item_id\":\"fc_1790908882863_fdlmcnnqwng\",\"output_index\":0,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":5,\"output_index\":0,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":6,\"response\":{\"id\":\"gen_01M3X7SQ25GKASNSK847DB7M03\",\"object\":\"response\",\"created_at\":1790908882,\"status\":\"completed\",\"completed_at\":1790908882,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":878,\"output_tokens\":160,\"total_tokens\":1038,\"input_tokens_details\":{\"cached_tokens\":650},\"output_tokens_details\":{\"reasoning_tokens\":135}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"googleVertex\":{\"acceptedPredictionTokens\":0,\"rejectedPredictionTokens\":0},\"gateway\":{\"routing\":{\"originalModelId\":\"xai/grok-4.1-fast-reasoning\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: vertex. Total execution order: vertex(system)\",\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908882008,\"endTime\":1790908882871,\"statusCode\":200,\"providerResponseId\":\"c77b27ff-5655-4511-a28e-eb7c45becd19\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0001581\",\"marketCost\":\"0.0001581\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0001581\",\"inferenceCost\":\"0.0001581\",\"inputInferenceCost\":\"0.0000781\",\"outputInferenceCost\":\"0.00008\",\"generationId\":\"gen_01M3X7SQ25GKASNSK847DB7M03\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWJENM4P0F2WHEDRHDGW0\",\"object\":\"response\",\"created_at\":1790912122,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.7\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWJENM4P0F2WHEDRHDGW0\",\"object\":\"response\",\"created_at\":1790912122,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.7\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":4,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\"The\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":5,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" user\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":6,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" wants\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":7,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" me\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":8,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" to\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":9,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" use\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":10,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" the\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":11,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" get\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":12,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\"_\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":13,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\"weather\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":14,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" tool\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":15,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" exactly\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":16,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" once\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":17,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\",\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":18,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" then\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":19,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" reply\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":20,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" exactly\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":21,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" \\\"\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":22,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\"Paris\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":23,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" is\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":24,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" sunny\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":25,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\".\\\"\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":26,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" after\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":27,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" the\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":28,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" tool\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":29,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\" result\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":30,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"delta\":\".\\n\"}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":31,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":32,\"item_id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":33,\"output_index\":1,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912123226_i789hz8nb4\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":34,\"item_id\":\"fc_1790912123226_i789hz8nb4\",\"output_index\":1,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":35,\"item_id\":\"fc_1790912123226_i789hz8nb4\",\"output_index\":1,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":1,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912123226_i789hz8nb4\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiJmQmZoSmxEbkhOUXVzcDdFeDl1TTB6RGVPNExoVlVmK21BdldMZGwwSkk2bCtURjhwbXcxb091emVvVFRSUlBHLzJGd3JCVy9hM1g3NCtTRTAwSFlkd2I1Z1hnTXFTZHVNZ1cyZlJsVE12S3VEaGE1TWlEODRIYy8wSjZFdnRmS1JkcjU5TGpZL29mK01Qbk9RWi9Od0phOEFKb1pHZmVnUkx6cUVudlQ1eUM3dTNDYWsvZzFrWWNmR2xkNDNzVmJMVGZiSjJIaDh5SWlPNlEyOExGVUNBN3FmRzQzV2VqM1BDSzkvZnk1U29tTVN2NUk5ZkoxeU9jc3IwY2ZSUGNmeStBIiwib3JpZ2luIjoieGFpIn19\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"gen_01M3XAWJENM4P0F2WHEDRHDGW0\",\"object\":\"response\",\"created_at\":1790912122,\"status\":\"completed\",\"completed_at\":1790912123,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiJmQmZoSmxEbkhOUXVzcDdFeDl1TTB6RGVPNExoVlVmK21BdldMZGwwSkk2bCtURjhwbXcxb091emVvVFRSUlBHLzJGd3JCVy9hM1g3NCtTRTAwSFlkd2I1Z1hnTXFTZHVNZ1cyZlJsVE12S3VEaGE1TWlEODRIYy8wSjZFdnRmS1JkcjU5TGpZL29mK01Qbk9RWi9Od0phOEFKb1pHZmVnUkx6cUVudlQ1eUM3dTNDYWsvZzFrWWNmR2xkNDNzVmJMVGZiSjJIaDh5SWlPNlEyOExGVUNBN3FmRzQzV2VqM1BDSzkvZnk1U29tTVN2NUk5ZkoxeU9jc3IwY2ZSUGNmeStBIiwib3JpZ2luIjoieGFpIn19\"},{\"type\":\"function_call\",\"id\":\"fc_1790912123226_i789hz8nb4\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":1356,\"output_tokens\":49,\"total_tokens\":1405,\"input_tokens_details\":{\"cached_tokens\":1152},\"output_tokens_details\":{\"reasoning_tokens\":38}},\"model\":\"grok-4.7\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"xai\":{\"serviceTier\":\"default\"},\"gateway\":{\"routing\":{\"originalModelId\":\"spacexai/grok-4.7\",\"resolvedProvider\":\"xai\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: xai. Total execution order: xai(system)\",\"canonicalSlug\":\"xai/grok-4.7\",\"finalProvider\":\"xai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.7\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"xai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912121335,\"endTime\":1790912123229,\"providerRequestId\":\"49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"statusCode\":200,\"providerResponseId\":\"49e377e8-18fe-9c93-bc42-e78bc06ef8c8\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.001278\",\"marketCost\":\"0.001278\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.001278\",\"inferenceCost\":\"0.001278\",\"inputInferenceCost\":\"0.000984\",\"outputInferenceCost\":\"0.000294\",\"generationId\":\"gen_01M3XAWJENM4P0F2WHEDRHDGW0\"}}}}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"xai/grok-4.1-fast-reasoning\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_1790908882863_fdlmcnnqwng\",\"call_id\":\"call_99316591\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_99316591\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"spacexai/grok-4.7\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiJmQmZoSmxEbkhOUXVzcDdFeDl1TTB6RGVPNExoVlVmK21BdldMZGwwSkk2bCtURjhwbXcxb091emVvVFRSUlBHLzJGd3JCVy9hM1g3NCtTRTAwSFlkd2I1Z1hnTXFTZHVNZ1cyZlJsVE12S3VEaGE1TWlEODRIYy8wSjZFdnRmS1JkcjU5TGpZL29mK01Qbk9RWi9Od0phOEFKb1pHZmVnUkx6cUVudlQ1eUM3dTNDYWsvZzFrWWNmR2xkNDNzVmJMVGZiSjJIaDh5SWlPNlEyOExGVUNBN3FmRzQzV2VqM1BDSzkvZnk1U29tTVN2NUk5ZkoxeU9jc3IwY2ZSUGNmeStBIiwib3JpZ2luIjoieGFpIn19\"},{\"type\":\"function_call\",\"id\":\"fc_1790912123226_i789hz8nb4\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\",\"object\":\"response\",\"created_at\":1790908883,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\",\"object\":\"response\",\"created_at\":1790908883,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908883480_mtiul363bl\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":3,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":4,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":5,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":6,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":7,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"delta\":\".\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":8,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908883480_mtiul363bl\",\"output_index\":0,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":10,\"output_index\":0,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908883480_mtiul363bl\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":11,\"response\":{\"id\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\",\"object\":\"response\",\"created_at\":1790908883,\"status\":\"completed\",\"completed_at\":1790908883,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"message\",\"id\":\"msg_1790908883480_mtiul363bl\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":1058,\"output_tokens\":44,\"total_tokens\":1102,\"input_tokens_details\":{\"cached_tokens\":1039},\"output_tokens_details\":{\"reasoning_tokens\":40}},\"model\":\"xai/grok-4.1-fast-reasoning\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"googleVertex\":{\"acceptedPredictionTokens\":0,\"rejectedPredictionTokens\":0},\"gateway\":{\"routing\":{\"originalModelId\":\"xai/grok-4.1-fast-reasoning\",\"resolvedProvider\":\"vertex\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: vertex. Total execution order: vertex(system)\",\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"finalProvider\":\"vertex\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.1-fast-reasoning\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"vertex\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908882982,\"endTime\":1790908883510,\"statusCode\":200,\"providerResponseId\":\"c24f92be-02fd-4313-8971-861897f4f9ab\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00007775\",\"marketCost\":\"0.00007775\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00007775\",\"inferenceCost\":\"0.00007775\",\"inputInferenceCost\":\"0.00005575\",\"outputInferenceCost\":\"0.000022\",\"generationId\":\"gen_01M3X7SR0H3GW84C9688BTPFV5\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWMDMFZPD7JDZ30E5D2VS\",\"object\":\"response\",\"created_at\":1790912128,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.7\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWMDMFZPD7JDZ30E5D2VS\",\"object\":\"response\",\"created_at\":1790912128,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"xai/grok-4.7\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":4,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\"The\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":5,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" user\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":6,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" asked\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":7,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" me\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":8,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" to\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":9,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" reply\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":10,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" exactly\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":11,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" \\\"\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":12,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\"Paris\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":13,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" is\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":14,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" sunny\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":15,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\".\\\"\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":16,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" after\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":17,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" the\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":18,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" tool\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":19,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" result\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":20,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\".\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":21,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" I\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":22,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" should\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":23,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" do\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":24,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\" that\"}\n\nevent: response.reasoning_summary_text.delta\ndata: {\"type\":\"response.reasoning_summary_text.delta\",\"sequence_number\":25,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"delta\":\".\"}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":26,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"text\":\"The user asked me to reply exactly \\\"Paris is sunny.\\\" after the tool result. I should do that.\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":27,\"item_id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"The user asked me to reply exactly \\\"Paris is sunny.\\\" after the tool result. I should do that.\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":28,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912129613_05dewmuzes0m\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":29,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":30,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":31,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"delta\":\" is\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":32,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"delta\":\" sunny\",\"logprobs\":[]}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":33,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"delta\":\".\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":34,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":35,\"item_id\":\"msg_1790912129613_05dewmuzes0m\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":36,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912129613_05dewmuzes0m\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":37,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user asked me to reply exactly \\\"Paris is sunny.\\\" after the tool result. I should do that.\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiI0Z3pHK3I4cS8vdStsVS90bVordkp2Mi9JMkZBdGFEdHUvOUJ3a2R3cUNBeU5hdGlZQ0RNQmxQaFRpSTdpbTgxanpwVXI2c3BZRXpDNm9LUTV0NTljVG9NRlQwVG80MnZrakRjdFh6QUkxVDRocHZkc1k2ckRleGp4K0tMRXFSZ2ZvazNuRGp1Y1loZTBsZllMN3Z6bFh6ZHpqMW9DUWg4Z3ciLCJvcmlnaW4iOiJ4YWkifX0\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":38,\"response\":{\"id\":\"gen_01M3XAWMDMFZPD7JDZ30E5D2VS\",\"object\":\"response\",\"created_at\":1790912128,\"status\":\"completed\",\"completed_at\":1790912129,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user asked me to reply exactly \\\"Paris is sunny.\\\" after the tool result. I should do that.\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiI0Z3pHK3I4cS8vdStsVS90bVordkp2Mi9JMkZBdGFEdHUvOUJ3a2R3cUNBeU5hdGlZQ0RNQmxQaFRpSTdpbTgxanpwVXI2c3BZRXpDNm9LUTV0NTljVG9NRlQwVG80MnZrakRjdFh6QUkxVDRocHZkc1k2ckRleGp4K0tMRXFSZ2ZvazNuRGp1Y1loZTBsZllMN3Z6bFh6ZHpqMW9DUWg4Z3ciLCJvcmlnaW4iOiJ4YWkifX0\"},{\"type\":\"message\",\"id\":\"msg_1790912129613_05dewmuzes0m\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":1423,\"output_tokens\":26,\"total_tokens\":1449,\"input_tokens_details\":{\"cached_tokens\":1280},\"output_tokens_details\":{\"reasoning_tokens\":22}},\"model\":\"grok-4.7\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"default\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"xai\":{\"serviceTier\":\"default\"},\"gateway\":{\"routing\":{\"originalModelId\":\"spacexai/grok-4.7\",\"resolvedProvider\":\"xai\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: xai. Total execution order: xai(system)\",\"canonicalSlug\":\"xai/grok-4.7\",\"finalProvider\":\"xai\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"xai/grok-4.7\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"xai\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912123342,\"endTime\":1790912129779,\"providerRequestId\":\"f77452f9-e227-9c49-9ba4-68ca0a11e020\",\"statusCode\":200,\"providerResponseId\":\"f77452f9-e227-9c49-9ba4-68ca0a11e020\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.001082\",\"marketCost\":\"0.001082\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.001082\",\"inferenceCost\":\"0.001082\",\"inputInferenceCost\":\"0.000926\",\"outputInferenceCost\":\"0.000156\",\"generationId\":\"gen_01M3XAWMDMFZPD7JDZ30E5D2VS\"}}}}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json index 915706075250..86af7c556a72 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-responses-muse-reasoning-and-tools", - "recordedAt": "2026-10-02T02:41:21.896Z" + "recordedAt": "2026-10-02T03:35:21.178Z" }, "interactions": [ { @@ -24,7 +24,7 @@ "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\",\"object\":\"response\",\"created_at\":1790908876,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\",\"object\":\"response\",\"created_at\":1790908876,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"delta\":\"I'll check the weather in Paris now.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"text\":\"I'll check the weather in Paris now.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790908879536_kkc9m3g8wsi\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":12,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_1790908879574_5sr4f8zk7yt\",\"output_index\":2,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":14,\"item_id\":\"fc_1790908879574_5sr4f8zk7yt\",\"output_index\":2,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":15,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":16,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFI1vMhVfuCXmcgmO3hobnnPv75dt-JebnUD9Gfxx70PEUET9EXywInIYxEKo1ivh475TXj7aShCMgy4oCZ0607aIneDAggRBcbSuA-6nLeRU81T1VHvX4-3yYlO65vzDoMTqgjCe6WmM-MJhxR8jR0X74uJcyhI8yf0Idf0m7XypFcBrnmy7dJQ9siLa0EkgjopckvUOfAe9_-3G8JoBgZ1bFX1vE8ThfSikoqwrgM2kI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9QzmS96BKtvitb31CnNeJjgRpRw494_mM119ptlIOeqwM4LR1E0xzM55bxl4aQQ-9mhiB8vfxlWqsj_ffutxv4bIqDItLZrkNIMAqPC-1WCrkCP99aMNNuTX-xDAuvYrFJCIOk0bcSRoPz3w7Wp74aTj--GDHVF2VUzQvFoqxA_y2Ch8FUU0rqsmEQxdRiaH2b0CMy_SP-PqYNgM7eQ6fgZREz3LKCGo36MomGcnQ_pVQt86mlib3s9QfJ3440MUCoYNcz77LizYfq6kJC1SylH_59ZzQwJCipG2fFiZjUwLU5z40tGeDFPUpI6pqlDigfzaDUwZzo5Rnscu08sVNaETo5Ng_OHJKVlJ319Wu9z6raNF30nPqYnaNBxz1-raJBOKbj804cu5bvvndrQU-k888hGVQPRUaq8l8gakZTRhTSSy96TlOf3a_7DzOxvqYAw-Iq4j20hsGG2kNxHRHSNXdJ5UNZDNk4e3IQIujx_CEwkdPIlQafcWB5BvjqwduQgsQqO80xVXBcCoj1hQRYVW8avaZgib8po5xXNazHiU3Lc1rSytPX95GL73wIWsYwwpi9vX3BZpjhE7C0gUkGr9GeURBKVf1r6CHeo1S-P94CFxvmQNRf7H0MG6ynlKhtUXgtHKBV1vT0L4qTN2KqRqf3uL2g9UaO18DI1zp1iFmkA65hYTDaMoEEopRDJOOx_s1IAODxdi43LTZrMppqjT061bM0pjSoMc4t6FkUk2UeOXesjUXsLOBEkjrOUBXm6J4yOe6K5FKRWnq3UTvoy6gXrFOdzpa1ROvLCbVDvIA7CUXfgu9XCG4VSrVahUPnNkS7HqDAKsmRdAVJu4TcR_NazBbmBqmxkszSyMwj6_SaEoBEDFeaslehX7iCBgMCeG9kEoLxPLRoWoVjF-EGDPsE5g2O3jcaxeXGV9U6j7P1COcwMeclnJxCA\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":17,\"response\":{\"id\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\",\"object\":\"response\",\"created_at\":1790908876,\"status\":\"completed\",\"completed_at\":1790908879,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFI1vMhVfuCXmcgmO3hobnnPv75dt-JebnUD9Gfxx70PEUET9EXywInIYxEKo1ivh475TXj7aShCMgy4oCZ0607aIneDAggRBcbSuA-6nLeRU81T1VHvX4-3yYlO65vzDoMTqgjCe6WmM-MJhxR8jR0X74uJcyhI8yf0Idf0m7XypFcBrnmy7dJQ9siLa0EkgjopckvUOfAe9_-3G8JoBgZ1bFX1vE8ThfSikoqwrgM2kIvRK9nR6O4szj94kYK7K6c4vqelz8eVIZMjp02JQzWai8BflgmdWkqmkIViljbcYMX5yM9nonYpyteBn9E7tKOBk6Zh5FaSROo8UvsinD7c3yv0LUbPZTGhkXoxRTEIKJ8yL8JAVz--5D_aOfq-FMwSnGxGdjlNm5VdRd7-3dI7XvKa4nQf5vttB4EFotVx__waEBSFY9YR87Hep-fpgdl435q0VDekTRcpgniVsTGQlFqL_lAVaiUI_RgLE15FuHgQI8fq-MsXPSB0X1TNchYOOL0nQmx2VqzSnNUKbzE1oAKS86sz71BnHDjCO-BCCiWqscrHudEhnvFq7Di5SmYSVJZ3BQwqHXKtYZUoLKQ2ZahuM2LSNVTIV_Indqa8sKJn8VNWmX6_hFSEX7aTtrV7N1OybzH8-edzY0UMI1jpM3E-xOSHKfX1vuGYf2Zq69qLJbHw3Ifk0sar_qjTSHQ1rvT8-SJY9aQnapU6amedBg6-CXEo-DQR9o_mNvXpntaD8M3QEsyKYJSDMR35A1pv0syFINmBmitgfegIPPYH35o3Waorin2ZlcfYYYC8ZVfB9N6oWEXuX7G1nLAKqMmc-jHcZax6zRgr_WUAkNjaMK3h_O3BzutHejB02TyVQp5na6mBSMVEHn0vnbwKRxSV47nrS5wvfbALtRvQDvBDjo6R-68lPL3TEH3JX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RDJOOx_s1IAODxdi43LTZrMppqjT061bM0pjSoMc4t6FkUk2UeOXesjUXsLOBEkjrOUBXm6J4yOe6K5FKRWnq3UTvoy6gXrFOdzpa1ROvLCbVDvIA7CUXfgu9XCG4VSrVahUPnNkS7HqDAKsmRdAVJu4TcR_NazBbmBqmxkszSyMwj6_SaEoBEDFeaslehX7iCBgMCeG9kEoLxPLRoWoVjF-EGDPsE5g2O3jcaxeXGV9U6j7P1COcwMeclnJxCA\"},{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":566,\"output_tokens\":449,\"total_tokens\":1015,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":382}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf19cc202122c66ab34169\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908874650,\"endTime\":1790908879817,\"providerRequestId\":\"b27d7c9f-dc28-4f48-8bee-e21b1f140689\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf19cc202122c66ab34169\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00249145\",\"marketCost\":\"0.00249145\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00249145\",\"inferenceCost\":\"0.00249145\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.00190825\",\"generationId\":\"gen_01M3X7SFVE1X03KN1BTECPTWSD\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\",\"object\":\"response\",\"created_at\":1790912118,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\",\"object\":\"response\",\"created_at\":1790912118,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"delta\":\"I'll check the weather in Paris for you.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"text\":\"I'll check the weather in Paris for you.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":12,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_1790912119488_fmfh8fpar5a\",\"output_index\":2,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":14,\"item_id\":\"fc_1790912119488_fmfh8fpar5a\",\"output_index\":2,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":15,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":16,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHCBiZLJ0WO9UES-bCLJWuE20ni_YboWPge8NMyrGAA4w3zL2ofFXlz_QA8s5q79fL9vlkicrlvM0lsE0JaxzY8cIczOgdIWORfVtm73VqVMM1BaiOY7KX8y8ycQBbv6R-SdVSWFfEc5SiIjGOvEuf9WE9VNnGLu-1zKYn7BIEE27KXvUV7xRNbzre1Y1uXkK0Sd8mFfzcJFv-P4rZUPW89i4WHe7nfDQs-Y219X-5QTk_QqGUTjE3iEJMVNkCuAANo9Oua7iuJTGDaPYT2n6igsgQdjM6nLl30LVffLqJfr3SOChOHNNDAqzxuR6Lvt1Q2Tfim_rbdxV94GUydAOFmSlXpcnZtIXsIvCDKwxO-NS4d-TDFkRukUhdQ2mLX4md4BOm5ZxkKnpqoL3P86vwcU7LQng2sbKmksdOXiPiNWo3qBnL6DZudyaO21d4vtXjDmpIGFBmsUy-RzTE7F7cHU1cS8wYW6qlJMhcW61dS8sdBCBQc_HrCCLaEs_jC6qSv4civAIP7-33FUBDXs0OeEszz8Bq546xmolKfPn3V5qkH-zLrvsGxZ1aQEw8lnXuJJ7HFduj2gKj5ShfeJm0s7KE6N8O7V9v41B06Z-E-_YA0mXx5rFrylAp7GIo1yiKnrRUrIeVFd488e7-bdgfS6IHbIl3WmNxGi5HLMRbUNOSyOMYvyF5k5n8lDcXhhbtgPbfE1O8n7SwEYjerBmAQ_Y1hXOUFGAhMU3s0vsEb7AJSaNliXNwFzzu0giwDPgj6QPHcsMCD5t4_GUtpMNnip66RP9MFPXYWBDJX2pXXASAzu-iH0rz_dbGdeqNLJ6siYJx-1xElG0-6j3VQlPB9Tu6ju1dYjUZ0lSuy31AjaThfYO0eMnQMpsaAIKtxPnpwgGjHQqG0Mpufr5wOjFBUQ2kx8PdJT4a0Ck2P844KJp0CK2AyjiKLuaJTWpgEogj6RDWiVOi8EvY3Fe-_yCDbZ-izVejxIPEnb7eA21xlRhJf0QOZm8Am1J9U4SQvS1xTwqeVZNQ5qtefdEnQG-KHvAnf3iiYXVW9xUPi9LvckY_2Q_Mr_mU-C7ElDZmtw1QYpO9Fhk528bfeugwk7MiB-214GWevwA_2a930igExMziXYywZWZozQsnAogJmWqUy7UkZUqMyMkagvyqdyobX3B1fS8lkNbhQtYpHa9gfVs4QaEAcpBdV5xSZmecQvj9mbCF7QU_ADWu3qd58gTeMgtfP-t8NyGY5GiruiMCxJWyERwVcSod6rEoS8DRa_Wq4KS8hgEFBO_-MDXov_3TFDXclKvDLHkPke9PcFd6z1IHRc2PTfftRVht9y6azlJNRpPbjAp6gTi20o9I96xg2Js-Tg9rh0fj0gAN144cibq2vhiMUL-FoDRlRpn2BU8xWKjRnM53puw\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":17,\"response\":{\"id\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\",\"object\":\"response\",\"created_at\":1790912118,\"status\":\"completed\",\"completed_at\":1790912119,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHCBiZLJ0WO9UES-bCLJWuE20ni_YboWPge8NMyrGAA4w3zL2ofFXlz_QA8s5q79fL9vlkicrl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ZozQsnAogJmWqUy7UkZUqMyMkagvyqdyobX3B1fS8lkNbhQtYpHa9gfVs4QaEAcpBdV5xSZmecQvj9mbCF7QU_ADWu3qd58gTeMgtfP-t8NyGY5GiruiMCxJWyERwVcSod6rEoS8DRa_Wq4KS8hgEFBO_-MDXov_3TFDXclKvDLHkPke9PcFd6z1IHRc2PTfftRVht9y6azlJNRpPbjAp6gTi20o9I96xg2Js-Tg9rh0fj0gAN144cibq2vhiMUL-FoDRlRpn2BU8xWKjRnM53puw\"},{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":566,\"output_tokens\":142,\"total_tokens\":708,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":74}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf267664a900987566421a\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912117888,\"endTime\":1790912119808,\"providerRequestId\":\"af8cb53b-9e22-4a05-aad4-6d22d5e6ea6b\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf267664a900987566421a\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0011867\",\"marketCost\":\"0.0011867\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0011867\",\"inferenceCost\":\"0.0011867\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.0006035\",\"generationId\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\"}}}}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abf19cc202122c66ab34169:rs_01a0fa7cc6a7773ea0a0ab7f4649c655\",\"summary\":[],\"encrypted_content\":\"Q-PaDgFI1vMhVfuCXmcgmO3hobnnPv75dt-JebnUD9Gfxx70PE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EoLxPLRoWoVjF-EGDPsE5g2O3jcaxeXGV9U6j7P1COcwMeclnJxCA\"},{\"type\":\"message\",\"id\":\"msg_1790908879536_kkc9m3g8wsi\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris now.\"}],\"phase\":\"commentary\",\"status\":\"completed\"},{\"type\":\"function_call\",\"id\":\"fc_1790908879574_5sr4f8zk7yt\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0fa7cd257745bb6f424aa923bcf87\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHCBiZLJ0WO9UES-bCLJWuE20ni_YboWPge8NMyrGAA4w3zL2ofFXlz_QA8s5q79fL9vlkicrlvM0lsE0JaxzY8cIczOgdIWORfVtm73VqVMM1BaiOY7KX8y8ycQBbv6R-SdVSWFfEc5SiIjGOvEuf9WE9VNnGLu-1zKYn7BIEE27KXvUV7xRNbzre1Y1uXkK0Sd8mFfzcJFv-P4rZ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q4KS8hgEFBO_-MDXov_3TFDXclKvDLHkPke9PcFd6z1IHRc2PTfftRVht9y6azlJNRpPbjAp6gTi20o9I96xg2Js-Tg9rh0fj0gAN144cibq2vhiMUL-FoDRlRpn2BU8xWKjRnM53puw\"},{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\"}],\"phase\":\"commentary\",\"status\":\"completed\"},{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\",\"object\":\"response\",\"created_at\":1790908880,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\",\"object\":\"response\",\"created_at\":1790908880,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908881803_wi9wz1jy91\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790908881803_wi9wz1jy91\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790908881803_wi9wz1jy91\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":12,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFhVCiJVbb8JmRpCUy6bGayvspWo3HlhfmBBtTMU8wxDZL2rKzs5ZsxhBBtlOVDB9fYtQZ3JJbH3ik3k1q1Hh3mE7Hg8jdQaep9XyJtplL6npz5Ks908h-4k1TmYr0W5fO_Wg00FCt48fdZgNBYN5-xHAqQzjw2h3Jy-Me1yHZrPeBuBaIS6ou3OOfv0KlXv3FKz-aRMwlORglJcXcos0ed9RQ3w4fQtTLWHB9KPb2Q2SnHPEZI-SDo--sOevnlwBAFDOQLrtyTaZFFvBiH5Ali9NgJqjp_TqyF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DZnP8k_Bn8nhFslQY1FzmACNf1AGmQ97ySPA1QItCwRPxRmMlsYsRdtco94W4tVCrjzWBPQdEVQlTJ3w3HQiEdOhbta2aGPUDJJa70FVSQznGMz_tmtq5x0DdraQKJEeON3kGIToqPOrgcFPVfDmBrIDfCj7ANlty0MN3_RMXMOiIBooP1pmbKzcl_iT_MxzXgoWDrPusg93dfqaEtPedTOoW9aSLruEiVQAXfl3Nk_UtP_WQMwadEbLrMWy4CckljFBZOwj0UhAmVBnLq4MS0hmpnaKxnlj7vtWITsDrr7dy1UUtRtwkAUA97oZ5M8LXYsMMowSYsRlZk3jD2khBg\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":13,\"response\":{\"id\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\",\"object\":\"response\",\"created_at\":1790908880,\"status\":\"completed\",\"completed_at\":1790908881,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf19d0db3568e880e4472a:rs_01a0fa7cd5a670ffaf82a029deb1b0fc\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgFhVCiJVbb8JmRpCUy6bGayvspWo3HlhfmBBtTMU8wxDZL2rKzs5ZsxhBBtlOVDB9fYtQZ3JJbH3ik3k1q1Hh3mE7Hg8jdQaep9XyJtplL6npz5Ks908h-4k1TmYr0W5fO_Wg00FCt48fdZgNBYN5-xHAqQzjw2h3Jy-Me1yHZrPeBuBaIS6ou3OOfv0KlXv3FKz-aRMwlORglJcXcos0ed9RQ3w4fQtTLWHB9KPb2Q2SnHPEZI-SDo--sOevnlwBAFDOQLrtyTaZFFvBiH5Ali9NgJqjp_TqyFrukggKg6q52d8AvRurJP3uy3-gUhoe0Za5Qk4Ep8SmKQmIYiBDj_-IdLJtwdPzhY95q-gUZ1z3_nbo3-o9LvDihYjcfX1rp0Za-mCvCKYlgDlOMV1NHNogcPtI3GqGVzaqDb_h-5hir9NA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DmBrIDfCj7ANlty0MN3_RMXMOiIBooP1pmbKzcl_iT_MxzXgoWDrPusg93dfqaEtPedTOoW9aSLruEiVQAXfl3Nk_UtP_WQMwadEbLrMWy4CckljFBZOwj0UhAmVBnLq4MS0hmpnaKxnlj7vtWITsDrr7dy1UUtRtwkAUA97oZ5M8LXYsMMowSYsRlZk3jD2khBg\"},{\"type\":\"message\",\"id\":\"msg_1790908881803_wi9wz1jy91\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":659,\"output_tokens\":193,\"total_tokens\":852,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":179}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf19d0db3568e880e4472a\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790908879950,\"endTime\":1790908881900,\"providerRequestId\":\"ea883605-3e7e-44b0-8ee7-dc7c8a9e349f\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf19d0db3568e880e4472a\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0015197\",\"marketCost\":\"0.0015197\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0015197\",\"inferenceCost\":\"0.0015197\",\"inputInferenceCost\":\"0.00069945\",\"outputInferenceCost\":\"0.00082025\",\"generationId\":\"gen_01M3X7SN14K1N6XPJ2EJRFMH8C\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\",\"object\":\"response\",\"created_at\":1790912120,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\",\"object\":\"response\",\"created_at\":1790912120,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912121132_tdqczb6inx\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912121132_tdqczb6inx\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":12,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgG25hka1t6mau-01mX7SAeruhIYmh3Nlar3vaOp8Oyh6HEv2RyWkVaK8r7kYxok0egJ6f_TOcwGxPxZaBUJJuLp9p9RCQPjah1C_dwsZ0GLnWEaApWeXi8TztOJmqWkSxJiCGy_HAYwShLz_y6lLTJe_KQb1-u5NGE0v2D2bn5kwlNtz2rud8UmMR2idQRP2GPQnCxOQRXu6YMMGlmHxs09DKGt5VAfXGOf678eX1U71FW2Nu4D9EKbGRfvAsuzUuIxTv3vsL9SKojFpBJWwAOQZWik6lC9vRFNtmkua7VhEQfNZCp2ayEw18FZlyNsHGeasxJ1VpWP9opIZkKo4FDLb1tzGwl1bA6Yiw3oJkhLnGDUBk_UCzwaTf6fMvmVZMJ6GfXVaJaAQwoF74p-VPjHN9Vo2iWY5FzcM5Xw8tqzVA8h6QvDC595s44M680HcmZhJi2wTWBv0uUcjjdS5fpQ9o0AIv_iZHSut2gDwKkw5UDXJ1TZZvNqi4FGY6kVrGdoMVXcD9K4q3yCzdJAPJ1YaZgHqiexIt7Vvqk6hlh0O9G6fipxb-3LkeObX24diVMlTK5c377d1ZQB9xH8W4tSDqYjZtJb0XE0ym2Meq5hvKfiqbKFM1k0LFIIvTk57Mjp3vQQrBScikaZPmLUpScyE4fcWff0pIuLktmWckK8Z0z1FfkQh9oBV7OSG5lUoJNwsIWlFQtiX87HXkTGjmt3c9J0PF6L9bu8d6zEU8iqa-wDD4NVpyZnxRlxf-V16oQu-zUY1R-wG4zEG2d0pDKF1mSa4Dt7MR2nXEf0xlwLHEXOA2uQve36RnclUOjAHBpD2O6_Jg_uRGDXWg-Th7fqzoN_eNw9VcKhxMhsUclurmNa7ibmQXloz6hZvOzGThBEIEPPbCIGU4CbfMExOBMKBxyxOlCTsna8Z_h2lxB6Nry_oqRx-HolF0vgfGUTuuOlJEV5FfzgR2QZlGWypQVv20SDx9Iok_ef93QsLRIu32LjryqVEbOfQwd8yH7-bCcDUW7BtTwTu7yR3qMGpU1KIM95GtvpfD7qn-Fy5hVYM1PpFPOXh1vj97kCtD8AVbPSCo2eysQHr3i32Vh9q-qjg36lhQIT3pr6UMxqT6_5pb9g5JFBUOkrEGBTxF9_9fmtM2GHqybRGusDT5LgH1i7hKS0NLDLuqa-6T-J2L_-VE3y5lqcwWswFjRBBvbrLsoNnNMCR3fMiPuWxOFoV9tguyStORBzwUrOb0nZk_yQEY2BYCIQn78WQDTHb3TsaoNgl7oXqrLvOenlNt_XKY39RluxrRL2pAE0e9mTqABvK3vdq55LodPtG5_ClteNCetTWnEqSC1pm9kScNeTOPNJwDx3lsB5Ay0BQVp5-Ha_9M8uMG8doG37i7YM9xRpwcKD848pzTwjFQ\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":13,\"response\":{\"id\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\",\"object\":\"response\",\"created_at\":1790912120,\"status\":\"completed\",\"completed_at\":1790912121,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf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QZlGWypQVv20SDx9Iok_ef93QsLRIu32LjryqVEbOfQwd8yH7-bCcDUW7BtTwTu7yR3qMGpU1KIM95GtvpfD7qn-Fy5hVYM1PpFPOXh1vj97kCtD8AVbPSCo2eysQHr3i32Vh9q-qjg36lhQIT3pr6UMxqT6_5pb9g5JFBUOkrEGBTxF9_9fmtM2GHqybRGusDT5LgH1i7hKS0NLDLuqa-6T-J2L_-VE3y5lqcwWswFjRBBvbrLsoNnNMCR3fMiPuWxOFoV9tguyStORBzwUrOb0nZk_yQEY2BYCIQn78WQDTHb3TsaoNgl7oXqrLvOenlNt_XKY39RluxrRL2pAE0e9mTqABvK3vdq55LodPtG5_ClteNCetTWnEqSC1pm9kScNeTOPNJwDx3lsB5Ay0BQVp5-Ha_9M8uMG8doG37i7YM9xRpwcKD848pzTwjFQ\"},{\"type\":\"message\",\"id\":\"msg_1790912121132_tdqczb6inx\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":660,\"output_tokens\":65,\"total_tokens\":725,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":51}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf2678293ec0971e2045ea\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912119958,\"endTime\":1790912121224,\"providerRequestId\":\"4d723793-0d5c-479a-a795-aac71ba1c478\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf2678293ec0971e2045ea\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00097695\",\"marketCost\":\"0.00097695\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00097695\",\"inferenceCost\":\"0.00097695\",\"inputInferenceCost\":\"0.0007007\",\"outputInferenceCost\":\"0.00027625\",\"generationId\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\"}}}}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json b/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json index 36d9c44133da..3d4a7a2289ab 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/rejects-invalid-credentials-without-retryable-classification", - "recordedAt": "2026-10-02T02:41:25.673Z" + "recordedAt": "2026-10-02T03:35:40.803Z" }, "interactions": [ { @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-4.6\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello\"}]}],\"stream\":true,\"max_tokens\":32,\"providerOptions\":{\"gateway\":{\"caching\":\"auto\"}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello\"}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"caching\":\"auto\"}}}" }, "response": { "status": 401, diff --git a/packages/ai/test/provider-options/vercel-ai-gateway.types.ts b/packages/ai/test/provider-options/vercel-ai-gateway.types.ts index ebe6dcae16f4..3dff5d8fe38c 100644 --- a/packages/ai/test/provider-options/vercel-ai-gateway.types.ts +++ b/packages/ai/test/provider-options/vercel-ai-gateway.types.ts @@ -11,12 +11,12 @@ LLM.request({ providerOptions: { reasoningEffort: "max" }, }) LLM.request({ - model: gateway.messages("anthropic/claude-sonnet-4.6"), + model: gateway.messages("anthropic/claude-sonnet-5.5"), prompt: "Hello", providerOptions: { thinking: { type: "enabled", budgetTokens: 2048 } }, }) LLM.request({ - model: gateway.responses("openai/gpt-5-nano"), + model: gateway.responses("openai/gpt-6-luna"), prompt: "Hello", providerOptions: { reasoningSummary: "detailed", cacheTTL: "1h" }, }) diff --git a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts index 41e2c42b6d22..d04fb0b05f05 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts @@ -16,21 +16,34 @@ const recorded = recordedTests({ for (const item of [ { name: "messages Claude", - model: gateway.messages("anthropic/claude-sonnet-4.6"), - options: { thinking: { type: "enabled", budgetTokens: 1024 } }, + model: gateway.messages("anthropic/claude-sonnet-5.5"), + options: { reasoningEffort: "low" }, + reasoning: false, }, { name: "messages Gemini", - model: gateway.messages("google/gemini-2.5-flash"), - options: { thinking: { type: "enabled", budgetTokens: 1024 } }, + model: gateway.messages("google/gemini-3.8-flash"), + options: { reasoningEffort: "low" }, + reasoning: true, + }, + { + name: "responses GPT", + model: gateway.model("openai/gpt-6-luna"), + options: { reasoningEffort: "low" }, + reasoning: false, + }, + { name: "responses Muse", model: gateway.model("meta/muse-spark-1.3"), options: {}, reasoning: true }, + { + name: "responses Grok", + model: gateway.model("spacexai/grok-4.7"), + options: { reasoningEffort: "low" }, + reasoning: true, }, - { name: "responses GPT", model: gateway.model("openai/gpt-5-nano"), options: { reasoningEffort: "low" } }, - { name: "responses Muse", model: gateway.model("meta/muse-spark-1.3"), options: {} }, - { name: "responses Grok", model: gateway.model("xai/grok-4.1-fast-reasoning"), options: {} }, { name: "chat Claude", - model: gateway.chat("anthropic/claude-sonnet-4.6"), - options: { thinking: { type: "enabled", budgetTokens: 1024 } }, + model: gateway.chat("anthropic/claude-sonnet-5.5"), + options: { reasoningEffort: "low" }, + reasoning: false, }, ] as const) { recorded.effect( @@ -52,9 +65,7 @@ for (const item of [ expect(events.filter(LLMEvent.is.finish).every((event) => event.providerMetadata?.gateway !== undefined)).toBe( true, ) - if (item.name !== "responses Grok") expect(events.some(LLMEvent.is.reasoningEnd)).toBe(true) - if (item.name === "responses Grok") - expect(events.filter(LLMEvent.is.finish).some((event) => (event.usage?.reasoningTokens ?? 0) > 0)).toBe(true) + if (item.reasoning) expect(events.some(LLMEvent.is.reasoningEnd)).toBe(true) }), 120_000, ) @@ -66,7 +77,7 @@ recorded.effect( Effect.gen(function* () { const result = yield* LLMClient.generate( LLM.request({ - model: VercelAIGateway.configure({ apiKey: "invalid-gateway-key" }).messages("anthropic/claude-sonnet-4.6"), + model: VercelAIGateway.configure({ apiKey: "invalid-gateway-key" }).messages("anthropic/claude-sonnet-5.5"), prompt: "Hello", generation: { maxTokens: 32 }, }), @@ -85,7 +96,7 @@ recorded.effect( () => Effect.gen(function* () { const request = LLM.request({ - model: gateway.messages("anthropic/claude-sonnet-4.6"), + model: gateway.messages("anthropic/claude-sonnet-5.5"), system: [ { type: "text", diff --git a/packages/ai/test/provider/vercel-ai-gateway.test.ts b/packages/ai/test/provider/vercel-ai-gateway.test.ts index eeb5d1c8c138..ff960e49f2d7 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.test.ts @@ -14,11 +14,11 @@ it.effect("Gateway defaults preserve full model IDs and select the requested fam for (const [id, path] of [ ["openai/gpt-6.1", "/responses"], ["meta/muse-spark-1.3", "/responses"], - ["xai/grok-4", "/responses"], + ["spacexai/grok-4.7", "/responses"], ["meta/llama-4", "/messages"], ["openai/gpt-oss-120b", "/responses"], - ["anthropic/claude-sonnet-4.6", "/messages"], - ["google/gemini-2.5-flash", "/messages"], + ["anthropic/claude-sonnet-5.5", "/messages"], + ["google/gemini-3.8-flash", "/messages"], ["moonshotai/kimi-k3", "/messages"], ]) { const model = gateway.model(id) @@ -36,7 +36,7 @@ it.effect("Gateway keeps distinct system blocks, cache hints, and upstream-scope Effect.gen(function* () { const compiled = yield* compileRequest( LLM.request({ - model: VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-4.6"), + model: VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-5.5"), system: [ { type: "text", text: "Stable", cache: new CacheHint({ type: "ephemeral" }) }, { type: "text", text: "Project" }, @@ -68,18 +68,18 @@ it.effect("Gateway effort settings lower to the selected API", () => Effect.gen(function* () { const gateway = VercelAIGateway.configure({ apiKey: "fixture", providerOptions: { reasoningEffort: "high" } }) const messages = yield* compileRequest( - LLM.request({ model: gateway.messages("anthropic/claude-sonnet-4.6"), prompt: "Hello" }), + LLM.request({ model: gateway.messages("anthropic/claude-sonnet-5.5"), prompt: "Hello" }), ) expect(messages.body).toMatchObject({ thinking: { type: "adaptive" }, output_config: { effort: "high" } }) const responses = yield* compileRequest( - LLM.request({ model: gateway.responses("openai/gpt-5-nano"), prompt: "Hello" }), + LLM.request({ model: gateway.responses("openai/gpt-6-luna"), prompt: "Hello" }), ) expect(responses.body).toMatchObject({ reasoning: { effort: "high" }, store: false, include: ["reasoning.encrypted_content"], }) - const chat = yield* compileRequest(LLM.request({ model: gateway.chat("google/gemini-2.5-flash"), prompt: "Hello" })) + const chat = yield* compileRequest(LLM.request({ model: gateway.chat("google/gemini-3.8-flash"), prompt: "Hello" })) expect(chat.body).toMatchObject({ reasoning_effort: "high" }) }), ) @@ -88,7 +88,7 @@ it.effect("Gateway Responses keeps cache-key and cache controls out of upstream Effect.gen(function* () { const compiled = yield* compileRequest( LLM.request({ - model: VercelAIGateway.configure({ apiKey: "fixture" }).responses("openai/gpt-5-nano"), + model: VercelAIGateway.configure({ apiKey: "fixture" }).responses("openai/gpt-6-luna"), prompt: "Hello", promptCacheKey: "opaque-session", providerOptions: { cacheTTL: "1h", cacheAnchorItems: 1 }, @@ -101,7 +101,7 @@ it.effect("Gateway Responses keeps cache-key and cache controls out of upstream it.effect("Gateway Messages preserves signatures and billing metadata through tool continuation", () => Effect.gen(function* () { - const model = VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-4.6") + const model = VercelAIGateway.configure({ apiKey: "fixture" }).messages("anthropic/claude-sonnet-5.5") const response = yield* LLMClient.generate(LLM.request({ model, prompt: "Hello" })).pipe( Effect.provide( dynamicResponse((input) => @@ -167,7 +167,7 @@ it.effect("Gateway Messages preserves signatures and billing metadata through to it.effect("Gateway Responses replays encrypted reasoning alongside tool calls", () => Effect.gen(function* () { - const model = VercelAIGateway.configure({ apiKey: "fixture" }).responses("openai/gpt-5-nano") + const model = VercelAIGateway.configure({ apiKey: "fixture" }).responses("openai/gpt-6-luna") const response = yield* LLMClient.generate(LLM.request({ model, prompt: "Hello" })).pipe( Effect.provide( dynamicResponse((input) => @@ -222,7 +222,7 @@ it.effect("Gateway 401 and 403 failures are terminal and retain HTTP context", ( for (const status of [401, 403]) { const result = yield* LLMClient.generate( LLM.request({ - model: VercelAIGateway.configure({ apiKey: "fixture" }).chat("openai/gpt-5-nano"), + model: VercelAIGateway.configure({ apiKey: "fixture" }).chat("openai/gpt-6-luna"), prompt: "Hello", }), ).pipe( @@ -252,7 +252,7 @@ it.effect("Gateway authentication supports OIDC fallback and affinity without re for (const api of ["messages", "responses", "chat"] as const) { yield* LLMClient.generate( LLM.request({ - model: VercelAIGateway.configure()[api]("openai/gpt-5-nano"), + model: VercelAIGateway.configure()[api]("openai/gpt-6-luna"), prompt: "Hello", promptCacheKey: "opaque-session", }), From bf2faf32b2b88f35c8eb2b983345188a1bddfbbb Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 1 Oct 2026 22:47:45 -0500 Subject: [PATCH 04/19] fix(ai): support overlapping Responses reasoning items --- packages/ai/README.md | 2 +- packages/ai/src/protocols/open-responses.ts | 6 --- .../ai/src/providers/vercel-ai-gateway.ts | 4 +- ...es-responses-muse-reasoning-and-tools.json | 10 ++--- .../ai/test/provider/openai-responses.test.ts | 38 +++++++++++++++---- .../vercel-ai-gateway.recorded.test.ts | 7 +++- 6 files changed, 44 insertions(+), 23 deletions(-) diff --git a/packages/ai/README.md b/packages/ai/README.md index 33df72600586..c449781fb9d0 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1309,7 +1309,7 @@ gateway.responses("google/gemini-3.8-flash") // Explicit Responses override gateway.messages("openai/gpt-6-luna") // Explicit Messages override ``` -Default routing sends `openai/gpt-*`, `meta/muse-*`, and `xai/grok-*` / `spacexai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. +Default routing sends `openai/gpt-*`, `meta/muse-*`, and `spacexai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. Set `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. diff --git a/packages/ai/src/protocols/open-responses.ts b/packages/ai/src/protocols/open-responses.ts index 1672f4b7ce63..f9513c7033ae 100644 --- a/packages/ai/src/protocols/open-responses.ts +++ b/packages/ai/src/protocols/open-responses.ts @@ -1440,12 +1440,6 @@ export const step = (state: ParserState, event: NormalizedEvent) => { ? Effect.succeed(onReasoningSummaryPartDone(state, event)) : ProviderShared.eventError(state.id, `${event.type} is missing item_id`) if (event.type === "response.output_item.added") { - if ( - event.item?.type === "reasoning" && - state.reasoningItems[event.item.id] === undefined && - state.lifecycle.reasoning.size > 0 - ) - return ProviderShared.eventError(state.id, `${event.type} started reasoning before the previous item ended`) return Effect.succeed( onOutputItemAdded( event.output_index !== undefined && event.item diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 3a05a12aac9b..3e76f805b2b6 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -222,7 +222,7 @@ export const configure = (input: Options = {}) => { ? openAIResponsesRoute : modelID.startsWith("meta/") ? metaResponsesRoute - : /^(xai|spacexai)\//.test(modelID) + : modelID.startsWith("spacexai/") ? xaiResponsesRoute : responsesRoute return selected.with(configured).model({ id: modelID }) @@ -232,7 +232,7 @@ export const configure = (input: Options = {}) => { .with(configured) .model({ id: modelID, compatibility: { reasoningField: "reasoning" } }) const model = (modelID: string | ModelID) => - /^(openai\/gpt-|meta\/muse-|(xai|spacexai)\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) + /^(openai\/gpt-|meta\/muse-|spacexai\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) const evaluation = (modelID: string | ModelID) => EvaluationModel.make({ id: modelID, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json index 86af7c556a72..d477250d0d03 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-responses-muse-reasoning-and-tools", - "recordedAt": "2026-10-02T03:35:21.178Z" + "recordedAt": "2026-10-02T03:47:29.815Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\",\"object\":\"response\",\"created_at\":1790912118,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\",\"object\":\"response\",\"created_at\":1790912118,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"delta\":\"I'll check the weather in Paris for you.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"text\":\"I'll check the weather in Paris for you.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790912119445_pdw3ait16rd\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":12,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":13,\"item_id\":\"fc_1790912119488_fmfh8fpar5a\",\"output_index\":2,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":14,\"item_id\":\"fc_1790912119488_fmfh8fpar5a\",\"output_index\":2,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":15,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":16,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHCBiZLJ0WO9UES-bCLJWuE20ni_YboWPge8NMyrGAA4w3zL2ofFXlz_QA8s5q79fL9vlkicrlvM0lsE0JaxzY8cIczOgdIWORfVtm73VqVMM1BaiOY7KX8y8ycQBbv6R-SdVSWFfEc5SiIjGOvEuf9WE9VNnGLu-1zKYn7BIEE27KXvUV7xRNbzre1Y1uXkK0Sd8mFf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EoS8DRa_Wq4KS8hgEFBO_-MDXov_3TFDXclKvDLHkPke9PcFd6z1IHRc2PTfftRVht9y6azlJNRpPbjAp6gTi20o9I96xg2Js-Tg9rh0fj0gAN144cibq2vhiMUL-FoDRlRpn2BU8xWKjRnM53puw\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":17,\"response\":{\"id\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\",\"object\":\"response\",\"created_at\":1790912118,\"status\":\"completed\",\"completed_at\":1790912119,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHCBiZLJ0WO9UES-bCLJWuE20ni_YboWPge8NMyrGAA4w3zL2ofFXlz_QA8s5q79fL9vlkicrlvM0lsE0JaxzY8cIczOgdIWORfVtm73VqVMM1BaiOY7KX8y8ycQBbv6R-SdVSWFfEc5SiIjGOvEuf9WE9VNnGLu-1zKYn7BIEE27KXvUV7xRNbzre1Y1uXkK0Sd8mFfzcJFv-P4rZUPW89i4WHe7nfDQs-Y219X-5QTk_QqGUTjE3iEJMVNkCuAANo9Oua7iuJTGDaPYT2n6igsgQdjM6nLl30LVffLqJfr3SOChOHNNDAqzxuR6Lvt1Q2Tfim_rbdxV94GUydAOFmSlXpcnZtIXsIvCDKwxO-NS4d-TDFkRukUhdQ2mLX4md4BOm5ZxkKnpqoL3P86vwcU7LQng2sbKmksdOXiPiNWo3qBnL6DZudyaO21d4vtXjDmpIGFBmsUy-RzTE7F7cHU1cS8wYW6qlJMhcW61dS8sdBCBQc_HrCCLaEs_jC6qSv4civAIP7-33FUBDXs0OeEszz8Bq546xmolKfPn3V5qkH-zLrvsGxZ1aQEw8lnXuJJ7HFduj2gKj5ShfeJm0s7KE6N8O7V9v41B06Z-E-_YA0mXx5rFrylAp7GIo1yiKnrRUrIeVFd488e7-bdgfS6IHbIl3WmNxGi5HLMRbUNOSyOMYvyF5k5n8lDcXhhbtgPbfE1O8n7SwEYjerBmAQ_Y1hXOUFGAhMU3s0vsEb7AJSaNliXNwFzzu0giwDPgj6QPHcsMCD5t4_GUtpMNnip66RP9MFPXYWBDJX2pXXASAzu-iH0rz_dbGdeqNLJ6siYJx-1xElG0-6j3VQlPB9Tu6ju1dYjUZ0lSuy31AjaThfYO0eMnQMpsaAIKtxPnpwgGjHQqG0Mpufr5wOjFBUQ2kx8PdJT4a0Ck2P844KJp0CK2AyjiKLuaJTWpgEogj6RDWiVOi8EvY3Fe-_yCDbZ-izVejxIPEnb7eA21xlRhJf0QOZm8Am1J9U4SQvS1xTwqeVZNQ5qtefdEnQG-KHvAnf3iiYXVW9xUPi9LvckY_2Q_Mr_mU-C7ElDZmtw1QYpO9Fhk528bfeugwk7MiB-214GWevwA_2a930igExMziXYywZWZozQsnAogJmWqUy7UkZUqMyMkagvyqdyobX3B1fS8lkNbhQtYpHa9gfVs4QaEAcpBdV5xSZmecQvj9mbCF7QU_ADWu3qd58gTeMgtfP-t8NyGY5GiruiMCxJWyERwVcSod6rEoS8DRa_Wq4KS8hgEFBO_-MDXov_3TFDXclKvDLHkPke9PcFd6z1IHRc2PTfftRVht9y6azlJNRpPbjAp6gTi20o9I96xg2Js-Tg9rh0fj0gAN144cibq2vhiMUL-FoDRlRpn2BU8xWKjRnM53puw\"},{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\",\"annotations\":[],\"logprobs\":[]}],\"phase\":\"commentary\"},{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":566,\"output_tokens\":142,\"total_tokens\":708,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":74}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf267664a900987566421a\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912117888,\"endTime\":1790912119808,\"providerRequestId\":\"af8cb53b-9e22-4a05-aad4-6d22d5e6ea6b\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf267664a900987566421a\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0011867\",\"marketCost\":\"0.0011867\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0011867\",\"inferenceCost\":\"0.0011867\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.0006035\",\"generationId\":\"gen_01M3XAWF1T11QGK5M41VFRD4W7\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XBJN11MEQASK921ZNG5475\",\"object\":\"response\",\"created_at\":1790912845,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XBJN11MEQASK921ZNG5475\",\"object\":\"response\",\"created_at\":1790912845,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":7,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"output_index\":1,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":8,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"output_index\":1,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":9,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"output_index\":1,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":10,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_1790912846309_p6yophdmrm9\",\"output_index\":2,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":12,\"item_id\":\"fc_1790912846309_p6yophdmrm9\",\"output_index\":2,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":13,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":14,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgGcX7tW_asucU--QZAEe9qQpQX5yPno1V4f0rkJH59hro6mCkdY0Vb_37EjtL-ioCjHsvEK7KOutQ8-5E4eP3Zj61-Umr-aTud8HCvbfXTSh5q76XvZKAFUf8xprQDzl16jjwG5UuCgbpjBbU1DOZWlplHFX_HV0cBFlPzUmiLlMKvcGHjsmtPAyyjQZ-_ap3V7ii0F8XbLiN7Hmuj7QjvY4tJfUim1FAhhsCjZBgLI9SLNik2iLbE1ie1zM5jBDWiDk5mzyfTQKqtLsIEjBeCxmwIlkr3WdPx971qQEA1SXt_NOXZS4GGzaEgRSJBpjkWgbSYGX3ALBhue3nrvxrnZoX5l56kEivlaU0w0fMviG1hJTp-RMa0VzcTRt9yARoYmw_aJxiAoW3XzvaDvTAVvQRKddBDy_vCWD-dUG1wpfLthIA3TjiNWDXiAMBlb2NFz5VN9xVEY5MqwGLeqfDde7DxEwCpoRiRBKbtfCW2AtUHWQxb4PX1lftQn4ywaZiXu3RzgV1WsGjX1pizt0h7dCXPFUxLMgsNfWITU5ET_SOy73U3BQKPSeUUVNkkj1snM0E_sXv9VpdYN9ITblsmBvq-WwKViMBgW4PtjQc05pQaiwr1RdsaQzM7PXi6iX7oOu3GMDHp-kaHf7GC7T8m19wd0fgzyAi43mMN4wqXV2V3HQtf2_gRjnjTAS5ao7VKw9mRA1l2H22YXT0yccku4vPoFrVxT_IRP50S4Sf7IO_CaLMGtAezI1QxWn4MQkFhiY5ycv8_imMVq8gauRvHQPk8nRmZtKpFUpEkvGSSOZBrG_AdBtJ6YDxWcgfogmBNH6vMra2yJxui1G3K1qb2K-Itm9m4B5Obztse_aoOIZQhl18hcU0vu6IBMxHwBo9Fbc871K4vXZ6e8J_Kzx8NpKsEUI1-yxm6upGrU1sqT43CKlTUXWyDUj-YwTjVMrq3RrESY6yFUTBRfSChOyDG4tPfx3-aiDtnoXjItuKIshSYLy8A8GcpH_PAKGYgXiAbADNiU9cIBanNP0buguI1gGMK2V8aY5NVxCGIUmn78zktytGz8h_4kqX_YmELAOdfktLo899gt89SoVHaFqH0hEhDdoORHj_HtEY9JJlAoH_iK0rSKqGNAgTBv_4ggYLTorphcUJyHEW_PzvhC_ixo9P4YSVqwvVjdrySTKWt4eBP_0hh2SyGVjcql3upjJJpF2Lh7bZXDLOtOSmotb9dg72GIjWXhNYL9iYWLJMgRisuuJHfhuQwkvRpy6ILCa-es9pFQ9Q54DxW5jJO_GgjhW8FNaqX8FUE1sPU-cbaU7oyXjilVx1y9fL5C8AeoAubIVvUTtpB1f6CQY7LKILM5B0-U6UlwDa7r0ytjujc4FCEYA277dGQQPux20ioB7fZHt6yU1KJYBA\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":15,\"output_index\":1,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encryp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r49debu67sdVSB3cUNjy3KTxgexaYCPafM68MXsGiutRVEZRhcz9QMjdlB0Ac0qhzTlUyXJs2yZk1CoSS7Povt7dZXB93qJudB7LjkF5YUtBm6ztl6gHb2fr8c2FnuckauKfKF0CAt3YGJH20Wz8ATFEI3eWRT999gb1-B_pKjDVwRv3iZRZH7z5jBtP1jPgqn5OlVxulyJgnDENARtUDnxGbmW0a5cewfzphRs0t7JG-ElWAzYhKo2YvNRg2wqC7AlxvgdNLvh2q7GghztbU6vvARZKcS4r7ztGEGQWfuo2dxYhXYXqXV-opxwMFyGyxLi5EFpZBZY1NzE9IX6uYB6-gA\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":16,\"response\":{\"id\":\"gen_01M3XBJN11MEQASK921ZNG5475\",\"object\":\"response\",\"created_at\":1790912845,\"status\":\"completed\",\"completed_at\":1790912846,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgGcX7tW_asucU--QZAEe9qQpQX5yPno1V4f0rkJH59hro6mCkdY0Vb_37EjtL-ioCjHsvEK7KOutQ8-5E4eP3Zj61-Umr-aTud8HCvbfXTSh5q76XvZKAFUf8xprQDzl16jjwG5UuCgbpjBbU1DOZWlplHFX_HV0cBFlPzUmiLlMKvcGHjsmtPAyyjQZ-_ap3V7ii0F8XbLiN7Hmuj7QjvY4tJfUim1FAhhsCjZBgLI9SLNik2iLbE1ie1zM5jBDWiDk5mzyfTQKqtLsIEjBeCxmwIlkr3WdPx971qQEA1SXt_NOXZS4GGzaEgRSJBpjkWgbSYGX3ALBhue3nrvxrnZoX5l56kEivlaU0w0fMviG1hJTp-RMa0VzcTRt9yARoYmw_aJxiAoW3XzvaDvTAVvQRKddBDy_vCWD-dUG1wpfLthIA3TjiNWDXiAMBlb2NFz5VN9xVEY5MqwGLeqfDde7DxEwCpoRiRBKbtfCW2AtUHWQxb4PX1lftQn4ywaZiXu3RzgV1WsGjX1pizt0h7dCXPFUxLMgsNfWITU5ET_SOy73U3BQKPSeUUVNkkj1snM0E_sXv9VpdYN9ITblsmBvq-WwKViMBgW4PtjQc05pQaiwr1RdsaQzM7PXi6iX7oOu3GMDHp-kaHf7GC7T8m19wd0fgzyAi43mMN4wqXV2V3HQtf2_gRjnjTAS5ao7VKw9mRA1l2H22YXT0yccku4vPoFrVxT_IRP50S4Sf7IO_CaLMGtAezI1QxWn4MQkFhiY5ycv8_imMVq8gauRvHQPk8nRmZtKpFUpEkvGSSOZBrG_AdBtJ6YDxWcgfogmBNH6vMra2yJxui1G3K1qb2K-Itm9m4B5Obztse_aoOIZQhl18hcU0vu6IBMxHwBo9Fbc871K4vXZ6e8J_Kzx8NpKsEUI1-yxm6upGrU1sqT43CKlTUXWyDUj-YwTjVMrq3RrESY6yFUTBRfSChOyDG4tPfx3-aiDtnoXjItuKIshSYLy8A8GcpH_PAKGYgXiAbADNiU9cIBanNP0buguI1gGMK2V8aY5NVxCGIUmn78zktytGz8h_4kqX_YmELAOdfktLo899gt89SoVHaFqH0hEhDdoORHj_HtEY9JJlAoH_iK0rSKqGNAgTBv_4ggYLTorphcUJyHEW_PzvhC_ixo9P4YSVqwvVjdrySTKWt4eBP_0hh2SyGVjcql3upjJJpF2Lh7bZXDLOtOSmotb9dg72GIjWXhNYL9iYWLJMgRisuuJHfhuQwkvRpy6ILCa-es9pFQ9Q54DxW5jJO_GgjhW8FNaqX8FUE1sPU-cbaU7oyXjilVx1y9fL5C8AeoAubIVvUTtpB1f6CQY7LKILM5B0-U6UlwDa7r0ytjujc4FCEYA277dGQQPux20ioB7fZHt6yU1KJYBA\"},{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content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u67sdVSB3cUNjy3KTxgexaYCPafM68MXsGiutRVEZRhcz9QMjdlB0Ac0qhzTlUyXJs2yZk1CoSS7Povt7dZXB93qJudB7LjkF5YUtBm6ztl6gHb2fr8c2FnuckauKfKF0CAt3YGJH20Wz8ATFEI3eWRT999gb1-B_pKjDVwRv3iZRZH7z5jBtP1jPgqn5OlVxulyJgnDENARtUDnxGbmW0a5cewfzphRs0t7JG-ElWAzYhKo2YvNRg2wqC7AlxvgdNLvh2q7GghztbU6vvARZKcS4r7ztGEGQWfuo2dxYhXYXqXV-opxwMFyGyxLi5EFpZBZY1NzE9IX6uYB6-gA\"},{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":566,\"output_tokens\":134,\"total_tokens\":700,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":66}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf294dcba53aa86c104693\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912844868,\"endTime\":1790912846640,\"providerRequestId\":\"72d785e4-c1f4-4f68-8042-8251dcbd9560\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf294dcba53aa86c104693\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0011527\",\"marketCost\":\"0.0011527\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0011527\",\"inferenceCost\":\"0.0011527\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.0005695\",\"generationId\":\"gen_01M3XBJN11MEQASK921ZNG5475\"}}}}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abf267664a900987566421a:rs_01a0faae3e5471b0bdd33656d0a63efd\",\"summary\":[],\"encrypted_content\":\"Q-PaDgHCBiZLJ0WO9UES-bCLJWuE20ni_YboWPge8NMyrGAA4w3zL2ofFXlz_QA8s5q79fL9vlkicrlvM0lsE0JaxzY8cIczOgdIWORfVtm73VqVMM1BaiOY7KX8y8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pHa9gfVs4QaEAcpBdV5xSZmecQvj9mbCF7QU_ADWu3qd58gTeMgtfP-t8NyGY5GiruiMCxJWyERwVcSod6rEoS8DRa_Wq4KS8hgEFBO_-MDXov_3TFDXclKvDLHkPke9PcFd6z1IHRc2PTfftRVht9y6azlJNRpPbjAp6gTi20o9I96xg2Js-Tg9rh0fj0gAN144cibq2vhiMUL-FoDRlRpn2BU8xWKjRnM53puw\"},{\"type\":\"message\",\"id\":\"msg_1790912119445_pdw3ait16rd\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"I'll check the weather in Paris for you.\"}],\"phase\":\"commentary\",\"status\":\"completed\"},{\"type\":\"function_call\",\"id\":\"fc_1790912119488_fmfh8fpar5a\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0faae423476e1a75b91239e88d240\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[],\"encrypted_content\":\"Q-PaDgGcX7tW_asucU--QZAEe9qQpQX5yPno1V4f0rkJH59hro6mCkdY0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oH_iK0rSKqGNAgTBv_4ggYLTorphcUJyHEW_PzvhC_ixo9P4YSVqwvVjdrySTKWt4eBP_0hh2SyGVjcql3upjJJpF2Lh7bZXDLOtOSmotb9dg72GIjWXhNYL9iYWLJMgRisuuJHfhuQwkvRpy6ILCa-es9pFQ9Q54DxW5jJO_GgjhW8FNaqX8FUE1sPU-cbaU7oyXjilVx1y9fL5C8AeoAubIVvUTtpB1f6CQY7LKILM5B0-U6UlwDa7r0ytjujc4FCEYA277dGQQPux20ioB7fZHt6yU1KJYBA\"},{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[],\"encrypted_content\":\"Q-PaDgGYcA_e7QTdfdHQwooR1kzLwbKe1CAkkjKvQot59_rFZd5DYBuDEHAfKU8OJQZS3gbbD368LNl77LijYNZuwy04S7RIKWoCWQtXbsWAujTSjiDwT8nQPPz0soncm9tAH63msOMErMv7U-2xLTgjVUVKDqDArTnSYGsL63itD_UQ3Z_JlRJi-VOSz8Ntk6g3n_KT7PLajapcVu1KMvbVSOJW2cAwYZeZluwhPdDUnLo2oSNzAyf7en_67c5kVXo7D6JXicrXpl71T-OV8PELoi1eaYzfVzHtB6Suu5A6KhdMKJkzzN47bQB4Rcy0g3dxHKkzFd7lV1IMZU5PZSqfYgTgFtblp-OuzZQbBrHZB98VleILOagVV8tdy81YcjzF815es38BogLNO_L74TQYMIiI_-FSOIBjJ1PQhuf5NO9NnJtdyu0F3f5RCcw8de51z6nwlwcJnDb6kkOWF3bFZi2b0aSNm-5d5Q57kPzyQ1tdguASQM9jxEJBxrXXsPJmnwRwlKyw00lLV-MNRDALCPnUvjb87ONGCqw3urclqOxAWqy81RSbjS6msO13yFTVL7i_QXMO-Pq4XsAmw3Z2WkpNWDC8JcTfeaskEfJLmNNDhh_TVEoooMHT6-rUUexTavxK0EFdFcB_fG1AJ1GQbkOAjslGlOdyD7iXXHqqzFC7WheYRVryNeve2_FxZ2mKnbuRn9LKUx-zZe0dm6EhfU6tpirb90OKh94wTjgu9EMzWJ5rdV3HU30PbeJyjU0T9Z0yoSVNSAG4ZYxsGE-w056JHm32sDIz6OJmCNnKqDLGNoSCO10kKnVD8ntYKqto6sUhKMgKODRduHRWPNHrPAhuQgolx97NFVthLiARiZnuQ3ECzL5s-TaPSKKwC4Ro5OqcpjD_a2OprM97JicGCP2D9jQfcKuDxBI6DAVJ6kp-ED1LgFVOjjNJFK4G9FC-QcZguSIcXCAw64yD5d_h-bYQ1oS9F_dVOKeqeXSjMQxabeTRHg-ty6UjTDviHW3wCiiG1Vjmq2Rv7zHgQbTm8VoVcce7JQgE7no7oPB_tS0pb5z_koE-r49debu67sdVSB3cUNjy3KTxgexaYCPafM68MXsGiutRVEZRhcz9QMjdlB0Ac0qhzTlUyXJs2yZk1CoSS7Povt7dZXB93qJudB7LjkF5YUtBm6ztl6gHb2fr8c2FnuckauKfKF0CAt3YGJH20Wz8ATFEI3eWRT999gb1-B_pKjDVwRv3iZRZH7z5jBtP1jPgqn5OlVxulyJgnDENARtUDnxGbmW0a5cewfzphRs0t7JG-ElWAzYhKo2YvNRg2wqC7AlxvgdNLvh2q7GghztbU6vvARZKcS4r7ztGEGQWfuo2dxYhXYXqXV-opxwMFyGyxLi5EFpZBZY1NzE9IX6uYB6-gA\"},{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\",\"object\":\"response\",\"created_at\":1790912120,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\",\"object\":\"response\",\"created_at\":1790912120,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912121132_tdqczb6inx\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790912121132_tdqczb6inx\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912121132_tdqczb6inx\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":12,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgG25hka1t6mau-01mX7SAeruhIYmh3Nlar3vaOp8Oyh6HEv2RyWkVaK8r7kYxok0egJ6f_TOcwGxPxZaBUJJuLp9p9RCQPjah1C_dwsZ0GLnWEaApWeXi8TztOJmqWkSxJiCGy_HAYwShLz_y6lLTJe_KQb1-u5NGE0v2D2bn5kwlNtz2rud8UmMR2idQRP2GPQnCxOQRXu6YMMGlmHxs09DKGt5VAfXGOf678eX1U71FW2Nu4D9EKbGRfvAsuzUuIxTv3vsL9SKojFpBJWwAOQZWik6lC9vRFNtmkua7VhEQfNZCp2ayEw18FZlyNsHGeasxJ1VpWP9opIZkKo4FDLb1tzGwl1bA6Yiw3oJkhLnGDUBk_UCzwaTf6fMvmVZMJ6GfXVaJaAQwoF74p-VPjHN9Vo2iWY5FzcM5Xw8tqzVA8h6QvDC595s44M680HcmZhJi2wTWBv0uUcjjdS5fpQ9o0AIv_iZHSut2gDwKkw5UDXJ1TZZvNqi4FGY6kVrGdoMVXcD9K4q3yCzdJAPJ1YaZgHqiexIt7Vvqk6hlh0O9G6fipxb-3LkeObX24diVMlTK5c377d1ZQB9xH8W4tSDqYjZtJb0XE0ym2Meq5hvKfiqbKFM1k0LFIIvTk57Mjp3vQQrBScikaZPmLUpScyE4fcWff0pIuLktmWckK8Z0z1FfkQh9oBV7OSG5lUoJNwsIWlFQtiX87HXkTGjmt3c9J0PF6L9bu8d6zEU8iqa-wDD4NVpyZnxRlxf-V16oQu-zUY1R-wG4zEG2d0pDKF1mSa4Dt7MR2nXEf0xlwLHEXOA2uQve36RnclUOjAHBpD2O6_Jg_uRGDXWg-Th7fqzoN_eNw9VcKhxMhsUclurmNa7ibmQXloz6hZvOzGThBEIEPPbCIGU4CbfMExOBMKBxyxOlCTsna8Z_h2lxB6Nry_oqRx-HolF0vgfGUTuuOlJEV5FfzgR2QZlGWypQVv20SDx9Iok_ef93QsLRIu32LjryqVEbOfQwd8yH7-bCcDUW7BtTwTu7yR3qMGpU1KIM95GtvpfD7qn-Fy5hVYM1PpFPOXh1vj97kCtD8AVbPSCo2eysQHr3i32Vh9q-qjg36lhQIT3pr6UMxqT6_5pb9g5JFBUOkrEGBTxF9_9fmtM2GHqybRGusDT5LgH1i7hKS0NLDLuqa-6T-J2L_-VE3y5lqcwWswFjRBBvbrLsoNnNMCR3fMiPuWxOFoV9tguyStORBzwUrOb0nZk_yQEY2BYCIQn78WQDTHb3TsaoNgl7oXqrLvOenlNt_XKY39RluxrRL2pAE0e9mTqABvK3vdq55LodPtG5_ClteNCetTWnEqSC1pm9kScNeTOPNJwDx3lsB5Ay0BQVp5-Ha_9M8uMG8doG37i7YM9xRpwcKD848pzTwjFQ\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":13,\"response\":{\"id\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\",\"object\":\"response\",\"created_at\":1790912120,\"status\":\"completed\",\"completed_at\":1790912121,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf2678293ec0971e2045ea:rs_01a0faae46fb7655bba38ba70bb67083\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgG25hka1t6mau-01mX7SAeruhIYmh3Nlar3vaOp8Oyh6HEv2RyWkVaK8r7kYxok0egJ6f_TOcwGxPxZaBUJJuLp9p9RCQPjah1C_dwsZ0GLnWEaApWeXi8TztOJmqWkSxJiCGy_HAYwShLz_y6lLTJe_KQb1-u5NGE0v2D2bn5kwlNtz2rud8UmMR2idQRP2GPQnCxOQRXu6YMMGlmHxs09DKGt5VAfXGOf678eX1U71FW2Nu4D9EKbGRfvAsuzUuIxTv3vsL9SKojFpBJWwAOQZWik6lC9vR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ScNeTOPNJwDx3lsB5Ay0BQVp5-Ha_9M8uMG8doG37i7YM9xRpwcKD848pzTwjFQ\"},{\"type\":\"message\",\"id\":\"msg_1790912121132_tdqczb6inx\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":660,\"output_tokens\":65,\"total_tokens\":725,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":51}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":null,\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf2678293ec0971e2045ea\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912119958,\"endTime\":1790912121224,\"providerRequestId\":\"4d723793-0d5c-479a-a795-aac71ba1c478\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf2678293ec0971e2045ea\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00097695\",\"marketCost\":\"0.00097695\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00097695\",\"inferenceCost\":\"0.00097695\",\"inputInferenceCost\":\"0.0007007\",\"outputInferenceCost\":\"0.00027625\",\"generationId\":\"gen_01M3XAWH32PSW4F6MSKX51X2D0\"}}}}\n\n" + "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XBJPY6AH9184426JK693TH\",\"object\":\"response\",\"created_at\":1790912849,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XBJPY6AH9184426JK693TH\",\"object\":\"response\",\"created_at\":1790912849,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912849753_bkjnm75ewti\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912849753_bkjnm75ewti\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":12,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHk1ZD4EMnLsvripK8ayvpz_dR_DZA6bWDuWBFM9az_Nc_LAOSUjrxU7L2N44phRQ46P6kVUb-r6d8lYxPjSkBXtDk300_xeO6K21zvxZooBcwSIFogwroj3y1cK9VRPEHPV7i3yInDjoy1cSU6J4XpZ77RF-vWwCQfRaU8hxCXlzgsGwGlohzTj3ZgZRlGpMhZqAxNyHL0n1rjJwV3lRjWxjKZWvESqxlhsf5tYWczX8drHD-CHomtYS7mAzwq4q3At6aKNAjEc6rYHU8Ud0V4iVZ5ikBX0bCga4E5w_6Mr9d5OIB9LPN0_-9ZskX41LpwTKPdygfybOJuYmVOAZFHr2PEK-VNossJHUOWvyR5GMdp0U4pEwDlXngYEwrszzSiSYV8CYX06tvaSGKV4rm2gBkT_72HMY4mz6yleAG34YARFBIJzDMGWLMKt7LZDgLsqBc0oriHxViTKVARbccLHCtPQtr1VmYEyCdXbhbDAOKChpv4-wkHNKvd2kt6bzfvBysiGsv1QSYzJqX3ZCqb0nvix5wLp4cYaxYM_DhhWsdVsh1wIFocKo8Syxqj2UmoB2AB5Tm8VL6DD0zufUiMye7PopvHsqXaM8tZirTIg8IGfHR2YSOAIhjobuMG_Nrqq9JPCFgYP4w2aH7Bjy95soSPOgHC5QtjmgRdoFjnG1TisPnf6ewltJzNTBN9_AMVtKCMvmNRCzav9Qq_o3r4NDIDFdnIXtS7-7p2CIHvTX36ZJk5iGM7sr1iUx8GqPARpvXSgqr7uMxMYh9evW0wiSQgxnoKy_mS1C1PE4MtgJ11PIFOlIioF4zLAirOj5XX9_qCLQfLUu27-AecMpUu1guQW-aIIvmNErPs2-se-du86TPcEnnBvvMmHWP5GwbdU5DELy8BLUDKGdC421Dih34jlHM32PuDjbgqBevyS84mdgZLhU8_AD4KEJ_sb9EN1XSu-HlBeXz8CzPjYzBRRV7KxGQyFC8aTXRFCxzyArrMqTP3Y-2dQt2mMtr6MNHSgNMwEtSFAfqCCBxQDMFrG1-0bWlATCcU-tfN-p88WOdMTkLIfoC4904yES6LrLFYPBZ53fSzviyI_oXxKoRyNfEKztB6v5rWU4M9G3pWuyjrygE4x68dY9A5KK-aUSzGW0chq5yEapCDQ_tD7gchG81qGsktlnhJUuxkg6xQTwqMXtGF_4EWts-8FYYX3iv-gSK0Fxfg2UIYi4JdVV2ZwldKFplhYZoMxxgwcdm5eSUUl8xXhMxXwblSUXBIKX_KaWSukbKaIC82we8ZbRDJv_abWM7JDX7dyrUxyfQ9rFNUShfNfvCzYKCtMWvh6zCajNkKrX_zBuSn89tuwDxIV4yuBCi0J3iBdNjKRUrW9BcYtlx_gUxKc_RIbD7VwI3w1QUW5UeOMw\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":13,\"response\":{\"id\":\"gen_01M3XBJPY6AH9184426JK693TH\",\"object\":\"response\",\"created_at\":1790912849,\"status\":\"completed\",\"completed_at\":1790912849,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHk1ZD4EMnLsvripK8ayvpz_dR_DZA6bWDuWBFM9az_Nc_LAOSUjrxU7L2N44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KK-aUSzGW0chq5yEapCDQ_tD7gchG81qGsktlnhJUuxkg6xQTwqMXtGF_4EWts-8FYYX3iv-gSK0Fxfg2UIYi4JdVV2ZwldKFplhYZoMxxgwcdm5eSUUl8xXhMxXwblSUXBIKX_KaWSukbKaIC82we8ZbRDJv_abWM7JDX7dyrUxyfQ9rFNUShfNfvCzYKCtMWvh6zCajNkKrX_zBuSn89tuwDxIV4yuBCi0J3iBdNjKRUrW9BcYtlx_gUxKc_RIbD7VwI3w1QUW5UeOMw\"},{\"type\":\"message\",\"id\":\"msg_1790912849753_bkjnm75ewti\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":643,\"output_tokens\":73,\"total_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":59}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf29513ebbe56000854d69\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912846900,\"endTime\":1790912849843,\"providerRequestId\":\"152dd919-7a88-4322-aa33-bbcd1900ce24\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf29513ebbe56000854d69\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0009897\",\"marketCost\":\"0.0009897\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0009897\",\"inferenceCost\":\"0.0009897\",\"inputInferenceCost\":\"0.00067945\",\"outputInferenceCost\":\"0.00031025\",\"generationId\":\"gen_01M3XBJPY6AH9184426JK693TH\"}}}}\n\n" } } ] diff --git a/packages/ai/test/provider/openai-responses.test.ts b/packages/ai/test/provider/openai-responses.test.ts index 1a9baa29d5cd..5371b59e4b84 100644 --- a/packages/ai/test/provider/openai-responses.test.ts +++ b/packages/ai/test/provider/openai-responses.test.ts @@ -3129,23 +3129,45 @@ describe("OpenAI Responses route", () => { }), ) - it.effect("rejects a reasoning item that starts before the previous item ends", () => + it.effect("allows reasoning items to overlap until their output items finish", () => Effect.gen(function* () { - const error = yield* LLMClient.generate(request).pipe( + const response = yield* LLMClient.generate(request).pipe( Effect.provide( fixedResponse( sseEvents( - { type: "response.output_item.added", item: { type: "reasoning", id: "rs_1" } }, - { type: "response.reasoning_summary_text.delta", item_id: "rs_1", summary_index: 0, delta: "First" }, - { type: "response.output_item.added", item: { type: "reasoning", id: "rs_2" } }, + { type: "response.output_item.added", output_index: 0, item: { type: "reasoning", id: "rs_1" } }, + { type: "response.output_item.added", output_index: 1, item: { type: "reasoning", id: "rs_2" } }, + { + type: "response.output_item.added", + output_index: 2, + item: { type: "function_call", id: "fc_1", call_id: "call_1", name: "lookup", arguments: "" }, + }, + { + type: "response.output_item.done", + output_index: 2, + item: { type: "function_call", id: "fc_1", call_id: "call_1", name: "lookup", arguments: "{}" }, + }, + { + type: "response.output_item.done", + output_index: 0, + item: { type: "reasoning", id: "rs_1", encrypted_content: "first", summary: [] }, + }, + { + type: "response.output_item.done", + output_index: 1, + item: { type: "reasoning", id: "rs_2", encrypted_content: "second", summary: [] }, + }, + { type: "response.completed", response: { id: "resp_1", output: [] } }, ), ), ), - Effect.flip, ) - expect(error.reason._tag).toBe("InvalidProviderOutput") - expect(error.message).toContain("started reasoning before the previous item ended") + expect(response.message.content).toMatchObject([ + { type: "reasoning", providerMetadata: { openai: { itemId: "rs_1", reasoningEncryptedContent: "first" } } }, + { type: "reasoning", providerMetadata: { openai: { itemId: "rs_2", reasoningEncryptedContent: "second" } } }, + { type: "tool-call", id: "call_1", name: "lookup", input: {} }, + ]) }), ) diff --git a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts index d04fb0b05f05..f0476206577f 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts @@ -32,7 +32,12 @@ for (const item of [ options: { reasoningEffort: "low" }, reasoning: false, }, - { name: "responses Muse", model: gateway.model("meta/muse-spark-1.3"), options: {}, reasoning: true }, + { + name: "responses Muse", + model: gateway.model("meta/muse-spark-1.3"), + options: { reasoningEffort: "low" }, + reasoning: true, + }, { name: "responses Grok", model: gateway.model("spacexai/grok-4.7"), From cce4cf1dafff98bb964d17b1d3c61dd98df79927 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Thu, 1 Oct 2026 22:54:12 -0500 Subject: [PATCH 05/19] refactor(ai): use one Gateway Responses route --- .../ai/src/providers/vercel-ai-gateway.ts | 51 ++----------------- 1 file changed, 4 insertions(+), 47 deletions(-) diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 3e76f805b2b6..f98774984d01 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -9,13 +9,10 @@ import { EvaluationRounding, } from "../experimental/evaluation.js" import { AnthropicMessages } from "../protocols/anthropic-messages.js" -import { MetaResponses } from "../protocols/meta-responses.js" import { OpenAIChat } from "../protocols/openai-chat.js" -import { OpenAIResponses } from "../protocols/openai-responses.js" import { OpenResponses } from "../protocols/open-responses.js" import { ProviderShared } from "../protocols/shared.js" import { gatewayProtocol } from "../protocols/utils/gateway-protocol.js" -import { XAIResponses } from "../protocols/xai-responses.js" import type { ProviderPackage } from "../provider-package.js" import { Auth } from "../route/auth.js" import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" @@ -124,7 +121,6 @@ const route = (input: { defaults: input.defaults, }) -const responsesDefaults = { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } } const messagesRoute = route({ id: "vercel-ai-gateway-messages", protocol: AnthropicMessages.protocol, @@ -133,37 +129,13 @@ const messagesRoute = route({ framing: AnthropicMessages.framing, defaults: { headers: { "anthropic-version": "2023-06-01" } }, }) -const openAIResponsesRoute = route({ - id: "vercel-ai-gateway-openai-responses", - protocol: OpenAIResponses.protocol, - api: "responses", - path: "/responses", - framing: Framing.sse, - defaults: responsesDefaults, -}) -const metaResponsesRoute = route({ - id: "vercel-ai-gateway-meta-responses", - protocol: MetaResponses.protocol, - api: "responses", - path: "/responses", - framing: Framing.sse, - defaults: responsesDefaults, -}) -const xaiResponsesRoute = route({ - id: "vercel-ai-gateway-xai-responses", - protocol: XAIResponses.protocol, - api: "responses", - path: "/responses", - framing: Framing.sse, - defaults: responsesDefaults, -}) const responsesRoute = route({ id: "vercel-ai-gateway-responses", protocol: OpenResponses.protocol, api: "responses", path: "/responses", framing: Framing.sse, - defaults: { providerOptions: { store: false } }, + defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } }, }) const chatRoute = route({ id: "vercel-ai-gateway-chat", @@ -173,14 +145,7 @@ const chatRoute = route({ framing: OpenAIChat.framing, }) -export const routes = [ - messagesRoute, - openAIResponsesRoute, - metaResponsesRoute, - xaiResponsesRoute, - responsesRoute, - chatRoute, -] +export const routes = [messagesRoute, responsesRoute, chatRoute] const Request = Schema.StructWithRest( Schema.Struct({ @@ -217,16 +182,8 @@ export const configure = (input: Options = {}) => { // Recorded Gateway translations for non-Claude models return thinking with empty signatures. compatibility: { requireSignature: modelID.startsWith("anthropic/") }, }) - const responses = (modelID: string | ModelID) => { - const selected = modelID.startsWith("openai/") - ? openAIResponsesRoute - : modelID.startsWith("meta/") - ? metaResponsesRoute - : modelID.startsWith("spacexai/") - ? xaiResponsesRoute - : responsesRoute - return selected.with(configured).model({ id: modelID }) - } + const responses = (modelID: string | ModelID) => + responsesRoute.with(configured).model({ id: modelID }) const chat = (modelID: string | ModelID) => chatRoute .with(configured) From f5c8f5d4dd58ba58f8052ff2e7a8bf6e85bc195b Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Sun, 4 Oct 2026 21:57:00 -0500 Subject: [PATCH 06/19] fix(ai): restore Responses reasoning overlap check Core still allows one open reasoning block per step, so accepting overlapping reasoning items turned a retryable provider error into a session defect. The overlap fix will land separately with the Core changes it needs. --- packages/ai/src/protocols/open-responses.ts | 6 +++ .../ai/test/provider/openai-responses.test.ts | 38 ++++--------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/packages/ai/src/protocols/open-responses.ts b/packages/ai/src/protocols/open-responses.ts index f9513c7033ae..1672f4b7ce63 100644 --- a/packages/ai/src/protocols/open-responses.ts +++ b/packages/ai/src/protocols/open-responses.ts @@ -1440,6 +1440,12 @@ export const step = (state: ParserState, event: NormalizedEvent) => { ? Effect.succeed(onReasoningSummaryPartDone(state, event)) : ProviderShared.eventError(state.id, `${event.type} is missing item_id`) if (event.type === "response.output_item.added") { + if ( + event.item?.type === "reasoning" && + state.reasoningItems[event.item.id] === undefined && + state.lifecycle.reasoning.size > 0 + ) + return ProviderShared.eventError(state.id, `${event.type} started reasoning before the previous item ended`) return Effect.succeed( onOutputItemAdded( event.output_index !== undefined && event.item diff --git a/packages/ai/test/provider/openai-responses.test.ts b/packages/ai/test/provider/openai-responses.test.ts index 5371b59e4b84..1a9baa29d5cd 100644 --- a/packages/ai/test/provider/openai-responses.test.ts +++ b/packages/ai/test/provider/openai-responses.test.ts @@ -3129,45 +3129,23 @@ describe("OpenAI Responses route", () => { }), ) - it.effect("allows reasoning items to overlap until their output items finish", () => + it.effect("rejects a reasoning item that starts before the previous item ends", () => Effect.gen(function* () { - const response = yield* LLMClient.generate(request).pipe( + const error = yield* LLMClient.generate(request).pipe( Effect.provide( fixedResponse( sseEvents( - { type: "response.output_item.added", output_index: 0, item: { type: "reasoning", id: "rs_1" } }, - { type: "response.output_item.added", output_index: 1, item: { type: "reasoning", id: "rs_2" } }, - { - type: "response.output_item.added", - output_index: 2, - item: { type: "function_call", id: "fc_1", call_id: "call_1", name: "lookup", arguments: "" }, - }, - { - type: "response.output_item.done", - output_index: 2, - item: { type: "function_call", id: "fc_1", call_id: "call_1", name: "lookup", arguments: "{}" }, - }, - { - type: "response.output_item.done", - output_index: 0, - item: { type: "reasoning", id: "rs_1", encrypted_content: "first", summary: [] }, - }, - { - type: "response.output_item.done", - output_index: 1, - item: { type: "reasoning", id: "rs_2", encrypted_content: "second", summary: [] }, - }, - { type: "response.completed", response: { id: "resp_1", output: [] } }, + { type: "response.output_item.added", item: { type: "reasoning", id: "rs_1" } }, + { type: "response.reasoning_summary_text.delta", item_id: "rs_1", summary_index: 0, delta: "First" }, + { type: "response.output_item.added", item: { type: "reasoning", id: "rs_2" } }, ), ), ), + Effect.flip, ) - expect(response.message.content).toMatchObject([ - { type: "reasoning", providerMetadata: { openai: { itemId: "rs_1", reasoningEncryptedContent: "first" } } }, - { type: "reasoning", providerMetadata: { openai: { itemId: "rs_2", reasoningEncryptedContent: "second" } } }, - { type: "tool-call", id: "call_1", name: "lookup", input: {} }, - ]) + expect(error.reason._tag).toBe("InvalidProviderOutput") + expect(error.message).toContain("started reasoning before the previous item ended") }), ) From fcd6c71777a8f218bf93a8e2428978380249057c Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Sun, 4 Oct 2026 21:57:01 -0500 Subject: [PATCH 07/19] feat(ai): route Gateway models by reasoning support GPT and Grok use Responses, Muse uses Chat, and every other model uses Messages: each family goes to the Gateway API that carries its reasoning across turns. Adds recorded Muse Chat and DeepSeek Messages tool loops. --- packages/ai/README.md | 4 +- .../ai/src/providers/vercel-ai-gateway.ts | 8 ++- ...ntinues-chat-muse-reasoning-and-tools.json | 49 +++++++++++++++++++ ...messages-deepseek-reasoning-and-tools.json | 49 +++++++++++++++++++ ...es-responses-muse-reasoning-and-tools.json | 49 ------------------- .../vercel-ai-gateway.recorded.test.ts | 8 ++- .../test/provider/vercel-ai-gateway.test.ts | 3 +- 7 files changed, 115 insertions(+), 55 deletions(-) create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json create mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json delete mode 100644 packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json diff --git a/packages/ai/README.md b/packages/ai/README.md index c449781fb9d0..17d3a96a029e 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1302,14 +1302,14 @@ const gateway = VercelAIGateway.configure({ gateway.model("anthropic/claude-sonnet-5.5") // Messages gateway.model("openai/gpt-6-luna") // Responses -gateway.model("meta/muse-spark-1.3") // Responses +gateway.model("meta/muse-spark-1.3") // Chat gateway.model("spacexai/grok-4.7") // Responses gateway.chat("anthropic/claude-sonnet-5.5") // Explicit Chat override gateway.responses("google/gemini-3.8-flash") // Explicit Responses override gateway.messages("openai/gpt-6-luna") // Explicit Messages override ``` -Default routing sends `openai/gpt-*`, `meta/muse-*`, and `spacexai/grok-*` to Responses; everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. +Default routing picks the API whose Gateway translation carries each family's reasoning across turns: `openai/gpt-*` and `spacexai/grok-*` use Responses, `meta/muse-*` uses Chat, and everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. Set `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index f98774984d01..1d4c009ebf92 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -188,8 +188,12 @@ export const configure = (input: Options = {}) => { chatRoute .with(configured) .model({ id: modelID, compatibility: { reasoningField: "reasoning" } }) - const model = (modelID: string | ModelID) => - /^(openai\/gpt-|meta\/muse-|spacexai\/grok-)/.test(modelID) ? responses(modelID) : messages(modelID) + // Each family uses the API whose Gateway translation carries its reasoning state across turns. + const model = (modelID: string | ModelID) => { + if (/^(openai\/gpt-|spacexai\/grok-)/.test(modelID)) return responses(modelID) + if (modelID.startsWith("meta/muse-")) return chat(modelID) + return messages(modelID) + } const evaluation = (modelID: string | ModelID) => EvaluationModel.make({ id: modelID, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json new file mode 100644 index 000000000000..958b3713bc28 --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-chat-muse-reasoning-and-tools", + "recordedAt": "2026-10-05T02:56:27.988Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/chat/completions", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"meta/muse-spark-1.3\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "data: {\"id\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\",\"object\":\"chat.completion.chunk\",\"created\":1791168985,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_h4uvdop29h\"}\n\ndata: {\"id\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\",\"object\":\"chat.completion.chunk\",\"created\":1791168985,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"I'll look up the weather in Paris for you.\",\"phase\":\"commentary\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_h4uvdop29h\"}\n\ndata: {\"id\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\",\"object\":\"chat.completion.chunk\",\"created\":1791168985,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_h4uvdop29h\"}\n\ndata: {\"id\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\",\"object\":\"chat.completion.chunk\",\"created\":1791168985,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"tool_calls\":[{\"index\":0,\"function\":{\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}]},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_h4uvdop29h\"}\n\ndata: {\"id\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\",\"object\":\"chat.completion.chunk\",\"created\":1791168985,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6ac311d9306b8844d6104957\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791168984107,\"endTime\":1791168986296,\"providerRequestId\":\"f93f8fd8-1b40-49b2-8a0c-222d6e70af95\",\"statusCode\":200,\"providerResponseId\":\"resp_6ac311d9306b8844d6104957\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0012462\",\"marketCost\":\"0.0012462\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0012462\",\"inferenceCost\":\"0.0012462\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.000663\",\"generationId\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\"}}},\"logprobs\":null,\"finish_reason\":\"tool_calls\"}],\"usage\":{\"prompt_tokens\":566,\"completion_tokens\":156,\"total_tokens\":722,\"cost\":0.0012462,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":113,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":87,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.0012462,\"gateway_cost\":0.0012462},\"system_fingerprint\":\"fp_h4uvdop29h\",\"service_tier\":\"auto\",\"generationId\":\"gen_01M44ZVD02HF12MJ8X2S7SK1E6\"}\n\ndata: [DONE]\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/chat/completions", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"meta/muse-spark-1.3\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"I'll look up the weather in Paris for you.\",\"tool_calls\":[{\"id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"\"},{\"role\":\"tool\",\"tool_call_id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "data: {\"id\":\"gen_01M44ZVF8Y196MQE5QNXBYK63X\",\"object\":\"chat.completion.chunk\",\"created\":1791168987,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_t8q87incvs\"}\n\ndata: {\"id\":\"gen_01M44ZVF8Y196MQE5QNXBYK63X\",\"object\":\"chat.completion.chunk\",\"created\":1791168987,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"Paris is sunny.\"},\"logprobs\":null,\"finish_reason\":null}],\"system_fingerprint\":\"fp_t8q87incvs\"}\n\ndata: {\"id\":\"gen_01M44ZVF8Y196MQE5QNXBYK63X\",\"object\":\"chat.completion.chunk\",\"created\":1791168987,\"model\":\"meta/muse-spark-1.3\",\"choices\":[{\"index\":0,\"delta\":{\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6ac311db491fe86e00954e5c\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791168986439,\"endTime\":1791168988032,\"providerRequestId\":\"88abdbee-80b6-444b-a295-16cd5b25801f\",\"statusCode\":200,\"providerResponseId\":\"resp_6ac311db491fe86e00954e5c\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0011\",\"marketCost\":\"0.0011\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0011\",\"inferenceCost\":\"0.0011\",\"inputInferenceCost\":\"0.00082375\",\"outputInferenceCost\":\"0.00027625\",\"generationId\":\"gen_01M44ZVF8Y196MQE5QNXBYK63X\"}}},\"logprobs\":null,\"finish_reason\":\"stop\"}],\"usage\":{\"prompt_tokens\":659,\"completion_tokens\":65,\"total_tokens\":724,\"cost\":0.0011,\"is_byok\":false,\"prompt_tokens_details\":{\"cached_tokens\":0,\"audio_tokens\":0,\"video_tokens\":0},\"cost_details\":{\"upstream_inference_cost\":null,\"upstream_inference_prompt_cost\":0,\"upstream_inference_completions_cost\":0},\"completion_tokens_details\":{\"reasoning_tokens\":51,\"image_tokens\":0},\"cache_creation_input_tokens\":0,\"market_cost\":0.0011,\"gateway_cost\":0.0011},\"system_fingerprint\":\"fp_t8q87incvs\",\"service_tier\":\"auto\",\"generationId\":\"gen_01M44ZVF8Y196MQE5QNXBYK63X\"}\n\ndata: [DONE]\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json new file mode 100644 index 000000000000..2c88e0cc3c3c --- /dev/null +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json @@ -0,0 +1,49 @@ +{ + "version": 1, + "metadata": { + "tags": [ + "prefix:vercel-native", + "provider:vercel-ai-gateway" + ], + "name": "vercel-native/continues-messages-deepseek-reasoning-and-tools", + "recordedAt": "2026-10-05T02:56:29.224Z" + }, + "interactions": [ + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"deepseek/deepseek-v4.1-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"high\"},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M44ZVH1C4678Q0TYP7DRJ7J2\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"deepseek/deepseek-v4.1-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"thinking\",\"thinking\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\"The\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" user wants\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" me to call\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" get_weather once\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" for Paris, then\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" reply exactly \\\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"thinking_delta\",\"thinking\":\" is sunny.\\\"\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":1,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":1,\"delta\":{\"type\":\"text_delta\",\"text\":\"\\n\\n\"}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":2,\"content_block\":{\"type\":\"tool_use\",\"id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":2,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\": \\\"Paris\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":1}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":2}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":324,\"output_tokens\":61},\"provider_metadata\":{\"baseten\":{\"acceptedPredictionTokens\":44,\"rejectedPredictionTokens\":4},\"gateway\":{\"routing\":{\"originalModelId\":\"deepseek/deepseek-v4.1-flash\",\"resolvedProvider\":\"baseten\",\"fallbacksAvailable\":[\"fireworks\",\"alibaba\",\"runware\",\"relace\",\"particle\",\"novita\",\"togetherai\",\"deepinfra\",\"wafer\",\"parasail\",\"gmicloud\",\"modal\",\"morph\",\"deepseek\",\"runinfra\",\"boundless\",\"inference-net\"],\"planningReasoning\":\"System credentials planned for: baseten, fireworks, alibaba, runware, relace, particle, novita, togetherai, deepinfra, wafer, parasail, gmicloud, modal, morph, deepseek, runinfra, boundless, inference-net. Total execution order: baseten(system) → fireworks(system) → alibaba(system) → runware(system) → relace(system) → particle(system) → novita(system) → togetherai(system) → deepinfra(system) → wafer(system) → parasail(system) → gmicloud(system) → modal(system) → morph(system) → deepseek(system) → runinfra(system) → boundless(system) → inference-net(system)\",\"canonicalSlug\":\"deepseek/deepseek-v4.1-flash\",\"finalProvider\":\"baseten\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"deepseek/deepseek-v4.1-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"baseten\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791168988247,\"endTime\":1791168988517,\"providerRequestId\":\"54ca701a109fdc46b7da8b6ab43570cc519dd\",\"statusCode\":200,\"providerResponseId\":\"chatcmpl-4234517cc89342a79b53a68ac41601eb\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0001704\",\"marketCost\":\"0.0001704\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0001704\",\"inferenceCost\":\"0.0001704\",\"inputInferenceCost\":\"0.0000972\",\"outputInferenceCost\":\"0.0000732\",\"generationId\":\"gen_01M44ZVH1C4678Q0TYP7DRJ7J2\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + }, + { + "transport": "http", + "request": { + "method": "POST", + "url": "https://ai-gateway.vercel.sh/v1/messages", + "headers": { + "content-type": "application/json" + }, + "body": "{\"model\":\"deepseek/deepseek-v4.1-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"The user wants me to call get_weather once for Paris, then reply exactly \\\"Paris is sunny.\\\"\",\"signature\":\"\"},{\"type\":\"tool_use\",\"id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"high\"},\"providerOptions\":{\"gateway\":{}}}" + }, + "response": { + "status": 200, + "headers": { + "content-type": "text/event-stream" + }, + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M44ZVHFBW1M2N3JSPQG4PXFG\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"deepseek/deepseek-v4.1-flash\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":406,\"output_tokens\":6},\"provider_metadata\":{\"baseten\":{\"acceptedPredictionTokens\":4,\"rejectedPredictionTokens\":2},\"gateway\":{\"routing\":{\"originalModelId\":\"deepseek/deepseek-v4.1-flash\",\"resolvedProvider\":\"baseten\",\"fallbacksAvailable\":[\"fireworks\",\"alibaba\",\"runware\",\"relace\",\"particle\",\"novita\",\"togetherai\",\"deepinfra\",\"wafer\",\"parasail\",\"gmicloud\",\"modal\",\"morph\",\"deepseek\",\"runinfra\",\"boundless\",\"inference-net\"],\"planningReasoning\":\"System credentials planned for: baseten, fireworks, alibaba, runware, relace, particle, novita, togetherai, deepinfra, wafer, parasail, gmicloud, modal, morph, deepseek, runinfra, boundless, inference-net. Total execution order: baseten(system) → fireworks(system) → alibaba(system) → runware(system) → relace(system) → particle(system) → novita(system) → togetherai(system) → deepinfra(system) → wafer(system) → parasail(system) → gmicloud(system) → modal(system) → morph(system) → deepseek(system) → runinfra(system) → boundless(system) → inference-net(system)\",\"canonicalSlug\":\"deepseek/deepseek-v4.1-flash\",\"finalProvider\":\"baseten\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"deepseek/deepseek-v4.1-flash\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"baseten\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791168989072,\"endTime\":1791168989270,\"providerRequestId\":\"54ca701a109fdc7a977f6a444f59bbed7ee04\",\"statusCode\":200,\"providerResponseId\":\"chatcmpl-01cf067760f44cc1bca4b7a01722e964\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"no_pin\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.000129\",\"marketCost\":\"0.000129\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.000129\",\"inferenceCost\":\"0.000129\",\"inputInferenceCost\":\"0.0001218\",\"outputInferenceCost\":\"0.0000072\",\"generationId\":\"gen_01M44ZVHFBW1M2N3JSPQG4PXFG\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + } + } + ] +} diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json deleted file mode 100644 index d477250d0d03..000000000000 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-muse-reasoning-and-tools.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "version": 1, - "metadata": { - "tags": [ - "prefix:vercel-native", - "provider:vercel-ai-gateway" - ], - "name": "vercel-native/continues-responses-muse-reasoning-and-tools", - "recordedAt": "2026-10-02T03:47:29.815Z" - }, - "interactions": [ - { - "transport": "http", - "request": { - "method": "POST", - "url": "https://ai-gateway.vercel.sh/v1/responses", - "headers": { - "content-type": "application/json" - }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" - }, - "response": { - "status": 200, - "headers": { - "content-type": "text/event-stream" - }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XBJN11MEQASK921ZNG5475\",\"object\":\"response\",\"created_at\":1790912845,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XBJN11MEQASK921ZNG5475\",\"object\":\"response\",\"created_at\":1790912845,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":7,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"output_index\":1,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":8,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"output_index\":1,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":9,\"item_id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"output_index\":1,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":10,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"\",\"status\":\"in_progress\"}}\n\nevent: response.function_call_arguments.delta\ndata: {\"type\":\"response.function_call_arguments.delta\",\"sequence_number\":11,\"item_id\":\"fc_1790912846309_p6yophdmrm9\",\"output_index\":2,\"delta\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.function_call_arguments.done\ndata: {\"type\":\"response.function_call_arguments.done\",\"sequence_number\":12,\"item_id\":\"fc_1790912846309_p6yophdmrm9\",\"output_index\":2,\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":13,\"output_index\":2,\"item\":{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":14,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgGcX7tW_asucU--QZAEe9qQpQX5yPno1V4f0rkJH59hro6mCkdY0Vb_37EjtL-ioCjHsvEK7KOutQ8-5E4eP3Zj61-Umr-aTud8HCvbfXTSh5q76XvZKAFUf8xprQDzl16jjwG5UuCgbpjBbU1DOZWlplHFX_HV0cBFlPzUmiLlMKvcGHjsmtPAyyjQZ-_ap3V7ii0F8XbLiN7Hmuj7QjvY4tJfUim1FAhhsCjZBgLI9SLNik2iLbE1ie1zM5jBDWiDk5mzyfTQKqtLsIEjBeCxmwIlkr3WdPx971qQEA1SXt_NOXZS4GGzaEgRSJBpjkWgbSYGX3ALBhue3nrvxrnZoX5l56kEivlaU0w0fMviG1hJTp-RMa0VzcTRt9yARoYmw_aJxiAoW3XzvaDvTAVvQRKddBDy_vCWD-dUG1wpfLthIA3TjiNWDXiAMBlb2NFz5VN9xVEY5MqwGLeqfDde7DxEwCpoRiRBKbtfCW2AtUHWQxb4PX1lftQn4ywaZiXu3RzgV1WsGjX1pizt0h7dCXPFUxLMgsNfWITU5ET_SOy73U3BQKPSeUUVNkkj1snM0E_sXv9VpdYN9ITblsmBvq-WwKViMBgW4PtjQc05pQaiwr1RdsaQzM7PXi6iX7oOu3GMDHp-kaHf7GC7T8m19wd0fgzyAi43mMN4wqXV2V3HQtf2_gRjnjTAS5ao7VKw9mRA1l2H22YXT0yccku4vPoFrVxT_IRP50S4Sf7IO_CaLMGtAezI1QxWn4MQkFhiY5ycv8_imMVq8gauRvHQPk8nRmZtKpFUpEkvGSSOZBrG_AdBtJ6YDxWcgfogmBNH6vMra2yJxui1G3K1qb2K-Itm9m4B5Obztse_aoOIZQhl18hcU0vu6IBMxHwBo9Fbc871K4vXZ6e8J_Kzx8NpKsEUI1-yxm6upGrU1sqT43CKlTUXWyDUj-YwTjVMrq3RrESY6yFUTBRfSChOyDG4tPfx3-aiDtnoXjItuKIshSYLy8A8GcpH_PAKGYgXiAbADNiU9cIBanNP0buguI1gGMK2V8aY5NVxCGIUmn78zktytGz8h_4kqX_YmELAOdfktLo899gt89SoVHaFqH0hEhDdoORHj_HtEY9JJlAoH_iK0rSKqGNAgTBv_4ggYLTorphcUJyHEW_PzvhC_ixo9P4YSVqwvVjdrySTKWt4eBP_0hh2SyGVjcql3upjJJpF2Lh7bZXDLOtOSmotb9dg72GIjWXhNYL9iYWLJMgRisuuJHfhuQwkvRpy6ILCa-es9pFQ9Q54DxW5jJO_GgjhW8FNaqX8FUE1sPU-cbaU7oyXjilVx1y9fL5C8AeoAubIVvUTtpB1f6CQY7LKILM5B0-U6UlwDa7r0ytjujc4FCEYA277dGQQPux20ioB7fZHt6yU1KJYBA\"}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":15,\"output_index\":1,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgGYcA_e7QTdfdHQwooR1kzLwbKe1CAkkjKvQot59_rFZd5DYBuDEHAfKU8OJQZS3gbbD368LNl77LijYNZuwy04S7RIKWoCWQtXbsWAujTS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c2FnuckauKfKF0CAt3YGJH20Wz8ATFEI3eWRT999gb1-B_pKjDVwRv3iZRZH7z5jBtP1jPgqn5OlVxulyJgnDENARtUDnxGbmW0a5cewfzphRs0t7JG-ElWAzYhKo2YvNRg2wqC7AlxvgdNLvh2q7GghztbU6vvARZKcS4r7ztGEGQWfuo2dxYhXYXqXV-opxwMFyGyxLi5EFpZBZY1NzE9IX6uYB6-gA\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":16,\"response\":{\"id\":\"gen_01M3XBJN11MEQASK921ZNG5475\",\"object\":\"response\",\"created_at\":1790912845,\"status\":\"completed\",\"completed_at\":1790912846,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgGcX7tW_asucU--QZAEe9qQpQX5yPno1V4f0rkJH59hro6mCkdY0Vb_37EjtL-ioCjHsvEK7KOutQ8-5E4eP3Zj61-Umr-aTud8HCvbfXTSh5q76XvZKAFUf8xprQDzl16jjwG5UuCgbpjBbU1DOZWlplHFX_HV0cBFlPzUmiLlMKvcGHjsmtPAyyjQZ-_ap3V7ii0F8XbLiN7Hmuj7QjvY4tJfUim1FAhhsCjZBgLI9SLNik2iLbE1ie1zM5jBDWiDk5mzyfTQKqtLsIEjBeCxmwIlkr3WdPx971qQEA1SXt_NOXZS4GGzaEgRSJBpjkWgbSYGX3ALBhue3nrvxrnZoX5l56kEivlaU0w0fMviG1hJTp-RMa0VzcTRt9yARoYmw_aJxiAoW3XzvaDvTAVvQRKddBDy_vCWD-dUG1wpfLthIA3TjiNWDXiAMBlb2NFz5VN9xVEY5MqwGLeqfDde7DxEwCpoRiRBKbtfCW2AtUHWQxb4PX1lftQn4ywaZiXu3RzgV1WsGjX1pizt0h7dCXPFUxLMgsNfWITU5ET_SOy73U3BQKPSeUUVNkkj1snM0E_sXv9VpdYN9ITblsmBvq-WwKViMBgW4PtjQc05pQaiwr1RdsaQzM7PXi6iX7oOu3GMDHp-kaHf7GC7T8m19wd0fgzyAi43mMN4wqXV2V3HQtf2_gRjnjTAS5ao7VKw9mRA1l2H22YXT0yccku4vPoFrVxT_IRP50S4Sf7IO_CaLMGtAezI1QxWn4MQkFhiY5ycv8_imMVq8gauRvHQPk8nRmZtKpFUpEkvGSSOZBrG_AdBtJ6YDxWcgfogmBNH6vMra2yJxui1G3K1qb2K-Itm9m4B5Obztse_aoOIZQhl18hcU0vu6IBMxHwBo9Fbc871K4vXZ6e8J_Kzx8NpKsEUI1-yxm6upGrU1sqT43CKlTUXWyDUj-YwTjVMrq3RrESY6yFUTBRfSChOyDG4tPfx3-aiDtnoXjItuKIshSYLy8A8GcpH_PAKGYgXiAbADNiU9cIBanNP0buguI1gGMK2V8aY5NVxCGIUmn78zktytGz8h_4kqX_YmELAOdfktLo899gt89SoVHaFqH0hEhDdoORHj_HtEY9JJlAoH_iK0rSKqGNAgTBv_4ggYLTorphcUJyHEW_PzvhC_ixo9P4YSVqwvVjdrySTKWt4eBP_0hh2SyGVjcql3upjJJpF2Lh7bZXDLOtOSmotb9dg72GIjWXhNYL9iYWLJMgRisuuJHfhuQwkvRpy6ILCa-es9pFQ9Q54DxW5jJO_GgjhW8FNaqX8FUE1sPU-cbaU7oyXjilVx1y9fL5C8AeoAubIVvUTtpB1f6CQY7LKILM5B0-U6UlwDa7r0ytjujc4FCEYA277dGQQPux20ioB7fZHt6yU1KJYBA\"},{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgGYcA_e7QTdfdHQwooR1kzLwbKe1CAkkjKvQot59_rFZd5DYBuDEHAfKU8OJQZS3gbbD368LNl77LijYNZuwy04S7RIKWoCWQtXbsWAujTSjiD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nuckauKfKF0CAt3YGJH20Wz8ATFEI3eWRT999gb1-B_pKjDVwRv3iZRZH7z5jBtP1jPgqn5OlVxulyJgnDENARtUDnxGbmW0a5cewfzphRs0t7JG-ElWAzYhKo2YvNRg2wqC7AlxvgdNLvh2q7GghztbU6vvARZKcS4r7ztGEGQWfuo2dxYhXYXqXV-opxwMFyGyxLi5EFpZBZY1NzE9IX6uYB6-gA\"},{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\",\"status\":\"completed\"}],\"usage\":{\"input_tokens\":566,\"output_tokens\":134,\"total_tokens\":700,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":66}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf294dcba53aa86c104693\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912844868,\"endTime\":1790912846640,\"providerRequestId\":\"72d785e4-c1f4-4f68-8042-8251dcbd9560\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf294dcba53aa86c104693\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0011527\",\"marketCost\":\"0.0011527\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0011527\",\"inferenceCost\":\"0.0011527\",\"inputInferenceCost\":\"0.0005832\",\"outputInferenceCost\":\"0.0005695\",\"generationId\":\"gen_01M3XBJN11MEQASK921ZNG5475\"}}}}\n\n" - } - }, - { - "transport": "http", - "request": { - "method": "POST", - "url": "https://ai-gateway.vercel.sh/v1/responses", - "headers": { - "content-type": "application/json" - }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab955e4771eb22eeb176b53e425\",\"summary\":[],\"encrypted_content\":\"Q-PaDgGcX7tW_asucU--QZAEe9qQpQX5yPno1V4f0rkJH59hro6mCkdY0Vb_37EjtL-ioCjHsvEK7KOutQ8-5E4eP3Zj61-Umr-aTud8HCvbfXTSh5q76XvZKAFUf8xprQDzl16jjwG5UuCgbpjBbU1DOZWlplHFX_HV0cBFlPzUmiLlMKvcGHjsmtPAyyjQZ-_ap3V7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ILCa-es9pFQ9Q54DxW5jJO_GgjhW8FNaqX8FUE1sPU-cbaU7oyXjilVx1y9fL5C8AeoAubIVvUTtpB1f6CQY7LKILM5B0-U6UlwDa7r0ytjujc4FCEYA277dGQQPux20ioB7fZHt6yU1KJYBA\"},{\"type\":\"reasoning\",\"id\":\"rs_6abf294dcba53aa86c104693:rs_01a0fab958b57080b66ca0b8fe1b4cf5\",\"summary\":[],\"encrypted_content\":\"Q-PaDgGYcA_e7QTdfdHQwooR1kzLwbKe1CAkkjKvQot59_rFZd5DYBuDEHAfKU8OJQZS3gbbD368LNl77LijYNZuwy04S7RIKWoCWQtXbsWAujTSjiDwT8nQPPz0soncm9tAH63msOMErMv7U-2xLTgjVUVKDqDArTnSYGsL63itD_UQ3Z_JlRJi-VOSz8Ntk6g3n_KT7PLajapcVu1KMvbVSOJW2cAwYZeZluwhPdDUnLo2oSNzAyf7en_67c5kVXo7D6JXicrXpl71T-OV8PELoi1eaYzfVzHtB6Suu5A6KhdMKJkzzN47bQB4Rcy0g3dxHKkzFd7lV1IMZU5PZSqfYgTgFtblp-OuzZQbBrHZB98VleILOagVV8tdy81YcjzF815es38BogLNO_L74TQYMIiI_-FSOIBjJ1PQhuf5NO9NnJtdyu0F3f5RCcw8de51z6nwlwcJnDb6kkOWF3bFZi2b0aSNm-5d5Q57kPzyQ1tdguASQM9jxEJBxrXXsPJmnwRwlKyw00lLV-MNRDALCPnUvjb87ONGCqw3urclqOxAWqy81RSbjS6msO13yFTVL7i_QXMO-Pq4XsAmw3Z2WkpNWDC8JcTfeaskEfJLmNNDhh_TVEoooMHT6-rUUexTavxK0EFdFcB_fG1AJ1GQbkOAjslGlOdyD7iXXHqqzFC7WheYRVryNeve2_FxZ2mKnbuRn9LKUx-zZe0dm6EhfU6tpirb90OKh94wTjgu9EMzWJ5rdV3HU30PbeJyjU0T9Z0yoSVNSAG4ZYxsGE-w056JHm32sDIz6OJmCNnKqDLGNoSCO10kKnVD8ntYKqto6sUhKMgKODRduHRWPNHrPAhuQgolx97NFVthLiARiZnuQ3ECzL5s-TaPSKKwC4Ro5OqcpjD_a2OprM97JicGCP2D9jQfcKuDxBI6DAVJ6kp-ED1LgFVOjjNJFK4G9FC-QcZguSIcXCAw64yD5d_h-bYQ1oS9F_dVOKeqeXSjMQxabeTRHg-ty6UjTDviHW3wCiiG1Vjmq2Rv7zHgQbTm8VoVcce7JQgE7no7oPB_tS0pb5z_koE-r49debu67sdVSB3cUNjy3KTxgexaYCPafM68MXsGiutRVEZRhcz9QMjdlB0Ac0qhzTlUyXJs2yZk1CoSS7Povt7dZXB93qJudB7LjkF5YUtBm6ztl6gHb2fr8c2FnuckauKfKF0CAt3YGJH20Wz8ATFEI3eWRT999gb1-B_pKjDVwRv3iZRZH7z5jBtP1jPgqn5OlVxulyJgnDENARtUDnxGbmW0a5cewfzphRs0t7JG-ElWAzYhKo2YvNRg2wqC7AlxvgdNLvh2q7GghztbU6vvARZKcS4r7ztGEGQWfuo2dxYhXYXqXV-opxwMFyGyxLi5EFpZBZY1NzE9IX6uYB6-gA\"},{\"type\":\"function_call\",\"id\":\"fc_1790912846309_p6yophdmrm9\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_01a0fab9595e7695ba59c678a7d87cb1\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" - }, - "response": { - "status": 200, - "headers": { - "content-type": "text/event-stream" - }, - "body": "event: response.created\ndata: {\"type\":\"response.created\",\"sequence_number\":0,\"response\":{\"id\":\"gen_01M3XBJPY6AH9184426JK693TH\",\"object\":\"response\",\"created_at\":1790912849,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.in_progress\ndata: {\"type\":\"response.in_progress\",\"sequence_number\":1,\"response\":{\"id\":\"gen_01M3XBJPY6AH9184426JK693TH\",\"object\":\"response\",\"created_at\":1790912849,\"status\":\"in_progress\",\"completed_at\":null,\"incomplete_details\":null,\"error\":null,\"output\":[],\"usage\":{\"input_tokens\":0,\"output_tokens\":0,\"total_tokens\":0,\"input_tokens_details\":{\"cached_tokens\":0},\"output_tokens_details\":{\"reasoning_tokens\":0}},\"model\":\"meta/muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":2,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"summary\":[]}}\n\nevent: response.reasoning_summary_part.added\ndata: {\"type\":\"response.reasoning_summary_part.added\",\"sequence_number\":3,\"item_id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.reasoning_summary_text.done\ndata: {\"type\":\"response.reasoning_summary_text.done\",\"sequence_number\":4,\"item_id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"output_index\":0,\"summary_index\":0,\"text\":\"\"}\n\nevent: response.reasoning_summary_part.done\ndata: {\"type\":\"response.reasoning_summary_part.done\",\"sequence_number\":5,\"item_id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"output_index\":0,\"summary_index\":0,\"part\":{\"type\":\"summary_text\",\"text\":\"\"}}\n\nevent: response.output_item.added\ndata: {\"type\":\"response.output_item.added\",\"sequence_number\":6,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912849753_bkjnm75ewti\",\"status\":\"in_progress\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.content_part.added\ndata: {\"type\":\"response.content_part.added\",\"sequence_number\":7,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_text.delta\ndata: {\"type\":\"response.output_text.delta\",\"sequence_number\":8,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"delta\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.output_text.done\ndata: {\"type\":\"response.output_text.done\",\"sequence_number\":9,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"text\":\"Paris is sunny.\",\"logprobs\":[]}\n\nevent: response.content_part.done\ndata: {\"type\":\"response.content_part.done\",\"sequence_number\":10,\"item_id\":\"msg_1790912849753_bkjnm75ewti\",\"output_index\":1,\"content_index\":0,\"part\":{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":11,\"output_index\":1,\"item\":{\"type\":\"message\",\"id\":\"msg_1790912849753_bkjnm75ewti\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}}\n\nevent: response.output_item.done\ndata: {\"type\":\"response.output_item.done\",\"sequence_number\":12,\"output_index\":0,\"item\":{\"type\":\"reasoning\",\"id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encr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WOdMTkLIfoC4904yES6LrLFYPBZ53fSzviyI_oXxKoRyNfEKztB6v5rWU4M9G3pWuyjrygE4x68dY9A5KK-aUSzGW0chq5yEapCDQ_tD7gchG81qGsktlnhJUuxkg6xQTwqMXtGF_4EWts-8FYYX3iv-gSK0Fxfg2UIYi4JdVV2ZwldKFplhYZoMxxgwcdm5eSUUl8xXhMxXwblSUXBIKX_KaWSukbKaIC82we8ZbRDJv_abWM7JDX7dyrUxyfQ9rFNUShfNfvCzYKCtMWvh6zCajNkKrX_zBuSn89tuwDxIV4yuBCi0J3iBdNjKRUrW9BcYtlx_gUxKc_RIbD7VwI3w1QUW5UeOMw\"}}\n\nevent: response.completed\ndata: {\"type\":\"response.completed\",\"sequence_number\":13,\"response\":{\"id\":\"gen_01M3XBJPY6AH9184426JK693TH\",\"object\":\"response\",\"created_at\":1790912849,\"status\":\"completed\",\"completed_at\":1790912849,\"incomplete_details\":null,\"error\":null,\"output\":[{\"type\":\"reasoning\",\"id\":\"rs_6abf29513ebbe56000854d69:rs_01a0fab9646e756799423ec7671db64d\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"\"}],\"encrypted_content\":\"Q-PaDgHk1ZD4EMnLsvripK8ayvpz_dR_DZA6bWDuWBFM9az_Nc_LAOSUjrxU7L2N44phRQ46P6kVUb-r6d8lYxPjSkBXtDk300_xeO6K21zvxZooBcwSIFogwroj3y1cK9VRPEHPV7i3yInDjoy1cSU6J4XpZ77RF-vWwCQfRaU8hxCXlzgsGwGlohzTj3ZgZRlGpMhZqAxNyHL0n1rjJwV3lRjWxjKZWvESqxlhsf5tYWczX8drHD-CHomtYS7mAzwq4q3At6aKNAjEc6rYHU8Ud0V4iVZ5ikBX0bCga4E5w_6Mr9d5OIB9LPN0_-9ZskX41LpwTKPdygfybOJuYmVOAZFHr2PEK-VNossJHUOWvyR5GMdp0U4pEwDlXngYEwrszzSiSYV8CYX06tvaSGKV4rm2gBkT_72HMY4mz6yleAG34YARFBIJzDMGWLMKt7LZDgLsqBc0oriHxViTKVARbccLHCtPQtr1VmYEyCdXbhbDAOKChpv4-wkHNKvd2kt6bzfvBysiGsv1QSYzJqX3ZCqb0nvix5wLp4cYaxYM_DhhWsdVsh1wIFocKo8Syxqj2UmoB2AB5Tm8VL6DD0zufUiMye7PopvHsqXaM8tZirTIg8IGfHR2YSOAIhjobuMG_Nrqq9JPCFgYP4w2aH7Bjy95soSPOgHC5QtjmgRdoFjnG1TisPnf6ewltJzNTBN9_AMVtKCMvmNRCzav9Qq_o3r4NDIDFdnIXtS7-7p2CIHvTX36ZJk5iGM7sr1iUx8GqPARpvXSgqr7uMxMYh9evW0wiSQgxnoKy_mS1C1PE4MtgJ11PIFOlIioF4zLAirOj5XX9_qCLQfLUu27-AecMpUu1guQW-aIIvmNErPs2-se-du86TPcEnnBvvMmHWP5GwbdU5DELy8BLUDKGdC421Dih34jlHM32PuDjbgqBevyS84mdgZLhU8_AD4KEJ_sb9EN1XSu-HlBeXz8CzPjYzBRRV7KxGQyFC8aTXRFCxzyArrMqTP3Y-2dQt2mMtr6MNHSgNMwEtSFAfqCCBxQDMFrG1-0bWlATCcU-tfN-p88WOdMTkLIfoC4904yES6LrLFYPBZ53fSzviyI_oXxKoRyNfEKztB6v5rWU4M9G3pWuyjrygE4x68dY9A5KK-aUSzGW0chq5yEapCDQ_tD7gchG81qGsktlnhJUuxkg6xQTwqMXtGF_4EWts-8FYYX3iv-gSK0Fxfg2UIYi4JdVV2ZwldKFplhYZoMxxgwcdm5eSUUl8xXhMxXwblSUXBIKX_KaWSukbKaIC82we8ZbRDJv_abWM7JDX7dyrUxyfQ9rFNUShfNfvCzYKCtMWvh6zCajNkKrX_zBuSn89tuwDxIV4yuBCi0J3iBdNjKRUrW9BcYtlx_gUxKc_RIbD7VwI3w1QUW5UeOMw\"},{\"type\":\"message\",\"id\":\"msg_1790912849753_bkjnm75ewti\",\"status\":\"completed\",\"role\":\"assistant\",\"content\":[{\"type\":\"output_text\",\"text\":\"Paris is sunny.\",\"annotations\":[],\"logprobs\":[]}]}],\"usage\":{\"input_tokens\":643,\"output_tokens\":73,\"total_tokens\":716,\"input_tokens_details\":{\"cached_tokens\":113},\"output_tokens_details\":{\"reasoning_tokens\":59}},\"model\":\"muse-spark-1.3\",\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"previous_response_id\":null,\"temperature\":1,\"top_p\":1,\"max_output_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"top_logprobs\":0,\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"tool_choice\":\"auto\",\"parallel_tool_calls\":true,\"max_tool_calls\":null,\"text\":{\"format\":{\"type\":\"text\"}},\"truncation\":\"disabled\",\"reasoning\":{\"effort\":\"low\"},\"store\":false,\"background\":false,\"service_tier\":\"auto\",\"metadata\":{},\"safety_identifier\":null,\"prompt_cache_key\":null,\"prompt_cache_retention\":null,\"provider_metadata\":{\"openai\":{\"responseId\":\"resp_6abf29513ebbe56000854d69\",\"serviceTier\":\"auto\"},\"gateway\":{\"routing\":{\"originalModelId\":\"meta/muse-spark-1.3\",\"resolvedProvider\":\"meta\",\"fallbacksAvailable\":[],\"planningReasoning\":\"System credentials planned for: meta. Total execution order: meta(system)\",\"canonicalSlug\":\"meta/muse-spark-1.3\",\"finalProvider\":\"meta\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"meta/muse-spark-1.3\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"meta\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912846900,\"endTime\":1790912849843,\"providerRequestId\":\"152dd919-7a88-4322-aa33-bbcd1900ce24\",\"statusCode\":200,\"providerResponseId\":\"resp_6abf29513ebbe56000854d69\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0009897\",\"marketCost\":\"0.0009897\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0009897\",\"inferenceCost\":\"0.0009897\",\"inputInferenceCost\":\"0.00067945\",\"outputInferenceCost\":\"0.00031025\",\"generationId\":\"gen_01M3XBJPY6AH9184426JK693TH\"}}}}\n\n" - } - } - ] -} diff --git a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts index f0476206577f..87bf5263d08b 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts @@ -33,9 +33,15 @@ for (const item of [ reasoning: false, }, { - name: "responses Muse", + name: "chat Muse", model: gateway.model("meta/muse-spark-1.3"), options: { reasoningEffort: "low" }, + reasoning: false, + }, + { + name: "messages DeepSeek", + model: gateway.model("deepseek/deepseek-v4.1-flash"), + options: { reasoningEffort: "high" }, reasoning: true, }, { diff --git a/packages/ai/test/provider/vercel-ai-gateway.test.ts b/packages/ai/test/provider/vercel-ai-gateway.test.ts index ff960e49f2d7..3c53b50b54ea 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.test.ts @@ -13,13 +13,14 @@ it.effect("Gateway defaults preserve full model IDs and select the requested fam const gateway = VercelAIGateway.configure({ apiKey: "fixture" }) for (const [id, path] of [ ["openai/gpt-6.1", "/responses"], - ["meta/muse-spark-1.3", "/responses"], + ["meta/muse-spark-1.3", "/chat/completions"], ["spacexai/grok-4.7", "/responses"], ["meta/llama-4", "/messages"], ["openai/gpt-oss-120b", "/responses"], ["anthropic/claude-sonnet-5.5", "/messages"], ["google/gemini-3.8-flash", "/messages"], ["moonshotai/kimi-k3", "/messages"], + ["deepseek/deepseek-v4.1-flash", "/messages"], ]) { const model = gateway.model(id) expect(model.id).toBe(id) From 349335f08cc8b2e510f42e2a8c2439e1619fa19a Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Sun, 4 Oct 2026 22:12:46 -0500 Subject: [PATCH 08/19] refactor(ai): untrace Gateway protocol wrapper and skip redundant work --- .../ai/src/protocols/utils/gateway-protocol.ts | 14 +++++++------- packages/ai/src/providers/vercel-ai-gateway.ts | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index b681d6e3d120..b0beba8c5e5b 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -25,14 +25,13 @@ export function gatewayProtocol( }, ) { const decodeEvent = Schema.decodeUnknownEffect(protocol.stream.event) - const validateBody = ProviderShared.validateWith(Schema.decodeUnknownEffect(protocol.body.schema)) const initial = (request: LLMRequest) => ({ inner: protocol.stream.initial(request), gateway: undefined as Record | undefined, }) const onHalt = protocol.stream.onHalt const withGateway = (events: ReadonlyArray, gateway: Record | undefined) => - gateway === undefined + gateway === undefined || !events.some(LLMEvent.is.finish) ? events : events.map((event) => LLMEvent.is.finish(event) ? { ...event, providerMetadata: { ...event.providerMetadata, gateway } } : event, @@ -42,23 +41,24 @@ export function gatewayProtocol( id: input.id, body: { schema: Schema.Record(Schema.String, Schema.Unknown), - from: Effect.fn("GatewayProtocol.body")(function* (request: LLMRequest) { + from: Effect.fnUntraced(function* (request: LLMRequest) { const prepared = yield* input.prepare(request) - const body = yield* protocol.body.from(prepared.request).pipe(Effect.flatMap(validateBody)) + const body = yield* protocol.body.from(prepared.request) return { ...body, ...prepared.body } }), }, + supportsEffortUpdates: protocol.supportsEffortUpdates, sanitizer: protocol.sanitizer, stream: { event: Schema.String, initial, - step: Effect.fn("GatewayProtocol.step")(function* (state: ReturnType, frame: string) { + step: Effect.fnUntraced(function* (state: ReturnType, frame: string) { const event = yield* decodeEvent(frame).pipe( Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", frame, cause)), ) - const metadata = decodeMetadata(frame) + const metadata = frame.includes("provider_metadata") ? decodeMetadata(frame) : undefined const gateway = - metadata._tag === "None" + metadata === undefined || metadata._tag === "None" ? state.gateway : mergeJsonRecords( state.gateway, diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 1d4c009ebf92..2f83a2975050 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -19,6 +19,7 @@ import { AuthOptions, type ProviderAuthOption } from "../route/auth-options.js" import { Route, type RouteDefaultsInput } from "../route/client.js" import { Endpoint } from "../route/endpoint.js" import { Framing } from "../route/framing.js" +import type { Protocol } from "../route/protocol.js" import { AIError, HttpContext, @@ -63,7 +64,7 @@ const ChatThinking = Schema.Union([ const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) const prepare = (api: "messages" | "responses" | "chat") => - Effect.fn("VercelAIGateway.prepare")(function* (request: LLMRequest) { + Effect.fnUntraced(function* (request: LLMRequest) { const options = yield* decodeOptions(request.providerOptions ?? {}) const thinking = api === "chat" && request.providerOptions?.thinking !== undefined @@ -79,7 +80,7 @@ const prepare = (api: "messages" | "responses" | "chat") => } : request.providerOptions return { - request: LLMRequest.update(request, { providerOptions }), + request: providerOptions === request.providerOptions ? request : LLMRequest.update(request, { providerOptions }), body: { ...(thinking === undefined ? {} @@ -103,10 +104,10 @@ const prepare = (api: "messages" | "responses" | "chat") => const route = (input: { readonly id: string - readonly protocol: Parameters>[0] + readonly protocol: Protocol readonly api: "messages" | "responses" | "chat" readonly path: string - readonly framing: typeof Framing.sse | typeof AnthropicMessages.framing | typeof OpenAIChat.framing + readonly framing: Framing.Definition readonly defaults?: RouteDefaultsInput }) => Route.make({ @@ -291,7 +292,13 @@ export const chatModel: ProviderPackage.Definition Date: Sun, 4 Oct 2026 22:24:32 -0500 Subject: [PATCH 09/19] refactor(ai): clean up Gateway protocol state and request preparation --- .../src/protocols/utils/gateway-protocol.ts | 70 ++++++++++++------- .../providers/vercel-ai-gateway-options.ts | 1 + .../ai/src/providers/vercel-ai-gateway.ts | 62 +++++++++------- 3 files changed, 80 insertions(+), 53 deletions(-) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index b0beba8c5e5b..7b107a320d4b 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -3,17 +3,49 @@ import { Protocol } from "../../route/protocol.js" import { LLMEvent, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" import { ProviderShared } from "../shared.js" -const ProviderMetadata = Schema.Struct({ +// Gateway attaches billing and routing metadata to raw SSE frames under snake_case `provider_metadata.gateway` +// (`message_delta` on Messages, `response.completed` on Responses, and `choices[].delta` on Chat). +const WireMetadataField = Schema.Struct({ provider_metadata: Schema.optional( Schema.Struct({ gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) }), ), }) -const Metadata = Schema.Struct({ - ...ProviderMetadata.fields, - response: Schema.optional(ProviderMetadata), - choices: Schema.optional(Schema.Array(Schema.Struct({ delta: Schema.optional(ProviderMetadata) }))), +const WireFrameMetadata = Schema.Struct({ + ...WireMetadataField.fields, + response: Schema.optional(WireMetadataField), + choices: Schema.optional(Schema.Array(Schema.Struct({ delta: Schema.optional(WireMetadataField) }))), }) -const decodeMetadata = Schema.decodeUnknownOption(Schema.fromJsonString(Metadata)) +const decodeWireMetadata = Schema.decodeUnknownOption(Schema.fromJsonString(WireFrameMetadata)) + +interface ParserState { + readonly inner: Inner + readonly gateway?: Record +} + +function readGatewayMetadata( + current: Record | undefined, + frame: string, +): Record | undefined { + if (!frame.includes("provider_metadata")) return current + const decoded = decodeWireMetadata(frame) + if (decoded._tag === "None") return current + return mergeJsonRecords( + current, + decoded.value.provider_metadata?.gateway, + decoded.value.response?.provider_metadata?.gateway, + ...(decoded.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), + ) +} + +function attachGatewayMetadata( + events: ReadonlyArray, + gateway: Record | undefined, +): ReadonlyArray { + if (!gateway || !events.some(LLMEvent.is.finish)) return events + return events.map((event) => + LLMEvent.is.finish(event) ? { ...event, providerMetadata: { ...event.providerMetadata, gateway } } : event, + ) +} export function gatewayProtocol( protocol: Protocol, @@ -25,17 +57,10 @@ export function gatewayProtocol( }, ) { const decodeEvent = Schema.decodeUnknownEffect(protocol.stream.event) - const initial = (request: LLMRequest) => ({ + const initial = (request: LLMRequest): ParserState => ({ inner: protocol.stream.initial(request), - gateway: undefined as Record | undefined, }) const onHalt = protocol.stream.onHalt - const withGateway = (events: ReadonlyArray, gateway: Record | undefined) => - gateway === undefined || !events.some(LLMEvent.is.finish) - ? events - : events.map((event) => - LLMEvent.is.finish(event) ? { ...event, providerMetadata: { ...event.providerMetadata, gateway } } : event, - ) return Protocol.make({ id: input.id, @@ -52,25 +77,16 @@ export function gatewayProtocol( stream: { event: Schema.String, initial, - step: Effect.fnUntraced(function* (state: ReturnType, frame: string) { + step: Effect.fnUntraced(function* (state: ParserState, frame: string) { const event = yield* decodeEvent(frame).pipe( Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", frame, cause)), ) - const metadata = frame.includes("provider_metadata") ? decodeMetadata(frame) : undefined - const gateway = - metadata === undefined || metadata._tag === "None" - ? state.gateway - : mergeJsonRecords( - state.gateway, - metadata.value.provider_metadata?.gateway, - metadata.value.response?.provider_metadata?.gateway, - ...(metadata.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), - ) + const gateway = readGatewayMetadata(state.gateway, frame) const [inner, events] = yield* protocol.stream.step(state.inner, event) - return [{ inner, gateway }, withGateway(events, gateway)] as const + return [{ inner, gateway }, attachGatewayMetadata(events, gateway)] as const }), onHalt: onHalt - ? (state) => onHalt(state.inner).pipe(Effect.map((events) => withGateway(events, state.gateway))) + ? (state) => onHalt(state.inner).pipe(Effect.map((events) => attachGatewayMetadata(events, state.gateway))) : undefined, }, }) diff --git a/packages/ai/src/providers/vercel-ai-gateway-options.ts b/packages/ai/src/providers/vercel-ai-gateway-options.ts index fe56400496de..35f7e843de87 100644 --- a/packages/ai/src/providers/vercel-ai-gateway-options.ts +++ b/packages/ai/src/providers/vercel-ai-gateway-options.ts @@ -25,6 +25,7 @@ export const Options = Schema.Struct({ cacheTTL: Schema.optional(Schema.String), cacheAnchorItems: Schema.optional(Schema.Number), }) +export type Options = typeof Options.Type export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & AnthropicMessages.OptionsInput & { diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 2f83a2975050..9f755d6fa2c0 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -61,8 +61,38 @@ const ChatThinking = Schema.Union([ Schema.Struct({ type: Schema.Literals(["adaptive", "disabled"]) }), Schema.Struct({ type: Schema.Literal("enabled"), budgetTokens: Schema.Number }), ]) +type ChatThinking = typeof ChatThinking.Type const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) +function messagesRequest(request: LLMRequest, effort: VercelAIGatewayOptions.Options["reasoningEffort"]) { + if (effort === undefined) return request + const enabled = effort !== "none" + const thinking = request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" } + return LLMRequest.update(request, { + providerOptions: { + ...request.providerOptions, + effort: enabled ? effort : undefined, + thinking, + }, + }) +} + +function chatReasoning(thinking: ChatThinking | undefined) { + if (!thinking) return undefined + return { + enabled: thinking.type !== "disabled", + max_tokens: thinking.type === "enabled" ? thinking.budgetTokens : undefined, + } +} + +function gatewayProviderOptions(request: LLMRequest, options: VercelAIGatewayOptions.Options) { + const defaultGateway = request.cache === "none" ? undefined : { caching: "auto" as const } + return { + ...options.upstream, + gateway: { ...defaultGateway, ...options.gateway }, + } +} + const prepare = (api: "messages" | "responses" | "chat") => Effect.fnUntraced(function* (request: LLMRequest) { const options = yield* decodeOptions(request.providerOptions ?? {}) @@ -70,34 +100,14 @@ const prepare = (api: "messages" | "responses" | "chat") => api === "chat" && request.providerOptions?.thinking !== undefined ? yield* decodeChatThinking(request.providerOptions.thinking) : undefined - const effort = options.reasoningEffort - const providerOptions = - api === "messages" && effort !== undefined - ? { - ...request.providerOptions, - effort: effort === "none" ? undefined : effort, - thinking: request.providerOptions?.thinking ?? { type: effort === "none" ? "disabled" : "adaptive" }, - } - : request.providerOptions + const reasoning = chatReasoning(thinking) return { - request: providerOptions === request.providerOptions ? request : LLMRequest.update(request, { providerOptions }), + request: api === "messages" ? messagesRequest(request, options.reasoningEffort) : request, body: { - ...(thinking === undefined - ? {} - : { - reasoning: { - enabled: thinking.type !== "disabled", - ...(thinking.type === "enabled" ? { max_tokens: thinking.budgetTokens } : {}), - }, - }), - providerOptions: { - ...options.upstream, - gateway: { ...(request.cache === "none" ? {} : { caching: "auto" }), ...options.gateway }, - }, - ...(api === "responses" && options.cacheTTL !== undefined ? { cache_ttl: options.cacheTTL } : {}), - ...(api === "responses" && options.cacheAnchorItems !== undefined - ? { cache_anchor_items: options.cacheAnchorItems } - : {}), + ...(reasoning ? { reasoning } : {}), + providerOptions: gatewayProviderOptions(request, options), + cache_ttl: api === "responses" ? options.cacheTTL : undefined, + cache_anchor_items: api === "responses" ? options.cacheAnchorItems : undefined, }, } }) From d9896733c57fdbac241588bf33976781a94ab184 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Sun, 4 Oct 2026 23:06:22 -0500 Subject: [PATCH 10/19] refactor(ai): inline Gateway options and simplify per-API preparation --- .../providers/vercel-ai-gateway-options.ts | 41 --------- .../ai/src/providers/vercel-ai-gateway.ts | 87 ++++++++++++++----- .../vercel-ai-gateway.recorded.test.ts | 11 +-- .../test/provider/vercel-ai-gateway.test.ts | 11 +-- 4 files changed, 73 insertions(+), 77 deletions(-) delete mode 100644 packages/ai/src/providers/vercel-ai-gateway-options.ts diff --git a/packages/ai/src/providers/vercel-ai-gateway-options.ts b/packages/ai/src/providers/vercel-ai-gateway-options.ts deleted file mode 100644 index 35f7e843de87..000000000000 --- a/packages/ai/src/providers/vercel-ai-gateway-options.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Schema } from "effect" -import type { AnthropicMessages } from "../protocols/anthropic-messages.js" -import { ReasoningEffort } from "../schema/index.js" -import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js" - -export interface GatewayOptions { - readonly [key: string]: unknown - readonly caching?: "auto" - readonly only?: ReadonlyArray - readonly order?: ReadonlyArray - readonly sort?: string - readonly models?: ReadonlyArray - readonly zeroDataRetention?: boolean - readonly user?: string - readonly tags?: ReadonlyArray - readonly byok?: Readonly>>>> - readonly inferenceRegion?: string - readonly providerTimeouts?: { readonly byok?: Readonly> } -} - -export const Options = Schema.Struct({ - gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), - upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), - reasoningEffort: Schema.optional(ReasoningEffort), - cacheTTL: Schema.optional(Schema.String), - cacheAnchorItems: Schema.optional(Schema.Number), -}) -export type Options = typeof Options.Type - -export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & - AnthropicMessages.OptionsInput & { - readonly gateway?: GatewayOptions - /** Upstream options forwarded under their Gateway provider namespace. */ - readonly upstream?: Readonly>>> - /** Responses automatic-cache lifetime. */ - readonly cacheTTL?: "5m" | "1h" | (string & {}) - /** Number of stable Responses input items. */ - readonly cacheAnchorItems?: number - } - -export * as VercelAIGatewayOptions from "./vercel-ai-gateway-options.js" diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 9f755d6fa2c0..c01a631a08cf 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -30,15 +30,40 @@ import { ModelID, ProviderID, ProviderMetadata, + ReasoningEffort, Usage, } from "../schema/index.js" -import { VercelAIGatewayOptions, type ProviderOptionsInput } from "./vercel-ai-gateway-options.js" - -export type { GatewayOptions, ProviderOptionsInput } from "./vercel-ai-gateway-options.js" +import type { OpenResponsesProviderOptionsInput } from "./open-responses-options.js" export const id = ProviderID.make("vercel-ai-gateway") const baseURL = "https://ai-gateway.vercel.sh/v1" +export interface GatewayOptions { + readonly [key: string]: unknown + readonly caching?: "auto" + readonly only?: ReadonlyArray + readonly order?: ReadonlyArray + readonly sort?: string + readonly models?: ReadonlyArray + readonly zeroDataRetention?: boolean + readonly user?: string + readonly tags?: ReadonlyArray + readonly byok?: Readonly>>>> + readonly inferenceRegion?: string + readonly providerTimeouts?: { readonly byok?: Readonly> } +} + +export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & + AnthropicMessages.OptionsInput & { + readonly gateway?: GatewayOptions + /** Upstream options forwarded under their Gateway provider namespace. */ + readonly upstream?: Readonly>>> + /** Responses automatic-cache lifetime. */ + readonly cacheTTL?: "5m" | "1h" | (string & {}) + /** Number of stable Responses input items. */ + readonly cacheAnchorItems?: number + } + export interface EvaluationOptions { readonly [key: string]: unknown readonly gateway?: Readonly<{ @@ -56,7 +81,15 @@ export type Options = Omit & export type Settings = ProviderPackage.Settings & ProviderOptionsInput & { readonly apiKey?: string } -const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(VercelAIGatewayOptions.Options)) +const GatewayOptionsSchema = Schema.Struct({ + gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), + upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), + reasoningEffort: Schema.optional(ReasoningEffort), + cacheTTL: Schema.optional(Schema.String), + cacheAnchorItems: Schema.optional(Schema.Number), +}) +const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(GatewayOptionsSchema)) + const ChatThinking = Schema.Union([ Schema.Struct({ type: Schema.Literals(["adaptive", "disabled"]) }), Schema.Struct({ type: Schema.Literal("enabled"), budgetTokens: Schema.Number }), @@ -64,7 +97,7 @@ const ChatThinking = Schema.Union([ type ChatThinking = typeof ChatThinking.Type const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) -function messagesRequest(request: LLMRequest, effort: VercelAIGatewayOptions.Options["reasoningEffort"]) { +function messagesRequest(request: LLMRequest, effort: ReasoningEffort | undefined) { if (effort === undefined) return request const enabled = effort !== "none" const thinking = request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" } @@ -85,29 +118,39 @@ function chatReasoning(thinking: ChatThinking | undefined) { } } -function gatewayProviderOptions(request: LLMRequest, options: VercelAIGatewayOptions.Options) { - const defaultGateway = request.cache === "none" ? undefined : { caching: "auto" as const } - return { - ...options.upstream, - gateway: { ...defaultGateway, ...options.gateway }, - } -} - const prepare = (api: "messages" | "responses" | "chat") => Effect.fnUntraced(function* (request: LLMRequest) { const options = yield* decodeOptions(request.providerOptions ?? {}) + const defaultGateway = request.cache === "none" ? undefined : { caching: "auto" as const } + const providerOptions = { + ...options.upstream, + gateway: { ...defaultGateway, ...options.gateway }, + } + if (api === "messages") { + return { + request: messagesRequest(request, options.reasoningEffort), + body: { providerOptions }, + } + } + if (api === "responses") { + return { + request, + body: { + providerOptions, + cache_ttl: options.cacheTTL, + cache_anchor_items: options.cacheAnchorItems, + }, + } + } const thinking = - api === "chat" && request.providerOptions?.thinking !== undefined - ? yield* decodeChatThinking(request.providerOptions.thinking) - : undefined - const reasoning = chatReasoning(thinking) + request.providerOptions?.thinking === undefined + ? undefined + : yield* decodeChatThinking(request.providerOptions.thinking) return { - request: api === "messages" ? messagesRequest(request, options.reasoningEffort) : request, + request, body: { - ...(reasoning ? { reasoning } : {}), - providerOptions: gatewayProviderOptions(request, options), - cache_ttl: api === "responses" ? options.cacheTTL : undefined, - cache_anchor_items: api === "responses" ? options.cacheAnchorItems : undefined, + providerOptions, + reasoning: chatReasoning(thinking), }, } }) diff --git a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts index 87bf5263d08b..9c4756ec7cc9 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.recorded.test.ts @@ -86,18 +86,15 @@ recorded.effect( "rejects invalid credentials without retryable classification", () => Effect.gen(function* () { - const result = yield* LLMClient.generate( + const error = yield* LLMClient.generate( LLM.request({ model: VercelAIGateway.configure({ apiKey: "invalid-gateway-key" }).messages("anthropic/claude-sonnet-5.5"), prompt: "Hello", generation: { maxTokens: 32 }, }), - ).pipe(Effect.result) - expect(result._tag).toBe("Failure") - if (result._tag === "Failure") { - expect(result.failure.reason.http?.status).toBe(401) - expect(isRetryable(result.failure)).toBe(false) - } + ).pipe(Effect.flip) + expect(error.reason.http?.status).toBe(401) + expect(isRetryable(error)).toBe(false) }), 30_000, ) diff --git a/packages/ai/test/provider/vercel-ai-gateway.test.ts b/packages/ai/test/provider/vercel-ai-gateway.test.ts index 3c53b50b54ea..21ae9371a724 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.test.ts @@ -221,13 +221,12 @@ it.effect("Gateway Responses replays encrypted reasoning alongside tool calls", it.effect("Gateway 401 and 403 failures are terminal and retain HTTP context", () => Effect.gen(function* () { for (const status of [401, 403]) { - const result = yield* LLMClient.generate( + const error = yield* LLMClient.generate( LLM.request({ model: VercelAIGateway.configure({ apiKey: "fixture" }).chat("openai/gpt-6-luna"), prompt: "Hello", }), ).pipe( - Effect.result, Effect.provide( dynamicResponse((input) => Effect.succeed( @@ -238,12 +237,10 @@ it.effect("Gateway 401 and 403 failures are terminal and retain HTTP context", ( ), ), ), + Effect.flip, ) - expect(result._tag).toBe("Failure") - if (result._tag === "Failure") { - expect(result.failure.reason.http?.status).toBe(status) - expect(isRetryable(result.failure)).toBe(false) - } + expect(error.reason.http?.status).toBe(status) + expect(isRetryable(error)).toBe(false) } }), ) From 109c2bf05b276ad4681b39894095072fa620387c Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 00:07:49 -0500 Subject: [PATCH 11/19] feat(ai): use inline cache policy for Gateway Messages and trim README --- packages/ai/README.md | 43 ------------------- packages/ai/src/cache-policy.ts | 21 +++++---- .../ai/src/providers/vercel-ai-gateway.ts | 14 +++--- ...-caches-distinct-claude-system-blocks.json | 10 ++--- ...inues-chat-claude-reasoning-and-tools.json | 4 +- ...ntinues-chat-muse-reasoning-and-tools.json | 4 +- ...s-messages-claude-reasoning-and-tools.json | 10 ++--- ...messages-deepseek-reasoning-and-tools.json | 4 +- ...s-messages-gemini-reasoning-and-tools.json | 4 +- ...ues-responses-gpt-reasoning-and-tools.json | 4 +- ...es-responses-grok-reasoning-and-tools.json | 4 +- ...ials-without-retryable-classification.json | 2 +- .../test/provider/vercel-ai-gateway.test.ts | 31 ++++++++++++- 13 files changed, 73 insertions(+), 82 deletions(-) diff --git a/packages/ai/README.md b/packages/ai/README.md index 17d3a96a029e..7ff40c3dff78 100644 --- a/packages/ai/README.md +++ b/packages/ai/README.md @@ -1285,49 +1285,6 @@ const gateway = CloudflareAIGateway.configure({ Included LLM providers: OpenAI, Anthropic, Google (Gemini), Google Vertex, Amazon Bedrock, Azure OpenAI, Baseten, Cerebras, Cohere, Cloudflare AI Gateway, Cloudflare Workers AI, DeepInfra, DeepSeek, Fireworks, Groq, Mistral, OpenRouter, TogetherAI, Vercel AI Gateway, and xAI. Z.ai currently exposes image generation. Generic Chat Completions, Responses, and Anthropic Messages-compatible entrypoints support custom endpoints. -### Vercel AI Gateway - -Gateway supports Messages, Responses, and Chat directly, without the AI SDK transport: - -```ts -import { VercelAIGateway } from "@opencode/ai/providers" - -const gateway = VercelAIGateway.configure({ - // Optional: otherwise reads AI_GATEWAY_API_KEY, then VERCEL_OIDC_TOKEN. - apiKey, - providerOptions: { - gateway: { only: ["anthropic", "bedrock"], caching: "auto" }, - }, -}) - -gateway.model("anthropic/claude-sonnet-5.5") // Messages -gateway.model("openai/gpt-6-luna") // Responses -gateway.model("meta/muse-spark-1.3") // Chat -gateway.model("spacexai/grok-4.7") // Responses -gateway.chat("anthropic/claude-sonnet-5.5") // Explicit Chat override -gateway.responses("google/gemini-3.8-flash") // Explicit Responses override -gateway.messages("openai/gpt-6-luna") // Explicit Messages override -``` - -Default routing picks the API whose Gateway translation carries each family's reasoning across turns: `openai/gpt-*` and `spacexai/grok-*` use Responses, `meta/muse-*` uses Chat, and everything else uses Messages. Full Gateway model IDs stay unchanged. Package entrypoints are also available at `@opencode/ai/providers/vercel-ai-gateway/{messages,responses,chat}` with flat `model(id, settings)` inputs. - -Set `providerOptions.reasoningEffort` for named effort. Messages lowers it to `thinking` plus `output_config.effort`, Responses to `reasoning.effort`, and Chat to `reasoning_effort`. - -```ts -LLM.request({ - model: gateway.messages("anthropic/claude-sonnet-5.5"), - prompt: "Review this algorithm.", - generation: { maxTokens: 4096 }, - providerOptions: { thinking: { type: "enabled", budgetTokens: 2048 } }, -}) -``` - -Messages and Chat accept `thinking` for on/off or token-budget controls. Native upstream settings go under `upstream`, for example `upstream: { google: { thinkingConfig: ... } }`. - -Gateway controls go under `providerOptions.gateway`. Gateway caching is enabled unless the request uses `cache: "none"`. Responses also accepts `cacheTTL` and `cacheAnchorItems`. `promptCacheKey` is sent as `x-session-affinity`. - -Gateway metadata from `provider_metadata.gateway` is retained on the finish event's `providerMetadata.gateway`. Existing experimental evaluation remains available. - Each named provider owns its module, endpoint, authentication, and route setup. Providers with the same wire format compose the shared protocol directly: ```ts diff --git a/packages/ai/src/cache-policy.ts b/packages/ai/src/cache-policy.ts index dc2340559cad..8ddde6206933 100644 --- a/packages/ai/src/cache-policy.ts +++ b/packages/ai/src/cache-policy.ts @@ -48,21 +48,22 @@ const RESPECTS_INLINE_HINTS = new Set([ "meta-messages", "minimax-messages", "moonshot-messages", + "vercel-ai-gateway-messages", "zai-coding-messages", "bedrock-converse", "openrouter", "digitalocean", ]) -// OpenRouter upstreams other than Anthropic and Alibaba Qwen cache without breakpoints. Gemini uses only the last -// breakpoint, so a conversation-tail breakpoint writes a new cache every step and costs more than none. Qwen ignores -// breakpoints on tool definitions and caches tools with the system prompt. +// OpenRouter and Vercel AI Gateway upstreams other than Anthropic and Alibaba Qwen cache without breakpoints. +// Gemini uses only the last breakpoint, so a conversation-tail breakpoint writes a new cache every step and costs +// more than none. Qwen ignores breakpoints on tool definitions and caches tools with the system prompt. const QWEN: CachePolicyObject = { system: true, messages: { tail: 1 } } -const openRouterPolicy = (modelID: string): CachePolicyObject => { +const gatewayPolicy = (modelID: string): CachePolicyObject => { // `~anthropic/claude-sonnet-latest` style IDs are OpenRouter aliases for the latest model in a family. const id = modelID.replace(/^~/, "") if (id.startsWith("anthropic/")) return AUTO - if (id.startsWith("qwen/")) return QWEN + if (id.startsWith("qwen/") || id.startsWith("alibaba/qwen")) return QWEN return NONE } @@ -170,11 +171,13 @@ const countHints = (request: LLMRequest) => ) export const applyCachePolicy = (request: LLMRequest): LLMRequest => { - if (!RESPECTS_INLINE_HINTS.has(request.model.route.id)) return request + const route = request.model.route.id + if (!RESPECTS_INLINE_HINTS.has(route)) return request const policy = - request.model.route.id === "openrouter" && (request.cache === undefined || request.cache === "auto") - ? openRouterPolicy(request.model.id) - : request.model.route.id === "alibaba-chat" && (request.cache === undefined || request.cache === "auto") + (route === "openrouter" || route === "vercel-ai-gateway-messages") && + (request.cache === undefined || request.cache === "auto") + ? gatewayPolicy(request.model.id) + : route === "alibaba-chat" && (request.cache === undefined || request.cache === "auto") ? request.model.id.toLowerCase().startsWith("qwen") ? QWEN : NONE diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index c01a631a08cf..61e6fefd62e7 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -118,14 +118,18 @@ function chatReasoning(thinking: ChatThinking | undefined) { } } +function gatewayProviderOptions(options: typeof GatewayOptionsSchema.Type) { + if (options.upstream === undefined && options.gateway === undefined) return undefined + return { + ...options.upstream, + ...(options.gateway ? { gateway: options.gateway } : {}), + } +} + const prepare = (api: "messages" | "responses" | "chat") => Effect.fnUntraced(function* (request: LLMRequest) { const options = yield* decodeOptions(request.providerOptions ?? {}) - const defaultGateway = request.cache === "none" ? undefined : { caching: "auto" as const } - const providerOptions = { - ...options.upstream, - gateway: { ...defaultGateway, ...options.gateway }, - } + const providerOptions = gatewayProviderOptions(options) if (api === "messages") { return { request: messagesRequest(request, options.reasoningEffort), diff --git a/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json b/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json index 57eef89c16ad..6ed6f55990f9 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/automatically-caches-distinct-claude-system-blocks.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/automatically-caches-distinct-claude-system-blocks", - "recordedAt": "2026-10-02T03:35:45.000Z" + "recordedAt": "2026-10-05T05:01:46.082Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"type\":\"text\",\"text\":\"Reply with OK only.\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"only\":[\"anthropic\"]}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAX5N6B8Q6P0R5ZEDHMNST\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"output_tokens\":4,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912141016,\"endTime\":1790912142628,\"providerRequestId\":\"req_011Cfci8yumRY5gGtVjwuLa5\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci8zFrdMhFnCAUvii3G\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"no_pin\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0017014\",\"marketCost\":\"0.0017014\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0017014\",\"inferenceCost\":\"0.0017014\",\"inputInferenceCost\":\"0.0016614\",\"outputInferenceCost\":\"0.00004\",\"generationId\":\"gen_01M3XAX5N6B8Q6P0R5ZEDHMNST\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M4570W9EPZN6C4RCWA9BS27G\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"output_tokens\":4,\"cache_creation_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":8267,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":8267,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":8267,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":8267,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791176503639,\"endTime\":1791176504703,\"providerRequestId\":\"req_011CfiW8HmuUPgY1T2zujPjJ\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfiW8J7FTDATHvjsDxLMz\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"no_pin\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0207155\",\"marketCost\":\"0.0207155\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0207155\",\"inferenceCost\":\"0.0207155\",\"inputInferenceCost\":\"0.0206755\",\"outputInferenceCost\":\"0.00004\",\"generationId\":\"gen_01M4570W9EPZN6C4RCWA9BS27G\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\"},{\"type\":\"text\",\"text\":\"Reply with OK only.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\"}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"caching\":\"auto\",\"only\":[\"anthropic\"]}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Rule 0: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 1: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 2: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 3: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 4: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 5: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 6: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 7: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 8: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 9: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 10: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 11: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 12: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 13: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 14: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 15: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 16: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 17: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 18: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 19: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 20: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 21: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 22: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 23: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 24: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 25: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 26: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 27: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 28: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 29: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 30: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 31: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 32: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 33: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 34: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 35: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 36: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 37: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 38: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 39: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 40: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 41: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 42: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 43: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 44: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 45: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 46: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 47: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 48: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 49: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 50: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 51: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 52: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 53: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 54: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 55: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 56: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 57: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 58: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 59: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 60: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 61: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 62: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 63: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 64: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 65: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 66: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 67: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 68: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 69: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 70: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 71: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 72: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 73: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 74: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 75: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 76: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 77: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 78: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 79: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 80: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 81: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 82: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 83: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 84: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 85: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 86: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 87: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 88: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 89: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 90: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 91: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 92: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 93: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 94: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 95: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 96: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 97: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 98: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 99: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 100: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 101: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 102: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 103: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 104: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 105: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 106: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 107: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 108: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 109: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 110: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 111: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 112: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 113: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 114: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 115: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 116: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 117: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 118: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 119: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 120: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 121: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 122: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 123: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 124: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 125: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 126: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 127: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 128: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 129: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 130: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 131: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 132: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 133: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 134: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 135: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 136: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 137: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 138: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 139: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 140: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 141: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 142: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 143: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 144: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 145: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 146: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 147: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 148: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 149: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 150: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 151: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 152: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 153: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 154: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 155: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 156: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 157: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 158: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 159: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 160: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 161: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 162: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 163: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 164: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 165: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 166: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 167: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 168: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 169: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 170: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 171: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 172: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 173: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 174: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 175: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 176: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 177: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 178: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 179: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 180: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 181: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 182: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 183: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 184: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 185: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 186: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 187: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 188: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 189: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 190: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 191: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 192: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 193: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 194: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 195: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 196: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 197: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 198: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 199: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 200: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 201: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 202: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 203: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 204: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 205: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 206: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 207: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 208: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 209: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 210: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 211: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 212: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 213: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 214: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 215: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 216: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 217: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 218: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 219: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 220: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 221: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 222: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 223: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 224: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 225: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 226: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 227: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 228: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 229: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 230: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 231: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 232: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 233: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 234: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 235: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 236: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 237: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 238: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 239: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 240: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 241: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 242: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 243: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 244: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 245: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 246: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 247: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 248: Preserve provider reasoning state and keep stable prompt prefixes intact.\\nRule 249: Preserve provider reasoning state and keep stable prompt prefixes intact.\",\"cache_control\":{\"type\":\"ephemeral\"}},{\"type\":\"text\",\"text\":\"Reply with OK only.\",\"cache_control\":{\"type\":\"ephemeral\"}}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Confirm.\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"only\":[\"anthropic\"]}}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAX7CPB1H6DXYGEN0QC59B\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"output_tokens\":4,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912142769,\"endTime\":1790912145050,\"providerRequestId\":\"req_011Cfci97Sx57GBnQeURMvhn\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci97oH2F2WDCJKPbrcX\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"confirmed\",\"pinnedProvider\":\"anthropic\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0017014\",\"marketCost\":\"0.0017014\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0017014\",\"inferenceCost\":\"0.0017014\",\"inputInferenceCost\":\"0.0016614\",\"outputInferenceCost\":\"0.00004\",\"generationId\":\"gen_01M3XAX7CPB1H6DXYGEN0QC59B\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M4570XG28GG4V70MVE5DPKPG\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"OK\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":4,\"output_tokens\":4,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":4,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":8267,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":4,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[],\"planningReasoning\":\"Provider set restricted to: anthropic. System credentials planned for: anthropic. Total execution order: anthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791176504863,\"endTime\":1791176506119,\"providerRequestId\":\"req_011CfiW8NxhdWhraDtd72Lhp\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfiW8PNzxLgGo4XCy8euc\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"confirmed\",\"pinnedProvider\":\"anthropic\"},\"clientSessionId\":\"c07bb6f3d42a3239255c5e93ab22568e\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.0017014\",\"marketCost\":\"0.0017014\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.0017014\",\"inferenceCost\":\"0.0017014\",\"inputInferenceCost\":\"0.0016614\",\"outputInferenceCost\":\"0.00004\",\"generationId\":\"gen_01M4570XG28GG4V70MVE5DPKPG\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json index 0880d5f86b18..a8878ac063e3 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-claude-reasoning-and-tools.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048}" }, "response": { "status": 200, @@ -35,7 +35,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"\"},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":null,\"tool_calls\":[{\"id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"\"},{\"role\":\"tool\",\"tool_call_id\":\"toolu_01GV2kwNUpDVDUXK3nekcJGf\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048}" }, "response": { "status": 200, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json index 958b3713bc28..c5907e5d5f9e 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-chat-muse-reasoning-and-tools.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048}" }, "response": { "status": 200, @@ -35,7 +35,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"meta/muse-spark-1.3\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"I'll look up the weather in Paris for you.\",\"tool_calls\":[{\"id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"\"},{\"role\":\"tool\",\"tool_call_id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"meta/muse-spark-1.3\",\"messages\":[{\"role\":\"system\",\"content\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"},{\"role\":\"user\",\"content\":\"What is the weather in Paris?\"},{\"role\":\"assistant\",\"content\":\"I'll look up the weather in Paris for you.\",\"tool_calls\":[{\"id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"}}],\"reasoning\":\"\"},{\"role\":\"tool\",\"tool_call_id\":\"call_01a109fdbbdd7347a6918c3662c8128e\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"tools\":[{\"type\":\"function\",\"function\":{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}}],\"stream\":true,\"stream_options\":{\"include_usage\":true},\"reasoning_effort\":\"low\",\"max_completion_tokens\":2048}" }, "response": { "status": 200, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json index d6a74be9a2b5..626489537c63 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-claude-reasoning-and-tools.json @@ -6,7 +6,7 @@ "provider:vercel-ai-gateway" ], "name": "vercel-native/continues-messages-claude-reasoning-and-tools", - "recordedAt": "2026-10-02T03:35:13.499Z" + "recordedAt": "2026-10-05T05:01:43.431Z" }, "interactions": [ { @@ -17,14 +17,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"output_config\":{\"effort\":\"low\"}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAW7ZD2NKJ3EJK6TDJZ2Y7\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_011X7KQPt2EPYDcB88u73nKT\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\": \\\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":420,\"output_tokens\":50,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":420,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"bedrock\",\"vertexAnthropic\"],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. System credentials planned for: anthropic, claudeaws, bedrock, vertexAnthropic. Total execution order: anthropic(system) → claudeaws(system) → bedrock(system) → vertexAnthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912110619,\"endTime\":1790912111857,\"providerRequestId\":\"req_011Cfci6jzKJmMtckpt31maZ\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci6kek3VBu4ibLAJGcU\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00134\",\"marketCost\":\"0.00134\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00134\",\"inferenceCost\":\"0.00134\",\"inputInferenceCost\":\"0.00084\",\"outputInferenceCost\":\"0.0005\",\"generationId\":\"gen_01M3XAW7ZD2NKJ3EJK6TDJZ2Y7\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M4570TCVSBA1XA414GAQ4CXD\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"tool_use\",\"id\":\"toolu_01HUuDeJSxrGVzp36mnVyXyv\",\"name\":\"get_weather\",\"input\":{}}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"{\\\"city\\\": \\\"Paris\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"input_json_delta\",\"partial_json\":\"\\\"}\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"tool_use\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":420,\"output_tokens\":50,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":420,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":50,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"bedrock\",\"vertexAnthropic\",\"claudeaws\"],\"planningReasoning\":\"System credentials planned for: anthropic, bedrock, vertexAnthropic, claudeaws. Total execution order: anthropic(system) → bedrock(system) → vertexAnthropic(system) → claudeaws(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791176501800,\"endTime\":1791176502677,\"providerRequestId\":\"req_011CfiW89nSemMDq17221pkX\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfiW8ATdTzcemBmD1hcuT\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.00134\",\"marketCost\":\"0.00134\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.00134\",\"inferenceCost\":\"0.00134\",\"inputInferenceCost\":\"0.00084\",\"outputInferenceCost\":\"0.0005\",\"generationId\":\"gen_01M4570TCVSBA1XA414GAQ4CXD\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } }, { @@ -35,14 +35,14 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_011X7KQPt2EPYDcB88u73nKT\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_011X7KQPt2EPYDcB88u73nKT\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"tool_use\",\"id\":\"toolu_01HUuDeJSxrGVzp36mnVyXyv\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"toolu_01HUuDeJSxrGVzp36mnVyXyv\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"output_config\":{\"effort\":\"low\"}}" }, "response": { "status": 200, "headers": { "content-type": "text/event-stream" }, - "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M3XAW9EQZ6HHBK5J1Y1VATAH\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":493,\"output_tokens\":10,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":493,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"claudeaws\",\"bedrock\",\"vertexAnthropic\"],\"planningReasoning\":\"Weighted tie pick: anthropic won tier 0 over claudeaws. System credentials planned for: anthropic, claudeaws, bedrock, vertexAnthropic. Total execution order: anthropic(system) → claudeaws(system) → bedrock(system) → vertexAnthropic(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1790912112646,\"endTime\":1790912113533,\"providerRequestId\":\"req_011Cfci6tdTiPKqAhS4mbNEJ\",\"statusCode\":200,\"providerResponseId\":\"msg_011Cfci6u3mugVhTFZWBjibo\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.001086\",\"marketCost\":\"0.001086\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.001086\",\"inferenceCost\":\"0.001086\",\"inputInferenceCost\":\"0.000986\",\"outputInferenceCost\":\"0.0001\",\"generationId\":\"gen_01M3XAW9EQZ6HHBK5J1Y1VATAH\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" + "body": "event: message_start\ndata: {\"type\":\"message_start\",\"message\":{\"id\":\"gen_01M4570VFYNAEGVS60AYMPC6NG\",\"type\":\"message\",\"role\":\"assistant\",\"content\":[],\"model\":\"anthropic/claude-sonnet-5.5\",\"stop_reason\":null,\"stop_sequence\":null,\"usage\":{\"input_tokens\":0,\"output_tokens\":0}}}\n\nevent: content_block_start\ndata: {\"type\":\"content_block_start\",\"index\":0,\"content_block\":{\"type\":\"text\",\"text\":\"\"}}\n\nevent: content_block_delta\ndata: {\"type\":\"content_block_delta\",\"index\":0,\"delta\":{\"type\":\"text_delta\",\"text\":\"Paris is sunny.\"}}\n\nevent: content_block_stop\ndata: {\"type\":\"content_block_stop\",\"index\":0}\n\nevent: message_delta\ndata: {\"type\":\"message_delta\",\"delta\":{\"stop_reason\":\"end_turn\",\"stop_sequence\":null},\"usage\":{\"input_tokens\":493,\"output_tokens\":10,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0}},\"input_transformations\":[],\"provider_metadata\":{\"anthropic\":{\"usage\":{\"input_tokens\":493,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"cache_creation\":{\"ephemeral_5m_input_tokens\":0,\"ephemeral_1h_input_tokens\":0},\"output_tokens\":10,\"service_tier\":\"standard\",\"inference_geo\":\"global\",\"output_tokens_details\":{\"thinking_tokens\":0}},\"cacheCreationInputTokens\":0,\"stopSequence\":null,\"inputTransformations\":[],\"iterations\":null,\"container\":null,\"contextManagement\":null},\"gateway\":{\"routing\":{\"originalModelId\":\"anthropic/claude-sonnet-5.5\",\"resolvedProvider\":\"anthropic\",\"fallbacksAvailable\":[\"bedrock\",\"vertexAnthropic\",\"claudeaws\"],\"planningReasoning\":\"System credentials planned for: anthropic, bedrock, vertexAnthropic, claudeaws. Total execution order: anthropic(system) → bedrock(system) → vertexAnthropic(system) → claudeaws(system)\",\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"finalProvider\":\"anthropic\",\"modelAttemptCount\":1,\"modelAttempts\":[{\"canonicalSlug\":\"anthropic/claude-sonnet-5.5\",\"success\":true,\"providerAttemptCount\":1,\"providerAttempts\":[{\"provider\":\"anthropic\",\"credentialType\":\"system\",\"success\":true,\"startTime\":1791176502820,\"endTime\":1791176503470,\"providerRequestId\":\"req_011CfiW8EBMRJC1mJAyNfuhc\",\"statusCode\":200,\"providerResponseId\":\"msg_011CfiW8EYw9svWDkh3UxuCK\"}]}],\"totalProviderAttemptCount\":1,\"affinity\":{\"outcome\":\"skipped_below_min_prefix\"},\"clientSessionId\":\"a47cd177650917b88c4d443d7bd8be68\",\"clientSessionIdSource\":\"fingerprint\"},\"cost\":\"0.001086\",\"marketCost\":\"0.001086\",\"surchargeCost\":\"0\",\"gatewayCost\":\"0.001086\",\"inferenceCost\":\"0.001086\",\"inputInferenceCost\":\"0.000986\",\"outputInferenceCost\":\"0.0001\",\"generationId\":\"gen_01M4570VFYNAEGVS60AYMPC6NG\"}}}\n\nevent: message_stop\ndata: {\"type\":\"message_stop\"}\n\n" } } ] diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json index 2c88e0cc3c3c..d6e123e6dbb4 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-deepseek-reasoning-and-tools.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"deepseek/deepseek-v4.1-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"high\"},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"deepseek/deepseek-v4.1-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"high\"}}" }, "response": { "status": 200, @@ -35,7 +35,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"deepseek/deepseek-v4.1-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"The user wants me to call get_weather once for Paris, then reply exactly \\\"Paris is sunny.\\\"\",\"signature\":\"\"},{\"type\":\"tool_use\",\"id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"high\"},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"deepseek/deepseek-v4.1-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"The user wants me to call get_weather once for Paris, then reply exactly \\\"Paris is sunny.\\\"\",\"signature\":\"\"},{\"type\":\"tool_use\",\"id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"chatcmpl-tool-51e80fcbd5064b6e8bc9b8d0fa1d4e1d\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"high\"}}" }, "response": { "status": 200, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json index c54941ba0df8..f94da6afe94b 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-messages-gemini-reasoning-and-tools.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"google/gemini-3.8-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"google/gemini-3.8-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"low\"}}" }, "response": { "status": 200, @@ -35,7 +35,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"google/gemini-3.8-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"AY89a19bLXkNRJcCTLXJhlklpdU5hxo3vEit19RMmh8bC8Jm2SmGq6E5NZdq177AdJfOKRYxZkFuEaJ/ngpxoqLeB47ZMMK4VSZD2lhRbfFR6S8bITZ1\"},{\"type\":\"tool_use\",\"id\":\"call_355115\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_355115\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"low\"},\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"google/gemini-3.8-flash\",\"system\":[{\"type\":\"text\",\"text\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\"}],\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"What is the weather in Paris?\"}]},{\"role\":\"assistant\",\"content\":[{\"type\":\"thinking\",\"thinking\":\"\",\"signature\":\"AY89a19bLXkNRJcCTLXJhlklpdU5hxo3vEit19RMmh8bC8Jm2SmGq6E5NZdq177AdJfOKRYxZkFuEaJ/ngpxoqLeB47ZMMK4VSZD2lhRbfFR6S8bITZ1\"},{\"type\":\"tool_use\",\"id\":\"call_355115\",\"name\":\"get_weather\",\"input\":{\"city\":\"Paris\"}}]},{\"role\":\"user\",\"content\":[{\"type\":\"tool_result\",\"tool_use_id\":\"call_355115\",\"content\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}]}],\"tools\":[{\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"input_schema\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false}}],\"stream\":true,\"max_tokens\":2048,\"thinking\":{\"type\":\"adaptive\"},\"output_config\":{\"effort\":\"low\"}}" }, "response": { "status": 200, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json index 2b372419bbb1..d44938154aa3 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-gpt-reasoning-and-tools.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"openai/gpt-6-luna\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"openai/gpt-6-luna\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true}" }, "response": { "status": 200, @@ -35,7 +35,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"openai/gpt-6-luna\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_1790912116805_gjpiv08fad6\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"openai/gpt-6-luna\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"function_call\",\"id\":\"fc_1790912116805_gjpiv08fad6\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call_iUMyf0iR7KJvUJl7O30wRmGi\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true}" }, "response": { "status": 200, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json index da38e1b3b841..f67f3cdf0556 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/continues-responses-grok-reasoning-and-tools.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"spacexai/grok-4.7\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"spacexai/grok-4.7\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true}" }, "response": { "status": 200, @@ -35,7 +35,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"spacexai/grok-4.7\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiJmQmZoSmxEbkhOUXVzcDdFeDl1TTB6RGVPNExoVlVmK21BdldMZGwwSkk2bCtURjhwbXcxb091emVvVFRSUlBHLzJGd3JCVy9hM1g3NCtTRTAwSFlkd2I1Z1hnTXFTZHVNZ1cyZlJsVE12S3VEaGE1TWlEODRIYy8wSjZFdnRmS1JkcjU5TGpZL29mK01Qbk9RWi9Od0phOEFKb1pHZmVnUkx6cUVudlQ1eUM3dTNDYWsvZzFrWWNmR2xkNDNzVmJMVGZiSjJIaDh5SWlPNlEyOExGVUNBN3FmRzQzV2VqM1BDSzkvZnk1U29tTVN2NUk5ZkoxeU9jc3IwY2ZSUGNmeStBIiwib3JpZ2luIjoieGFpIn19\"},{\"type\":\"function_call\",\"id\":\"fc_1790912123226_i789hz8nb4\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true,\"providerOptions\":{\"gateway\":{}}}" + "body": "{\"model\":\"spacexai/grok-4.7\",\"input\":[{\"type\":\"message\",\"role\":\"user\",\"content\":[{\"type\":\"input_text\",\"text\":\"What is the weather in Paris?\"}]},{\"type\":\"reasoning\",\"id\":\"rs_49e377e8-18fe-9c93-bc42-e78bc06ef8c8\",\"summary\":[{\"type\":\"summary_text\",\"text\":\"The user wants me to use the get_weather tool exactly once, then reply exactly \\\"Paris is sunny.\\\" after the tool result.\\n\"}],\"encrypted_content\":\"gwenc1.eyJvIjp7ImNvbnRlbnQiOiJmQmZoSmxEbkhOUXVzcDdFeDl1TTB6RGVPNExoVlVmK21BdldMZGwwSkk2bCtURjhwbXcxb091emVvVFRSUlBHLzJGd3JCVy9hM1g3NCtTRTAwSFlkd2I1Z1hnTXFTZHVNZ1cyZlJsVE12S3VEaGE1TWlEODRIYy8wSjZFdnRmS1JkcjU5TGpZL29mK01Qbk9RWi9Od0phOEFKb1pHZmVnUkx6cUVudlQ1eUM3dTNDYWsvZzFrWWNmR2xkNDNzVmJMVGZiSjJIaDh5SWlPNlEyOExGVUNBN3FmRzQzV2VqM1BDSzkvZnk1U29tTVN2NUk5ZkoxeU9jc3IwY2ZSUGNmeStBIiwib3JpZ2luIjoieGFpIn19\"},{\"type\":\"function_call\",\"id\":\"fc_1790912123226_i789hz8nb4\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"name\":\"get_weather\",\"arguments\":\"{\\\"city\\\":\\\"Paris\\\"}\"},{\"type\":\"function_call_output\",\"call_id\":\"call-37a29db2-38ae-4f89-95ef-321aba43ee4e-0\",\"output\":\"{\\\"temperature\\\":22,\\\"condition\\\":\\\"sunny\\\"}\"}],\"instructions\":\"Use the get_weather tool exactly once. After the tool result, reply exactly: Paris is sunny.\",\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\",\"description\":\"Get current weather for a city.\",\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}},\"required\":[\"city\"],\"additionalProperties\":false},\"strict\":false}],\"store\":false,\"include\":[\"reasoning.encrypted_content\"],\"reasoning\":{\"effort\":\"low\"},\"max_output_tokens\":2048,\"stream\":true}" }, "response": { "status": 200, diff --git a/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json b/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json index 3d4a7a2289ab..bee5e34fd69a 100644 --- a/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json +++ b/packages/ai/test/fixtures/recordings/vercel-native/rejects-invalid-credentials-without-retryable-classification.json @@ -17,7 +17,7 @@ "headers": { "content-type": "application/json" }, - "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello\"}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}},\"providerOptions\":{\"gateway\":{\"caching\":\"auto\"}}}" + "body": "{\"model\":\"anthropic/claude-sonnet-5.5\",\"messages\":[{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hello\",\"cache_control\":{\"type\":\"ephemeral\"}}]}],\"stream\":true,\"max_tokens\":32,\"thinking\":{\"type\":\"adaptive\",\"block_binding\":{\"prefix_mismatch_behavior\":\"drop_block\"}}}" }, "response": { "status": 401, diff --git a/packages/ai/test/provider/vercel-ai-gateway.test.ts b/packages/ai/test/provider/vercel-ai-gateway.test.ts index 21ae9371a724..81cf0a24841e 100644 --- a/packages/ai/test/provider/vercel-ai-gateway.test.ts +++ b/packages/ai/test/provider/vercel-ai-gateway.test.ts @@ -28,11 +28,38 @@ it.effect("Gateway defaults preserve full model IDs and select the requested fam expect(model.route.endpoint.path).toBe(path) const compiled = yield* compileRequest(LLM.request({ model, prompt: "Hello" })) expect(compiled.body.model).toBe(id) - expect(compiled.body.providerOptions).toEqual({ gateway: { caching: "auto" } }) + expect(compiled.body.providerOptions).toBeUndefined() } }), ) +it.effect("Gateway Messages applies inline cache markers only for Anthropic and Qwen models", () => + Effect.gen(function* () { + const gateway = VercelAIGateway.configure({ apiKey: "fixture" }) + const input = { + system: "System prompt", + tools: [{ name: "lookup", description: "Lookup", inputSchema: { type: "object" } }], + prompt: "Hello", + } + const claude = yield* compileRequest( + LLM.request({ ...input, model: gateway.messages("anthropic/claude-sonnet-5.5") }), + ) + expect(claude.body).toMatchObject({ + tools: [{ name: "lookup", cache_control: { type: "ephemeral" } }], + system: [{ type: "text", text: "System prompt", cache_control: { type: "ephemeral" } }], + messages: [{ role: "user", content: [{ type: "text", text: "Hello", cache_control: { type: "ephemeral" } }] }], + }) + const qwen = yield* compileRequest(LLM.request({ ...input, model: gateway.messages("alibaba/qwen3.8-max") })) + expect(qwen.body).toMatchObject({ + tools: [{ name: "lookup", cache_control: undefined }], + system: [{ type: "text", text: "System prompt", cache_control: { type: "ephemeral" } }], + messages: [{ role: "user", content: [{ type: "text", text: "Hello", cache_control: { type: "ephemeral" } }] }], + }) + const gemini = yield* compileRequest(LLM.request({ ...input, model: gateway.messages("google/gemini-3.8-flash") })) + expect(JSON.stringify(gemini.body)).not.toContain("cache_control") + }), +) + it.effect("Gateway keeps distinct system blocks, cache hints, and upstream-scoped controls", () => Effect.gen(function* () { const compiled = yield* compileRequest( @@ -96,7 +123,7 @@ it.effect("Gateway Responses keeps cache-key and cache controls out of upstream }), ) expect(compiled.body).toMatchObject({ prompt_cache_key: "opaque-session", cache_ttl: "1h", cache_anchor_items: 1 }) - expect(compiled.body.providerOptions).toEqual({ gateway: { caching: "auto" } }) + expect(compiled.body.providerOptions).toBeUndefined() }), ) From 0c0a092c6dd80e3e165ca86ca4df80bf52213363 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 09:48:55 -0500 Subject: [PATCH 12/19] refactor(ai): inline Gateway metadata read in step --- .../src/protocols/utils/gateway-protocol.ts | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index 7b107a320d4b..3239b4baca14 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -22,21 +22,6 @@ interface ParserState { readonly gateway?: Record } -function readGatewayMetadata( - current: Record | undefined, - frame: string, -): Record | undefined { - if (!frame.includes("provider_metadata")) return current - const decoded = decodeWireMetadata(frame) - if (decoded._tag === "None") return current - return mergeJsonRecords( - current, - decoded.value.provider_metadata?.gateway, - decoded.value.response?.provider_metadata?.gateway, - ...(decoded.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), - ) -} - function attachGatewayMetadata( events: ReadonlyArray, gateway: Record | undefined, @@ -81,7 +66,16 @@ export function gatewayProtocol( const event = yield* decodeEvent(frame).pipe( Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", frame, cause)), ) - const gateway = readGatewayMetadata(state.gateway, frame) + const decoded = frame.includes("provider_metadata") ? decodeWireMetadata(frame) : undefined + const gateway = + decoded === undefined || decoded._tag === "None" + ? state.gateway + : mergeJsonRecords( + state.gateway, + decoded.value.provider_metadata?.gateway, + decoded.value.response?.provider_metadata?.gateway, + ...(decoded.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), + ) const [inner, events] = yield* protocol.stream.step(state.inner, event) return [{ inner, gateway }, attachGatewayMetadata(events, gateway)] as const }), From 2fe938912af8a24bccf0551ab5bc8a2cbe01789e Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 09:58:40 -0500 Subject: [PATCH 13/19] refactor(ai): loosen Gateway option and wire metadata schemas --- .../src/protocols/utils/gateway-protocol.ts | 16 +-- .../ai/src/providers/vercel-ai-gateway.ts | 111 +++++++++++------- 2 files changed, 77 insertions(+), 50 deletions(-) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index 3239b4baca14..c54f88f70c8b 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -1,19 +1,19 @@ import { Effect, Schema } from "effect" import { Protocol } from "../../route/protocol.js" import { LLMEvent, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" -import { ProviderShared } from "../shared.js" +import { optionalNull, ProviderShared } from "../shared.js" // Gateway attaches billing and routing metadata to raw SSE frames under snake_case `provider_metadata.gateway` // (`message_delta` on Messages, `response.completed` on Responses, and `choices[].delta` on Chat). const WireMetadataField = Schema.Struct({ - provider_metadata: Schema.optional( - Schema.Struct({ gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)) }), + provider_metadata: optionalNull( + Schema.Struct({ gateway: optionalNull(Schema.Record(Schema.String, Schema.Unknown)) }), ), }) const WireFrameMetadata = Schema.Struct({ ...WireMetadataField.fields, - response: Schema.optional(WireMetadataField), - choices: Schema.optional(Schema.Array(Schema.Struct({ delta: Schema.optional(WireMetadataField) }))), + response: optionalNull(WireMetadataField), + choices: optionalNull(Schema.Array(Schema.Struct({ delta: optionalNull(WireMetadataField) }))), }) const decodeWireMetadata = Schema.decodeUnknownOption(Schema.fromJsonString(WireFrameMetadata)) @@ -72,9 +72,9 @@ export function gatewayProtocol( ? state.gateway : mergeJsonRecords( state.gateway, - decoded.value.provider_metadata?.gateway, - decoded.value.response?.provider_metadata?.gateway, - ...(decoded.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), + decoded.value.provider_metadata?.gateway ?? undefined, + decoded.value.response?.provider_metadata?.gateway ?? undefined, + ...(decoded.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway ?? undefined), ) const [inner, events] = yield* protocol.stream.step(state.inner, event) return [{ inner, gateway }, attachGatewayMetadata(events, gateway)] as const diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 61e6fefd62e7..f3ff503dc06b 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -11,7 +11,7 @@ import { import { AnthropicMessages } from "../protocols/anthropic-messages.js" import { OpenAIChat } from "../protocols/openai-chat.js" import { OpenResponses } from "../protocols/open-responses.js" -import { ProviderShared } from "../protocols/shared.js" +import { optionalNull, ProviderShared } from "../protocols/shared.js" import { gatewayProtocol } from "../protocols/utils/gateway-protocol.js" import type { ProviderPackage } from "../provider-package.js" import { Auth } from "../route/auth.js" @@ -40,24 +40,48 @@ const baseURL = "https://ai-gateway.vercel.sh/v1" export interface GatewayOptions { readonly [key: string]: unknown - readonly caching?: "auto" + readonly caching?: "auto" | (string & {}) readonly only?: ReadonlyArray readonly order?: ReadonlyArray - readonly sort?: string - readonly models?: ReadonlyArray + readonly sort?: "cost" | "tps" | "ttft" | (string & {}) + readonly models?: ReadonlyArray>> readonly zeroDataRetention?: boolean + readonly disallowPromptTraining?: boolean + readonly has?: ReadonlyArray< + | "implicit-caching" + | "reasoning" + | "structured-output" + | "tool-use" + | "vision" + | `quantization:${string}` + | `!quantization:${string}` + | (string & {}) + > + readonly idempotencyKey?: string + readonly quotaEntityId?: string + readonly serviceTier?: "flex" | "priority" | (string & {}) readonly user?: string readonly tags?: ReadonlyArray readonly byok?: Readonly>>>> readonly inferenceRegion?: string - readonly providerTimeouts?: { readonly byok?: Readonly> } + readonly providerTimeouts?: { + readonly [key: string]: unknown + readonly byok?: Readonly> + } } export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & - AnthropicMessages.OptionsInput & { + Omit & { + readonly thinking?: + | AnthropicMessages.OptionsInput["thinking"] + | { + readonly type: "enabled" | "adaptive" | "disabled" | (string & {}) + readonly budgetTokens?: number + readonly budget_tokens?: number + } readonly gateway?: GatewayOptions /** Upstream options forwarded under their Gateway provider namespace. */ - readonly upstream?: Readonly>>> + readonly upstream?: Readonly> | undefined>> /** Responses automatic-cache lifetime. */ readonly cacheTTL?: "5m" | "1h" | (string & {}) /** Number of stable Responses input items. */ @@ -66,11 +90,7 @@ export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & export interface EvaluationOptions { readonly [key: string]: unknown - readonly gateway?: Readonly<{ - readonly [key: string]: unknown - readonly zeroDataRetention?: boolean - readonly only?: ReadonlyArray - }> + readonly gateway?: GatewayOptions } export type Options = Omit & @@ -82,23 +102,24 @@ export type Options = Omit & export type Settings = ProviderPackage.Settings & ProviderOptionsInput & { readonly apiKey?: string } const GatewayOptionsSchema = Schema.Struct({ - gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), - upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), - reasoningEffort: Schema.optional(ReasoningEffort), - cacheTTL: Schema.optional(Schema.String), - cacheAnchorItems: Schema.optional(Schema.Number), + gateway: optionalNull(Schema.Record(Schema.String, Schema.Unknown)), + upstream: optionalNull(Schema.Record(Schema.String, optionalNull(Schema.Record(Schema.String, Schema.Unknown)))), + reasoningEffort: optionalNull(ReasoningEffort), + cacheTTL: optionalNull(Schema.String), + cacheAnchorItems: optionalNull(Schema.Number), }) const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(GatewayOptionsSchema)) -const ChatThinking = Schema.Union([ - Schema.Struct({ type: Schema.Literals(["adaptive", "disabled"]) }), - Schema.Struct({ type: Schema.Literal("enabled"), budgetTokens: Schema.Number }), -]) +const ChatThinking = Schema.Struct({ + type: Schema.String, + budgetTokens: optionalNull(Schema.Number), + budget_tokens: optionalNull(Schema.Number), +}) type ChatThinking = typeof ChatThinking.Type const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) -function messagesRequest(request: LLMRequest, effort: ReasoningEffort | undefined) { - if (effort === undefined) return request +function messagesRequest(request: LLMRequest, effort: ReasoningEffort | null | undefined) { + if (effort === undefined || effort === null) return request const enabled = effort !== "none" const thinking = request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" } return LLMRequest.update(request, { @@ -114,14 +135,21 @@ function chatReasoning(thinking: ChatThinking | undefined) { if (!thinking) return undefined return { enabled: thinking.type !== "disabled", - max_tokens: thinking.type === "enabled" ? thinking.budgetTokens : undefined, + max_tokens: thinking.budgetTokens ?? thinking.budget_tokens ?? undefined, } } function gatewayProviderOptions(options: typeof GatewayOptionsSchema.Type) { - if (options.upstream === undefined && options.gateway === undefined) return undefined + const upstream = + options.upstream === undefined || options.upstream === null + ? undefined + : Object.fromEntries( + Object.entries(options.upstream).filter(([, value]) => value !== undefined && value !== null), + ) + const hasUpstream = upstream !== undefined && Object.keys(upstream).length > 0 + if (!hasUpstream && !options.gateway) return undefined return { - ...options.upstream, + ...upstream, ...(options.gateway ? { gateway: options.gateway } : {}), } } @@ -141,15 +169,14 @@ const prepare = (api: "messages" | "responses" | "chat") => request, body: { providerOptions, - cache_ttl: options.cacheTTL, - cache_anchor_items: options.cacheAnchorItems, + cache_ttl: options.cacheTTL ?? undefined, + cache_anchor_items: options.cacheAnchorItems ?? undefined, }, } } + const rawThinking = request.providerOptions?.thinking const thinking = - request.providerOptions?.thinking === undefined - ? undefined - : yield* decodeChatThinking(request.providerOptions.thinking) + rawThinking === undefined || rawThinking === null ? undefined : yield* decodeChatThinking(rawThinking) return { request, body: { @@ -215,16 +242,16 @@ const Request = Schema.StructWithRest( [Schema.Record(Schema.String, Schema.Any)], ) const Response = Schema.Struct({ - model: Schema.optional(Schema.String), + model: optionalNull(Schema.String), answers: Schema.Record(Schema.String, EvaluationAnswer), - usage: Schema.optional( + usage: optionalNull( Schema.Struct({ - inputTokens: Schema.optional(Schema.Number), - outputTokens: Schema.optional(Schema.Number), + inputTokens: optionalNull(Schema.Number), + outputTokens: optionalNull(Schema.Number), }), ), - rounding: Schema.optional(EvaluationRounding), - providerMetadata: Schema.optional(ProviderMetadata), + rounding: optionalNull(EvaluationRounding), + providerMetadata: optionalNull(ProviderMetadata), }) export const configure = (input: Options = {}) => { @@ -313,17 +340,17 @@ export const configure = (input: Options = {}) => { answers: data.answers, usage: data.usage ? new Usage({ - inputTokens: data.usage.inputTokens, - outputTokens: data.usage.outputTokens, + inputTokens: data.usage.inputTokens ?? undefined, + outputTokens: data.usage.outputTokens ?? undefined, totalTokens: - data.usage.inputTokens === undefined && data.usage.outputTokens === undefined + data.usage.inputTokens == null && data.usage.outputTokens == null ? undefined : (data.usage.inputTokens ?? 0) + (data.usage.outputTokens ?? 0), providerMetadata: { gateway: data.usage }, }) : undefined, - rounding: data.rounding, - providerMetadata: data.providerMetadata, + rounding: data.rounding ?? undefined, + providerMetadata: data.providerMetadata ?? undefined, }) }), }, From 928650ef1163837f23eec79be5abf198d6bb136e Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 10:03:24 -0500 Subject: [PATCH 14/19] refactor(ai): keep Gateway request options optional-only --- .../ai/src/providers/vercel-ai-gateway.ts | 43 ++++++++----------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index f3ff503dc06b..44bc4b26b91c 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -57,7 +57,6 @@ export interface GatewayOptions { | `!quantization:${string}` | (string & {}) > - readonly idempotencyKey?: string readonly quotaEntityId?: string readonly serviceTier?: "flex" | "priority" | (string & {}) readonly user?: string @@ -81,7 +80,7 @@ export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & } readonly gateway?: GatewayOptions /** Upstream options forwarded under their Gateway provider namespace. */ - readonly upstream?: Readonly> | undefined>> + readonly upstream?: Readonly>>> /** Responses automatic-cache lifetime. */ readonly cacheTTL?: "5m" | "1h" | (string & {}) /** Number of stable Responses input items. */ @@ -102,24 +101,24 @@ export type Options = Omit & export type Settings = ProviderPackage.Settings & ProviderOptionsInput & { readonly apiKey?: string } const GatewayOptionsSchema = Schema.Struct({ - gateway: optionalNull(Schema.Record(Schema.String, Schema.Unknown)), - upstream: optionalNull(Schema.Record(Schema.String, optionalNull(Schema.Record(Schema.String, Schema.Unknown)))), - reasoningEffort: optionalNull(ReasoningEffort), - cacheTTL: optionalNull(Schema.String), - cacheAnchorItems: optionalNull(Schema.Number), + gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), + upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), + reasoningEffort: Schema.optional(ReasoningEffort), + cacheTTL: Schema.optional(Schema.String), + cacheAnchorItems: Schema.optional(Schema.Number), }) const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(GatewayOptionsSchema)) const ChatThinking = Schema.Struct({ type: Schema.String, - budgetTokens: optionalNull(Schema.Number), - budget_tokens: optionalNull(Schema.Number), + budgetTokens: Schema.optional(Schema.Number), + budget_tokens: Schema.optional(Schema.Number), }) type ChatThinking = typeof ChatThinking.Type const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) -function messagesRequest(request: LLMRequest, effort: ReasoningEffort | null | undefined) { - if (effort === undefined || effort === null) return request +function messagesRequest(request: LLMRequest, effort: ReasoningEffort | undefined) { + if (effort === undefined) return request const enabled = effort !== "none" const thinking = request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" } return LLMRequest.update(request, { @@ -135,21 +134,14 @@ function chatReasoning(thinking: ChatThinking | undefined) { if (!thinking) return undefined return { enabled: thinking.type !== "disabled", - max_tokens: thinking.budgetTokens ?? thinking.budget_tokens ?? undefined, + max_tokens: thinking.budgetTokens ?? thinking.budget_tokens, } } function gatewayProviderOptions(options: typeof GatewayOptionsSchema.Type) { - const upstream = - options.upstream === undefined || options.upstream === null - ? undefined - : Object.fromEntries( - Object.entries(options.upstream).filter(([, value]) => value !== undefined && value !== null), - ) - const hasUpstream = upstream !== undefined && Object.keys(upstream).length > 0 - if (!hasUpstream && !options.gateway) return undefined + if (options.upstream === undefined && options.gateway === undefined) return undefined return { - ...upstream, + ...options.upstream, ...(options.gateway ? { gateway: options.gateway } : {}), } } @@ -169,14 +161,15 @@ const prepare = (api: "messages" | "responses" | "chat") => request, body: { providerOptions, - cache_ttl: options.cacheTTL ?? undefined, - cache_anchor_items: options.cacheAnchorItems ?? undefined, + cache_ttl: options.cacheTTL, + cache_anchor_items: options.cacheAnchorItems, }, } } - const rawThinking = request.providerOptions?.thinking const thinking = - rawThinking === undefined || rawThinking === null ? undefined : yield* decodeChatThinking(rawThinking) + request.providerOptions?.thinking === undefined + ? undefined + : yield* decodeChatThinking(request.providerOptions.thinking) return { request, body: { From 668ee8b4ae6be811899c42cd5d616326e46ce126 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 13:36:42 -0500 Subject: [PATCH 15/19] refactor(ai): reuse inner protocol event schema in Gateway wrapper --- .../src/protocols/utils/gateway-protocol.ts | 50 +++++++------------ 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index c54f88f70c8b..0b6716147ed3 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -1,27 +1,18 @@ import { Effect, Schema } from "effect" import { Protocol } from "../../route/protocol.js" import { LLMEvent, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" -import { optionalNull, ProviderShared } from "../shared.js" - -// Gateway attaches billing and routing metadata to raw SSE frames under snake_case `provider_metadata.gateway` -// (`message_delta` on Messages, `response.completed` on Responses, and `choices[].delta` on Chat). -const WireMetadataField = Schema.Struct({ - provider_metadata: optionalNull( - Schema.Struct({ gateway: optionalNull(Schema.Record(Schema.String, Schema.Unknown)) }), - ), -}) -const WireFrameMetadata = Schema.Struct({ - ...WireMetadataField.fields, - response: optionalNull(WireMetadataField), - choices: optionalNull(Schema.Array(Schema.Struct({ delta: optionalNull(WireMetadataField) }))), -}) -const decodeWireMetadata = Schema.decodeUnknownOption(Schema.fromJsonString(WireFrameMetadata)) +import { isRecord } from "../shared.js" interface ParserState { readonly inner: Inner readonly gateway?: Record } +function gatewayMetadata(value: unknown): Record | undefined { + if (!isRecord(value) || !isRecord(value.provider_metadata)) return undefined + return isRecord(value.provider_metadata.gateway) ? value.provider_metadata.gateway : undefined +} + function attachGatewayMetadata( events: ReadonlyArray, gateway: Record | undefined, @@ -41,7 +32,6 @@ export function gatewayProtocol( ) => Effect.Effect<{ readonly request: LLMRequest; readonly body: Record }, AIError> }, ) { - const decodeEvent = Schema.decodeUnknownEffect(protocol.stream.event) const initial = (request: LLMRequest): ParserState => ({ inner: protocol.stream.initial(request), }) @@ -60,25 +50,23 @@ export function gatewayProtocol( supportsEffortUpdates: protocol.supportsEffortUpdates, sanitizer: protocol.sanitizer, stream: { - event: Schema.String, + event: protocol.stream.event, initial, - step: Effect.fnUntraced(function* (state: ParserState, frame: string) { - const event = yield* decodeEvent(frame).pipe( - Effect.mapError((cause) => ProviderShared.eventError(input.id, "Invalid gateway event", frame, cause)), - ) - const decoded = frame.includes("provider_metadata") ? decodeWireMetadata(frame) : undefined - const gateway = - decoded === undefined || decoded._tag === "None" - ? state.gateway - : mergeJsonRecords( - state.gateway, - decoded.value.provider_metadata?.gateway ?? undefined, - decoded.value.response?.provider_metadata?.gateway ?? undefined, - ...(decoded.value.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway ?? undefined), - ) + step: Effect.fnUntraced(function* (state: ParserState, event: Event) { + const gateway = isRecord(event) + ? mergeJsonRecords( + state.gateway, + gatewayMetadata(event), + gatewayMetadata(event.response), + ...(Array.isArray(event.choices) ? event.choices : []).map((choice) => + isRecord(choice) ? gatewayMetadata(choice.delta) : undefined, + ), + ) + : state.gateway const [inner, events] = yield* protocol.stream.step(state.inner, event) return [{ inner, gateway }, attachGatewayMetadata(events, gateway)] as const }), + terminal: protocol.stream.terminal, onHalt: onHalt ? (state) => onHalt(state.inner).pipe(Effect.map((events) => attachGatewayMetadata(events, state.gateway))) : undefined, From 0f0b7b0f705144b8a6464a73bcf43033e7f3a4d7 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 14:05:21 -0500 Subject: [PATCH 16/19] refactor(ai): use Effect Schema for Gateway event metadata --- .../src/protocols/utils/gateway-protocol.ts | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/packages/ai/src/protocols/utils/gateway-protocol.ts b/packages/ai/src/protocols/utils/gateway-protocol.ts index 0b6716147ed3..8fe8651dd54c 100644 --- a/packages/ai/src/protocols/utils/gateway-protocol.ts +++ b/packages/ai/src/protocols/utils/gateway-protocol.ts @@ -1,17 +1,33 @@ -import { Effect, Schema } from "effect" +import { Effect, Option, Schema } from "effect" import { Protocol } from "../../route/protocol.js" import { LLMEvent, mergeJsonRecords, type AIError, type LLMRequest } from "../../schema/index.js" -import { isRecord } from "../shared.js" +import { JsonObject, lenient } from "../shared.js" interface ParserState { readonly inner: Inner readonly gateway?: Record } -function gatewayMetadata(value: unknown): Record | undefined { - if (!isRecord(value) || !isRecord(value.provider_metadata)) return undefined - return isRecord(value.provider_metadata.gateway) ? value.provider_metadata.gateway : undefined -} +const GatewayHolder = Schema.Struct({ + provider_metadata: lenient( + Schema.Struct({ + gateway: lenient(JsonObject), + }), + ), +}) + +const GatewayEvent = Schema.Struct({ + ...GatewayHolder.fields, + response: lenient(GatewayHolder), + choices: lenient( + Schema.Array( + Schema.Struct({ + delta: lenient(GatewayHolder), + }), + ), + ), +}) +const decodeGatewayEvent = Schema.decodeUnknownOption(GatewayEvent) function attachGatewayMetadata( events: ReadonlyArray, @@ -40,7 +56,7 @@ export function gatewayProtocol( return Protocol.make({ id: input.id, body: { - schema: Schema.Record(Schema.String, Schema.Unknown), + schema: JsonObject, from: Effect.fnUntraced(function* (request: LLMRequest) { const prepared = yield* input.prepare(request) const body = yield* protocol.body.from(prepared.request) @@ -53,14 +69,13 @@ export function gatewayProtocol( event: protocol.stream.event, initial, step: Effect.fnUntraced(function* (state: ParserState, event: Event) { - const gateway = isRecord(event) + const decoded = Option.getOrUndefined(decodeGatewayEvent(event)) + const gateway = decoded ? mergeJsonRecords( state.gateway, - gatewayMetadata(event), - gatewayMetadata(event.response), - ...(Array.isArray(event.choices) ? event.choices : []).map((choice) => - isRecord(choice) ? gatewayMetadata(choice.delta) : undefined, - ), + decoded.provider_metadata?.gateway, + decoded.response?.provider_metadata?.gateway, + ...(decoded.choices ?? []).map((choice) => choice.delta?.provider_metadata?.gateway), ) : state.gateway const [inner, events] = yield* protocol.stream.step(state.inner, event) From a93753f8af92ec3de529f15d9d6d030252092b5c Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 14:24:12 -0500 Subject: [PATCH 17/19] docs(ai): document Vercel AI Gateway options --- .../ai/src/providers/vercel-ai-gateway.ts | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 44bc4b26b91c..ef977d4f4441 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -39,14 +39,28 @@ export const id = ProviderID.make("vercel-ai-gateway") const baseURL = "https://ai-gateway.vercel.sh/v1" export interface GatewayOptions { + /** Service-owned options added by the Gateway without requiring an SDK update. */ readonly [key: string]: unknown + /** Enables Gateway automatic prompt-cache breakpoint injection (`"auto"`). */ readonly caching?: "auto" | (string & {}) + /** Provider slugs that are the only ones allowed to serve the request (e.g. `["anthropic", "vertex"]`). */ readonly only?: ReadonlyArray + /** Provider slugs specifying the order in which providers are tried (e.g. `["bedrock", "anthropic"]`). */ readonly order?: ReadonlyArray + /** Sort candidate providers by cost (`"cost"`), throughput (`"tps"`), or time-to-first-token (`"ttft"`). */ readonly sort?: "cost" | "tps" | "ttft" | (string & {}) + /** Fallback models to try in order, or a conditional `{ model, when }` entry on evaluation requests. */ readonly models?: ReadonlyArray>> + /** Restrict routing to providers with zero data retention agreements. */ readonly zeroDataRetention?: boolean + /** Restrict routing to providers that do not train on prompt data. */ readonly disallowPromptTraining?: boolean + /** + * Restrict routing to provider models that satisfy every entry: capability + * tags (`"implicit-caching"`, `"reasoning"`, `"structured-output"`, + * `"tool-use"`, `"vision"`) or weight-format filters (`"quantization:fp8"`, + * `"!quantization:fp8"`). + */ readonly has?: ReadonlyArray< | "implicit-caching" | "reasoning" @@ -57,12 +71,19 @@ export interface GatewayOptions { | `!quantization:${string}` | (string & {}) > + /** Entity identifier against which Gateway quota is tracked. */ readonly quotaEntityId?: string + /** Unified service tier intent (`"flex"` or `"priority"`). */ readonly serviceTier?: "flex" | "priority" | (string & {}) + /** End-user identifier for spend tracking and attribution. */ readonly user?: string + /** User-specified tags for reporting and filtering usage. */ readonly tags?: ReadonlyArray + /** Request-scoped BYOK credentials keyed by provider slug, used instead of cached workspace credentials. */ readonly byok?: Readonly>>>> + /** Preferred inference region for upstream provider routing. */ readonly inferenceRegion?: string + /** Per-provider timeouts in milliseconds (e.g. `{ byok: { anthropic: 3000 } }`). */ readonly providerTimeouts?: { readonly [key: string]: unknown readonly byok?: Readonly> @@ -71,6 +92,7 @@ export interface GatewayOptions { export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & Omit & { + /** Reasoning configuration for Messages (`thinking`) or Chat (`reasoning.enabled` + `reasoning.max_tokens`). */ readonly thinking?: | AnthropicMessages.OptionsInput["thinking"] | { @@ -78,12 +100,13 @@ export type ProviderOptionsInput = OpenResponsesProviderOptionsInput & readonly budgetTokens?: number readonly budget_tokens?: number } + /** Gateway routing, fallback, BYOK, compliance, and attribution options sent under `body.providerOptions.gateway`. */ readonly gateway?: GatewayOptions - /** Upstream options forwarded under their Gateway provider namespace. */ + /** Provider-specific options forwarded under their upstream namespace in `body.providerOptions` (e.g. `{ anthropic: { ... } }`). */ readonly upstream?: Readonly>>> - /** Responses automatic-cache lifetime. */ + /** Responses API automatic-cache lifetime (`"5m"` or `"1h"`), sent as top-level `cache_ttl`. */ readonly cacheTTL?: "5m" | "1h" | (string & {}) - /** Number of stable Responses input items. */ + /** Responses API count of stable input items to anchor for caching, sent as top-level `cache_anchor_items`. */ readonly cacheAnchorItems?: number } From 34c64a97adadf3aed2916b24cbcb5442dba8a8fe Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 14:34:59 -0500 Subject: [PATCH 18/19] refactor(ai): inline Gateway request preparation into switch(api) --- .../ai/src/providers/vercel-ai-gateway.ts | 126 ++++++++---------- 1 file changed, 56 insertions(+), 70 deletions(-) diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index ef977d4f4441..5e9155d3865d 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -127,78 +127,65 @@ const GatewayOptionsSchema = Schema.Struct({ gateway: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)), upstream: Schema.optional(Schema.Record(Schema.String, Schema.Record(Schema.String, Schema.Unknown))), reasoningEffort: Schema.optional(ReasoningEffort), + thinking: Schema.optional( + Schema.Struct({ + type: Schema.String, + budgetTokens: Schema.optional(Schema.Number), + budget_tokens: Schema.optional(Schema.Number), + }), + ), cacheTTL: Schema.optional(Schema.String), cacheAnchorItems: Schema.optional(Schema.Number), }) const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(GatewayOptionsSchema)) -const ChatThinking = Schema.Struct({ - type: Schema.String, - budgetTokens: Schema.optional(Schema.Number), - budget_tokens: Schema.optional(Schema.Number), -}) -type ChatThinking = typeof ChatThinking.Type -const decodeChatThinking = ProviderShared.validateWith(Schema.decodeUnknownEffect(ChatThinking)) - -function messagesRequest(request: LLMRequest, effort: ReasoningEffort | undefined) { - if (effort === undefined) return request - const enabled = effort !== "none" - const thinking = request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" } - return LLMRequest.update(request, { - providerOptions: { - ...request.providerOptions, - effort: enabled ? effort : undefined, - thinking, - }, - }) -} - -function chatReasoning(thinking: ChatThinking | undefined) { - if (!thinking) return undefined - return { - enabled: thinking.type !== "disabled", - max_tokens: thinking.budgetTokens ?? thinking.budget_tokens, - } -} - -function gatewayProviderOptions(options: typeof GatewayOptionsSchema.Type) { - if (options.upstream === undefined && options.gateway === undefined) return undefined - return { - ...options.upstream, - ...(options.gateway ? { gateway: options.gateway } : {}), - } -} - const prepare = (api: "messages" | "responses" | "chat") => Effect.fnUntraced(function* (request: LLMRequest) { const options = yield* decodeOptions(request.providerOptions ?? {}) - const providerOptions = gatewayProviderOptions(options) - if (api === "messages") { - return { - request: messagesRequest(request, options.reasoningEffort), - body: { providerOptions }, - } - } - if (api === "responses") { - return { - request, - body: { - providerOptions, - cache_ttl: options.cacheTTL, - cache_anchor_items: options.cacheAnchorItems, - }, + const providerOptions = + options.upstream || options.gateway + ? { ...options.upstream, ...(options.gateway ? { gateway: options.gateway } : {}) } + : undefined + switch (api) { + case "messages": { + const effort = options.reasoningEffort + const enabled = effort !== undefined && effort !== "none" + return { + request: + effort === undefined + ? request + : LLMRequest.update(request, { + providerOptions: { + ...request.providerOptions, + effort: enabled ? effort : undefined, + thinking: request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" }, + }, + }), + body: { providerOptions }, + } } - } - const thinking = - request.providerOptions?.thinking === undefined - ? undefined - : yield* decodeChatThinking(request.providerOptions.thinking) - return { - request, - body: { - providerOptions, - reasoning: chatReasoning(thinking), - }, + case "responses": + return { + request, + body: { + providerOptions, + cache_ttl: options.cacheTTL, + cache_anchor_items: options.cacheAnchorItems, + }, + } + case "chat": + return { + request, + body: { + providerOptions, + reasoning: options.thinking + ? { + enabled: options.thinking.type !== "disabled", + max_tokens: options.thinking.budgetTokens ?? options.thinking.budget_tokens, + } + : undefined, + }, + } } }) @@ -317,9 +304,7 @@ export const configure = (input: Options = {}) => { (cause) => new AIError({ reason: new InvalidRequestError({ message: cause.message, cause }) }), ), ) - const headers = yield* Auth.toEffect( - AuthOptions.bearer(input, ["AI_GATEWAY_API_KEY", "VERCEL_OIDC_TOKEN"]), - )({ + const headers = yield* Auth.toEffect(configured.auth)({ request: req, method: "POST", url: url.toString(), @@ -358,10 +343,11 @@ export const configure = (input: Options = {}) => { ? new Usage({ inputTokens: data.usage.inputTokens ?? undefined, outputTokens: data.usage.outputTokens ?? undefined, - totalTokens: - data.usage.inputTokens == null && data.usage.outputTokens == null - ? undefined - : (data.usage.inputTokens ?? 0) + (data.usage.outputTokens ?? 0), + totalTokens: ProviderShared.totalTokens( + data.usage.inputTokens ?? undefined, + data.usage.outputTokens ?? undefined, + undefined, + ), providerMetadata: { gateway: data.usage }, }) : undefined, From 254d7e801e6b6cc97e9c4c81985e960bf59cb61a Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Mon, 5 Oct 2026 14:39:54 -0500 Subject: [PATCH 19/19] refactor(ai): flatten Gateway request preparation --- .../ai/src/providers/vercel-ai-gateway.ts | 76 +++++++++---------- 1 file changed, 34 insertions(+), 42 deletions(-) diff --git a/packages/ai/src/providers/vercel-ai-gateway.ts b/packages/ai/src/providers/vercel-ai-gateway.ts index 5e9155d3865d..fc0f2e171acc 100644 --- a/packages/ai/src/providers/vercel-ai-gateway.ts +++ b/packages/ai/src/providers/vercel-ai-gateway.ts @@ -142,27 +142,25 @@ const decodeOptions = ProviderShared.validateWith(Schema.decodeUnknownEffect(Gat const prepare = (api: "messages" | "responses" | "chat") => Effect.fnUntraced(function* (request: LLMRequest) { const options = yield* decodeOptions(request.providerOptions ?? {}) - const providerOptions = - options.upstream || options.gateway - ? { ...options.upstream, ...(options.gateway ? { gateway: options.gateway } : {}) } - : undefined + const providerOptions = (() => { + if (!options.upstream && !options.gateway) return undefined + if (!options.gateway) return options.upstream + return { ...options.upstream, gateway: options.gateway } + })() switch (api) { case "messages": { const effort = options.reasoningEffort - const enabled = effort !== undefined && effort !== "none" - return { - request: - effort === undefined - ? request - : LLMRequest.update(request, { - providerOptions: { - ...request.providerOptions, - effort: enabled ? effort : undefined, - thinking: request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" }, - }, - }), - body: { providerOptions }, - } + if (effort === undefined) return { request, body: { providerOptions } } + const enabled = effort !== "none" + const thinking = request.providerOptions?.thinking ?? { type: enabled ? "adaptive" : "disabled" } + const next = LLMRequest.update(request, { + providerOptions: { + ...request.providerOptions, + effort: enabled ? effort : undefined, + thinking, + }, + }) + return { request: next, body: { providerOptions } } } case "responses": return { @@ -173,19 +171,14 @@ const prepare = (api: "messages" | "responses" | "chat") => cache_anchor_items: options.cacheAnchorItems, }, } - case "chat": - return { - request, - body: { - providerOptions, - reasoning: options.thinking - ? { - enabled: options.thinking.type !== "disabled", - max_tokens: options.thinking.budgetTokens ?? options.thinking.budget_tokens, - } - : undefined, - }, + case "chat": { + if (!options.thinking) return { request, body: { providerOptions } } + const reasoning = { + enabled: options.thinking.type !== "disabled", + max_tokens: options.thinking.budgetTokens ?? options.thinking.budget_tokens, } + return { request, body: { providerOptions, reasoning } } + } } }) @@ -336,21 +329,20 @@ export const configure = (input: Options = {}) => { fail("Vercel AI Gateway returned an invalid evaluation response", cause, text), ), ) + const inputTokens = data.usage?.inputTokens ?? undefined + const outputTokens = data.usage?.outputTokens ?? undefined + const usage = data.usage + ? new Usage({ + inputTokens, + outputTokens, + totalTokens: ProviderShared.totalTokens(inputTokens, outputTokens, undefined), + providerMetadata: { gateway: data.usage }, + }) + : undefined return new EvaluationResponse({ model: ModelID.make(data.model ?? req.model.id), answers: data.answers, - usage: data.usage - ? new Usage({ - inputTokens: data.usage.inputTokens ?? undefined, - outputTokens: data.usage.outputTokens ?? undefined, - totalTokens: ProviderShared.totalTokens( - data.usage.inputTokens ?? undefined, - data.usage.outputTokens ?? undefined, - undefined, - ), - providerMetadata: { gateway: data.usage }, - }) - : undefined, + usage, rounding: data.rounding ?? undefined, providerMetadata: data.providerMetadata ?? undefined, })