Repository navigation
Add ngrok AI Gateway provider - #13494
Open
samcrichard wants to merge 6 commits into
Open
samcrichard wants to merge 6 commits into
samcrichard wants to merge 6 commits into
Conversation
Adds providers/ngrok (https://gateway.ngrok.ai/v1, OpenAI-compatible, with Responses and Anthropic Messages surfaces) and 91 credit-billable models from the ngrok.ai catalog across 12 labs. Every entry uses base_model; reasoning and cache controls are copied from each lab's own provider entry. Prices are the catalog's list price plus ngrok.ai's $0.05/M processing fee. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v1 base_model parse requires modalities.output whenever [modalities] is overridden. Seven files narrowed input only (Gemma 4, Qwen3.8 Max, MiniMax M3.1 Flash, Step 5 Preview, MiMo V2.6); add output from the lab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Action items
|
- Copy reasoning/cache controls for IDs with no first-party file from a same-API peer (claude-opus-4-1 from google-vertex-anthropic, gpt-5.2-codex from openrouter); add implicit cache (catalog implicit_caching) for the OpenAI chat-latest and deep-research models. - Override-only: drop capability values identical to the base. - Publish cache prices only where the resolved model has a cache capability; mirror each lab's cache cost structure (explicit read/write for Qwen) and note where the catalog bills one write rate across TTLs (Kimi K3, K3.1 Pro). - hy3: drop toggle (effort already has none) and cite the catalog price row. - Add Toggle/Budget/Effort wire comments where the source file had none. - Carry chat-completions reasoning_field/max_tokens_field from the lab entry; the gateway forwards requests and returns responses unchanged. - Limits: use the tighter of the catalog and the lab host (drops the widened Qwen contexts); omit limit.input where context narrows below it. - Carry first-party display names (DeepSeek V4 Pro, Kimi K2.7 Code HighSpeed). - Drop xiaomi/mimo-v2.5-pro (retired upstream 2026-10-21). - Note in GPT-5+ headers that tools.freeform is not yet live-probed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
validate requires reasoning_options whenever reasoning is true, so the
seven models with no host controls (GPT-5 chat-latest x3, o3/o4-mini deep
research, and two others) keep reasoning = { supported = true }, meaning
always on with no caller control.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Action items
|
- kimi-k2.7-code-highspeed: base_model -> moonshotai/kimi-k2.7-code-highspeed (the exact lab entry); drop the name override. - DeepSeek: note that credits bill the off-peak price at every hour, so no peak multiplier (ngrok docs, providers/deepseek#peak-and-off-peak-pricing). - Kimi K3 / K3.1 Pro: state that credits pay the catalog's single cache-write rate at every TTL (no TTL-conditioned write rate in the catalog). - Drop Gemma 4 26B/31B for now: the on/off wire for Gemma through Google's OpenAI-compatible endpoint isn't documented, so the toggle can't be sourced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Action items
|
- Cite per-route API surfaces from the ngrok model catalog in each header (Kimi is Chat Completions only on this gateway; DeepSeek serves Chat, Responses and Messages per ngrok's DeepSeek page). - muse-spark-1.1: drop audio input price (the lab model takes no audio). - Qwen: publish an explicit cache read only where the lab entry models one (qwen3.8-flash now mirrors providers/alibaba). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Action items
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ngrok AI Gateway (ngrok.ai) as a provider. It has one access key, one OpenAI-compatible base URL (
https://gateway.ngrok.ai/v1), and models from 12 labs that can be paid for with ngrok.ai credits. You don't need a provider account.Provider
id = ngrok,name = "ngrok AI Gateway",env = ["NGROK_AI_GATEWAY_KEY"]. These match ngrok's existing OpenCode setup guide: https://ngrok.com/docs/ai-gateway/agents/opencodenpm = "@ai-sdk/openai-compatible",opencodeai = "@opencode/ai/providers/openai-compatible",api = "https://gateway.ngrok.ai/v1"logo.svgis the ngrok wordmark withcurrentColor, centered in a square viewBox.Models (88)
OpenAI 30, Anthropic 15, Z.ai 13, Google 7, Moonshot 5, Qwen 5, Meta 4, DeepSeek 3, Xiaomi 2, Tencent 2, MiniMax 1, StepFun 1.
author/model, e.g.openai/gpt-5.5). The gateway accepts them and routes to the model author's own provider first. See https://ngrok.com/docs/ai-gateway/concepts/modelsbase_model. Each points at an existingmodels/lab file, so no lab files were added. Files are override-only.structured_output,cacheand chat-completionscompatibility(reasoning_field,max_tokens_field) are copied from each lab's own provider entry, per the multi-model relay policy in AGENTS.md. Two IDs have no first-party entry, so their controls come from a same-API peer:claude-opus-4-1from google-vertex-anthropic andgpt-5.2-codexfrom openrouter. Toggle, effort and budget wire paths are in the header comments. The gateway forwards requests minus unsupported params and returns responses unchanged: https://ngrok.com/docs/ai-gateway/how-it-workstools.freeformis not authored on the GPT-5+ models yet; custom-tool grammars haven't been live-probed through the gateway. Each header notes this.[api.messages]first. The gateway forwardsoutput_configon/v1/messagesbut stripsreasoning_efforton Chat Completions: https://ngrok.com/docs/ai-gateway/providers/anthropic#parameters-the-gateway-removeschat-completions,responsesandmessages. Responses-only models (the Pro, Codex and deep-research models) list only[api.responses].[limit]and[modalities]are overridden only where the gateway's catalog differs from the lab file. Example: MiniMax M3.1 Flash is text-only through the gateway.Pricing
GET https://api.ngrok.ai/v1/modelspricing rates), accessed 2026-11-12.[cost.audio.input].v1 output
ngrok, with 88 models to the v1 API (api.json). The goal is for existing v1 consumers to see the provider; no existing provider or model changes.bun run v1:checklocally, so I'm asking for maintainer sign-off on these v1 additions. If you'd rather keep new providers v2-only, say so and I'll setv2_only = trueon every file.Why no sync module yet
GET https://api.ngrok.ai/v1/models) needs an account API key, so a sync job running in this repo's CI can't read it.packages/core/src/sync/providers/ngrok.ts.tools.freeformon GPT-5+ZZ[0-9]{3}, on each API through the host, and that needs a funded ngrok.ai access key.freeformper API once the probe has been run.Validation
bun validateorbun run v1:checklocally; bun wasn't available in my environment. I'm relying on the Validate workflow here.schema = 2;base_modeltarget exists;[api.*]protocols are valid and prices are non-negative;svg/pathwithcurrentColor.🤖 Generated with Claude Code