diff --git a/changelog.d/changed-openrouter-defaults-model-picker.md b/changelog.d/changed-openrouter-defaults-model-picker.md new file mode 100644 index 0000000000..162c748cd9 --- /dev/null +++ b/changelog.d/changed-openrouter-defaults-model-picker.md @@ -0,0 +1 @@ +- OpenRouter's suggested models and default are current again (default `deepseek/deepseek-v4.1-flash`), retired suggestions are hidden, OpenRouter gateways discover their live model list again (the probe asked for `/api/v1/v1/models`), and large gateway catalogs get a searchable, provider-grouped model picker that shows price per 1M tokens and context length. diff --git a/docs/inference-backends.md b/docs/inference-backends.md index 4d5ef6030a..48a5e7a85f 100644 --- a/docs/inference-backends.md +++ b/docs/inference-backends.md @@ -134,7 +134,7 @@ OpenRouter is both a Model Gateway kind (`kind: openrouter`) and a guided fundin 1. Open **Governor Config → Model Gateways**. 2. Add a gateway named `openrouter` with kind `openrouter`. The UI preset fills the endpoint as `https://openrouter.ai/api/v1`. 3. Store the key as a secret value in the UI, or point `api_key_env` / `api_key_file` at a key that already exists. Hive stores only the file path or env-var name in `hive.yaml`. -4. Pick a `default_model` from discovery or enter an OpenRouter model id manually. The curated fallback default is `deepseek/deepseek-chat`. +4. Pick a `default_model` from discovery or enter an OpenRouter model id manually. The curated fallback default is `deepseek/deepseek-v4.1-flash`. For OpenRouter the Default Model field is a searchable picker: type to filter the live catalog (about 470 models), browse by provider prefix (`z-ai/`, `deepseek/`, `anthropic/`, …), and read each model's price per 1M input/output tokens and context window. The curated suggestions (DeepSeek V4.1 Flash, GLM-5.3, GLM-5.3 Flash, Claude Sonnet 5.5, Gemini 3.8 Flash) sit on top, and any suggestion OpenRouter has retired is hidden. Typing an id the catalog does not list still works. 5. Assign an agent with `backend: openrouter` (the gateway name) and either leave `model:` empty to use the default or set an explicit OpenRouter model id. Equivalent YAML looks like: @@ -146,13 +146,13 @@ governor: kind: openrouter endpoint: https://openrouter.ai/api/v1 api_key_file: /data/secrets/gateway_openrouter_api_key - default_model: deepseek/deepseek-chat + default_model: deepseek/deepseek-v4.1-flash key_name: openrouter-prod-key # optional: audit label shown in the dashboard, not a secret agents: guide: backend: openrouter - model: deepseek/deepseek-chat + model: deepseek/deepseek-v4.1-flash ``` ### Scan-to-fund flow diff --git a/src/cmd/hive/provider_gateways.go b/src/cmd/hive/provider_gateways.go index 9d8cbc8f79..bac1b46ddc 100644 --- a/src/cmd/hive/provider_gateways.go +++ b/src/cmd/hive/provider_gateways.go @@ -54,6 +54,10 @@ func (openRouterGateway) SuggestedModels() []dashboard.OpenRouterSuggestedModel return out } +func (openRouterGateway) PublicModels() []dashboard.OpenRouterModel { + return convertOpenRouterCatalog(openrouter.CachedPublicModels()) +} + func (openRouterGateway) QRPNG(text string) ([]byte, error) { return openrouter.QRPNG(text) } func (openRouterGateway) ExchangeCode(code, verifier string) (string, error) { @@ -280,3 +284,25 @@ func (svc *linearAgentService) AgentEventObserver() func(agentName, event, detai } return svc.responder.HandleAgentEvent } + +// convertOpenRouterCatalog maps the provider catalog onto the dashboard's +// mirror types (pkg/dashboard deliberately does not import pkg/openrouter). +func convertOpenRouterCatalog(models []openrouter.Model) []dashboard.OpenRouterModel { + if len(models) == 0 { + return nil + } + out := make([]dashboard.OpenRouterModel, 0, len(models)) + for _, m := range models { + out = append(out, dashboard.OpenRouterModel{ + ID: m.ID, + Name: m.Name, + ContextLength: m.ContextLength, + Pricing: dashboard.OpenRouterPricing{ + Prompt: m.Pricing.Prompt, + Completion: m.Pricing.Completion, + InputCacheRead: m.Pricing.InputCacheRead, + }, + }) + } + return out +} diff --git a/src/crux/openrouter/catalog.go b/src/crux/openrouter/catalog.go new file mode 100644 index 0000000000..b1eb405660 --- /dev/null +++ b/src/crux/openrouter/catalog.go @@ -0,0 +1,236 @@ +package openrouter + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "strconv" + "strings" + "sync" + "time" +) + +// modelsListTimeout bounds the public /v1/models fetch used by the funding +// picker and the gateway form. The catalog is ~1 MB (hundreds of models with +// descriptions), so it gets more headroom than the small key/credit calls; it +// is still a best-effort enrichment, never on an inference path. +const modelsListTimeout = 10 * time.Second + +// maxCatalogBody caps how much of the public catalog we read. The live +// response was ~850 KB with ~470 models in Nov 2026; the cap leaves room for +// the catalog to keep growing without letting a hostile or broken upstream +// stream an unbounded body into memory. +const maxCatalogBody = 8 << 20 + +// catalogCacheTTL is how long a successfully fetched catalog is reused. +// OpenRouter adds and retires models on a scale of days, so a few minutes of +// staleness is harmless and keeps the dashboard from re-downloading the +// catalog on every form open. +const catalogCacheTTL = 15 * time.Minute + +// tokensPerMillion converts OpenRouter's per-token USD prices into the +// per-1M-token figures people compare. +const tokensPerMillion = 1_000_000 + +// Pricing is a model's USD price PER TOKEN, as OpenRouter publishes it in the +// /models `pricing` block. A field is nil when the catalog omits it or marks +// it variable (OpenRouter's routers publish "-1"), so a caller can tell +// "unknown" from a genuine zero (free models publish "0"). +type Pricing struct { + Prompt *float64 `json:"prompt,omitempty"` + Completion *float64 `json:"completion,omitempty"` + InputCacheRead *float64 `json:"input_cache_read,omitempty"` +} + +// Known reports whether both the input and output price are published. A +// model with only one side known cannot be costed honestly. +func (p Pricing) Known() bool { return p.Prompt != nil && p.Completion != nil } + +// PerMillion returns a per-token price as USD per 1M tokens, or nil. +func PerMillion(perToken *float64) *float64 { + if perToken == nil { + return nil + } + v := *perToken * tokensPerMillion + return &v +} + +// Model is one entry of the public OpenRouter catalog: the id agents send, +// its display name, its context window, and its published prices. +type Model struct { + ID string `json:"id"` + Name string `json:"name,omitempty"` + ContextLength int `json:"context_length,omitempty"` + Pricing Pricing `json:"pricing"` +} + +// rawModel mirrors the catalog wire shape: prices are decimal STRINGS. +type rawModel struct { + ID string `json:"id"` + Name string `json:"name"` + ContextLength int `json:"context_length"` + Pricing struct { + Prompt string `json:"prompt"` + Completion string `json:"completion"` + InputCacheRead string `json:"input_cache_read"` + } `json:"pricing"` +} + +// parsePrice turns a catalog price string into a per-token float. Empty, +// unparsable and negative ("-1" = variable, used by the auto routers) all +// mean unknown. +func parsePrice(s string) *float64 { + s = strings.TrimSpace(s) + if s == "" { + return nil + } + v, err := strconv.ParseFloat(s, 64) + if err != nil || v < 0 { + return nil + } + return &v +} + +// ParseModels decodes an OpenRouter /models body. Items with an empty id are +// skipped; unknown fields are ignored. Order is preserved. +func ParseModels(r io.Reader) ([]Model, error) { + var out struct { + Data []rawModel `json:"data"` + } + if err := json.NewDecoder(io.LimitReader(r, maxCatalogBody)).Decode(&out); err != nil { + return nil, fmt.Errorf("decode models: %w", err) + } + models := make([]Model, 0, len(out.Data)) + for _, m := range out.Data { + id := strings.TrimSpace(m.ID) + if id == "" { + continue + } + models = append(models, Model{ + ID: id, + Name: m.Name, + ContextLength: m.ContextLength, + Pricing: Pricing{ + Prompt: parsePrice(m.Pricing.Prompt), + Completion: parsePrice(m.Pricing.Completion), + InputCacheRead: parsePrice(m.Pricing.InputCacheRead), + }, + }) + } + return models, nil +} + +// FetchPublicModels GETs the public catalog (no key required) from BaseURL. +// It is uncached; most callers want CachedPublicModels. +func FetchPublicModels() ([]Model, error) { + req, err := http.NewRequest(http.MethodGet, BaseURL+"/models", nil) + if err != nil { + return nil, fmt.Errorf("build models request: %w", err) + } + client := &http.Client{Timeout: modelsListTimeout} + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("models request failed: %w", err) + } + defer func() { _ = resp.Body.Close() }() + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("openrouter /models returned HTTP %d", resp.StatusCode) + } + return ParseModels(resp.Body) +} + +// catalogCache holds the last good catalog per BaseURL. Keyed by URL so a +// test that points BaseURL at an httptest server never sees production data. +var catalogCache = struct { + sync.Mutex + entries map[string]catalogEntry +}{entries: map[string]catalogEntry{}} + +type catalogEntry struct { + models []Model + fetchedAt time.Time +} + +// catalogNow is the cache clock; tests may swap it. +var catalogNow = time.Now + +// CachedPublicModels returns the public catalog, re-fetching at most once per +// catalogCacheTTL. A failed refresh keeps serving the last good catalog (a +// transient outage must not blank the picker or the price table); with no +// good catalog yet it returns nil. +func CachedPublicModels() []Model { + key := BaseURL + catalogCache.Lock() + entry, ok := catalogCache.entries[key] + catalogCache.Unlock() + if ok && catalogNow().Sub(entry.fetchedAt) < catalogCacheTTL { + return entry.models + } + models, err := FetchPublicModels() + if err != nil || len(models) == 0 { + if ok { + return entry.models + } + return nil + } + catalogCache.Lock() + catalogCache.entries[key] = catalogEntry{models: models, fetchedAt: catalogNow()} + catalogCache.Unlock() + return models +} + +// ModelIDs projects a catalog onto its ids. +func ModelIDs(models []Model) []string { + ids := make([]string, 0, len(models)) + for _, m := range models { + ids = append(ids, m.ID) + } + return ids +} + +// AvailableSuggested returns the curated SuggestedModels that are present in +// the live catalog ids, in curated order. When live is empty the catalog could +// not be read, so nothing can be disproved and the full curated list is +// returned. A curated id OpenRouter has retired is therefore hidden instead of +// offered as a dead default. +func AvailableSuggested(live []string) []SuggestedModel { + if len(live) == 0 { + return append([]SuggestedModel(nil), SuggestedModels...) + } + present := make(map[string]bool, len(live)) + for _, id := range live { + present[id] = true + } + out := make([]SuggestedModel, 0, len(SuggestedModels)) + for _, m := range SuggestedModels { + if present[m.ID] { + out = append(out, m) + } + } + return out +} + +// AvailableDefault returns DefaultModel when the live catalog still lists it +// (or cannot be read), else the first available suggested model, else +// DefaultModel unchanged (a manual entry is still possible). +func AvailableDefault(live []string) string { + avail := AvailableSuggested(live) + for _, m := range avail { + if m.ID == DefaultModel { + return DefaultModel + } + } + if len(live) == 0 { + return DefaultModel + } + for _, id := range live { + if id == DefaultModel { + return DefaultModel + } + } + if len(avail) > 0 { + return avail[0].ID + } + return DefaultModel +} diff --git a/src/crux/openrouter/catalog_test.go b/src/crux/openrouter/catalog_test.go new file mode 100644 index 0000000000..1ac7a07bd6 --- /dev/null +++ b/src/crux/openrouter/catalog_test.go @@ -0,0 +1,160 @@ +package openrouter + +import ( + "net/http" + "net/http/httptest" + "os" + "sync/atomic" + "testing" + "time" +) + +// catalogFixture is a recorded, trimmed copy of the live public catalog +// (id, name, context_length, pricing only). Refresh it in the same PR that +// edits SuggestedModels or DefaultModel: +// +// curl -s https://openrouter.ai/api/v1/models | jq '{data: [.data[] | {id, name, context_length, pricing: (.pricing | {prompt, completion, input_cache_read} | with_entries(select(.value != null)))}] | sort_by(.id)}' > src/crux/openrouter/testdata/models.json +const catalogFixture = "testdata/models.json" + +func loadFixture(t *testing.T) []Model { + t.Helper() + f, err := os.Open(catalogFixture) + if err != nil { + t.Fatalf("open fixture: %v", err) + } + defer func() { _ = f.Close() }() + models, err := ParseModels(f) + if err != nil { + t.Fatalf("parse fixture: %v", err) + } + return models +} + +// Every curated id, and the default, must be a real OpenRouter id. A stale +// list (claude-3.5-sonnet, gemini-flash-1.5, …) shipped for months because +// nothing checked this. +func TestSuggestedModelsExistInCatalogFixture(t *testing.T) { + models := loadFixture(t) + if len(models) == 0 { + t.Fatal("fixture has no models") + } + ids := map[string]bool{} + for _, m := range models { + ids[m.ID] = true + } + if !ids[DefaultModel] { + t.Errorf("DefaultModel %q is not in %s", DefaultModel, catalogFixture) + } + seen := map[string]bool{} + for _, m := range SuggestedModels { + if !ids[m.ID] { + t.Errorf("suggested model %q is not in %s; refresh the fixture or fix the id", m.ID, catalogFixture) + } + if seen[m.ID] { + t.Errorf("suggested model %q listed twice", m.ID) + } + seen[m.ID] = true + if m.Label == "" { + t.Errorf("suggested model %q has no label", m.ID) + } + } + if !seen[DefaultModel] { + t.Errorf("DefaultModel %q must be one of SuggestedModels", DefaultModel) + } +} + +func TestParseModelsPricing(t *testing.T) { + models := loadFixture(t) + var flash *Model + var auto *Model + for i := range models { + switch models[i].ID { + case "deepseek/deepseek-v4.1-flash": + flash = &models[i] + case "openrouter/auto": + auto = &models[i] + } + } + if flash == nil { + t.Fatal("deepseek/deepseek-v4.1-flash missing from fixture") + } + if !flash.Pricing.Known() || flash.Pricing.InputCacheRead == nil { + t.Fatalf("flash pricing not parsed: %+v", flash.Pricing) + } + const wantInPerM, wantOutPerM, eps = 0.14, 0.42, 1e-9 + if got := *PerMillion(flash.Pricing.Prompt); got < wantInPerM-eps || got > wantInPerM+eps { + t.Errorf("input $/M = %v, want %v", got, wantInPerM) + } + if got := *PerMillion(flash.Pricing.Completion); got < wantOutPerM-eps || got > wantOutPerM+eps { + t.Errorf("output $/M = %v, want %v", got, wantOutPerM) + } + if flash.ContextLength <= 0 { + t.Errorf("context_length not parsed") + } + // The auto router publishes "-1" (variable): unknown, never a negative price. + if auto != nil && auto.Pricing.Known() { + t.Errorf("openrouter/auto must have unknown pricing, got %+v", auto.Pricing) + } + if PerMillion(nil) != nil { + t.Error("PerMillion(nil) must be nil") + } +} + +func TestAvailableSuggestedHidesRetiredIDs(t *testing.T) { + live := []string{"z-ai/glm-5.3", "anthropic/claude-sonnet-5.5"} + got := AvailableSuggested(live) + if len(got) != 2 || got[0].ID != "z-ai/glm-5.3" || got[1].ID != "anthropic/claude-sonnet-5.5" { + t.Fatalf("AvailableSuggested = %+v", got) + } + if all := AvailableSuggested(nil); len(all) != len(SuggestedModels) { + t.Fatalf("unreadable catalog must keep the full list, got %d", len(all)) + } + // Default retired: fall back to the first surviving suggestion. + if d := AvailableDefault(live); d != "z-ai/glm-5.3" { + t.Errorf("AvailableDefault = %q, want z-ai/glm-5.3", d) + } + if d := AvailableDefault(nil); d != DefaultModel { + t.Errorf("AvailableDefault(nil) = %q", d) + } + if d := AvailableDefault([]string{DefaultModel}); d != DefaultModel { + t.Errorf("AvailableDefault(with default) = %q", d) + } + if d := AvailableDefault([]string{"x/y"}); d != DefaultModel { + t.Errorf("AvailableDefault(no suggestions survive) = %q, want unchanged default", d) + } +} + +func TestCachedPublicModelsReusesAndSurvivesFailure(t *testing.T) { + var hits atomic.Int32 + var fail atomic.Bool + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + hits.Add(1) + if fail.Load() { + http.Error(w, "down", http.StatusBadGateway) + return + } + _, _ = w.Write([]byte(`{"data":[{"id":"a/b","context_length":8,"pricing":{"prompt":"0.000001","completion":"0.000002"}}]}`)) + })) + defer srv.Close() + withURLs(t, srv.URL, KeyExchangeURL, KeyInfoURL) + now := time.Date(2026, 11, 16, 0, 0, 0, 0, time.UTC) + prevNow := catalogNow + catalogNow = func() time.Time { return now } + t.Cleanup(func() { catalogNow = prevNow }) + + if m := CachedPublicModels(); len(m) != 1 || m[0].ID != "a/b" { + t.Fatalf("first fetch = %+v", m) + } + _ = CachedPublicModels() + if hits.Load() != 1 { + t.Fatalf("cache not reused: %d hits", hits.Load()) + } + now = now.Add(catalogCacheTTL + time.Second) + fail.Store(true) + if m := CachedPublicModels(); len(m) != 1 { + t.Fatalf("failed refresh must keep last good catalog, got %+v", m) + } + if hits.Load() != 2 { + t.Fatalf("expired entry not refetched: %d hits", hits.Load()) + } +} diff --git a/src/crux/openrouter/openrouter.go b/src/crux/openrouter/openrouter.go index 92a73902f5..8f815a1a6a 100644 --- a/src/crux/openrouter/openrouter.go +++ b/src/crux/openrouter/openrouter.go @@ -83,9 +83,12 @@ const ( ) // DefaultModel is the gateway default_model used when the sponsor picks none. -// A cheap, widely-available model so a freshly-funded hive works out of the box -// without spending on a premium model by accident. -const DefaultModel = "deepseek/deepseek-chat" +// DeepSeek V4.1 Flash: the cheapest capable model once prompt caching kicks in +// (Nov 2026: $0.14/M input, $0.0042/M cache read, $0.42/M output), so a +// freshly-funded hive works out of the box without spending on a premium model +// by accident. TestSuggestedModelsExistInCatalogFixture pins it to the +// recorded catalog. +const DefaultModel = "deepseek/deepseek-v4.1-flash" // SuggestedModel is one curated option offered on the funding screen: an id and // a short human label. The list is a starting point — the UI also fetches the @@ -95,16 +98,17 @@ type SuggestedModel struct { Label string `json:"label"` } -// SuggestedModels is the curated short list shown on the funding screen. It -// spans a premium option (Claude Opus) and cheaper ones (DeepSeek, Llama), so a -// sponsor can pick a sensible default without fetching the full catalog. IDs are -// OpenRouter model ids. +// SuggestedModels is the curated short list shown on the funding screen and at +// the top of the gateway model picker. Deliberately short and opinionated, with +// honest labels; every id must exist in testdata/models.json (a recorded copy +// of the live catalog, refreshed in the same PR that edits this list), and the +// handlers hide any entry the LIVE catalog no longer lists (AvailableSuggested). var SuggestedModels = []SuggestedModel{ - {ID: "anthropic/claude-opus-4.8", Label: "Claude Opus 4.8 (premium)"}, - {ID: "anthropic/claude-3.5-sonnet", Label: "Claude 3.5 Sonnet"}, - {ID: "deepseek/deepseek-chat", Label: "DeepSeek Chat (cheap)"}, - {ID: "meta-llama/llama-3.3-70b-instruct", Label: "Llama 3.3 70B (cheap)"}, - {ID: "google/gemini-flash-1.5", Label: "Gemini Flash 1.5 (cheap)"}, + {ID: "deepseek/deepseek-v4.1-flash", Label: "DeepSeek V4.1 Flash (default, cheapest with caching)"}, + {ID: "z-ai/glm-5.3", Label: "GLM-5.3 (strong, cheap)"}, + {ID: "z-ai/glm-5.3-flash", Label: "GLM-5.3 Flash (cheapest)"}, + {ID: "anthropic/claude-sonnet-5.5", Label: "Claude Sonnet 5.5 (premium)"}, + {ID: "google/gemini-3.8-flash", Label: "Gemini 3.8 Flash (fast, mid-price)"}, } // GeneratePKCE creates a random code_verifier and its S256 code_challenge. @@ -251,43 +255,16 @@ func FetchCredit(key string) (*Credit, error) { return &out.Data, nil } -// modelsListTimeout bounds the public /v1/models fetch used by the funding -// picker. Kept short — it's a best-effort enrichment, not on the critical path. -const modelsListTimeout = 5 * time.Second - // PublicModelIDs best-effort fetches OpenRouter's public model catalog (no key // required) and returns the list of model ids. On any failure it returns nil, so -// callers fall back to the curated SuggestedModels + manual entry. The response -// is the standard OpenAI-style {data:[{id}]} shape. +// callers fall back to the curated SuggestedModels + manual entry. Uncached; +// see CachedPublicModels for the cached, priced catalog. func PublicModelIDs() []string { - req, err := http.NewRequest(http.MethodGet, BaseURL+"/models", nil) - if err != nil { - return nil - } - client := &http.Client{Timeout: modelsListTimeout} - resp, err := client.Do(req) + models, err := FetchPublicModels() if err != nil { return nil } - defer func() { _ = resp.Body.Close() }() - if resp.StatusCode != http.StatusOK { - return nil - } - var out struct { - Data []struct { - ID string `json:"id"` - } `json:"data"` - } - if err := json.NewDecoder(io.LimitReader(resp.Body, 1<<20)).Decode(&out); err != nil { - return nil - } - ids := make([]string, 0, len(out.Data)) - for _, m := range out.Data { - if m.ID != "" { - ids = append(ids, m.ID) - } - } - return ids + return ModelIDs(models) } // QRPNG returns a scannable QR code PNG encoding the given text (an authorize diff --git a/src/crux/openrouter/testdata/models.json b/src/crux/openrouter/testdata/models.json new file mode 100644 index 0000000000..b8be6a75e0 --- /dev/null +++ b/src/crux/openrouter/testdata/models.json @@ -0,0 +1,4560 @@ +{ + "data": [ + { + "id": "aion-labs/aion-2.0", + "name": "AionLabs: Aion-2.0", + "context_length": 131072, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000016", + "input_cache_read": "0.0000002" + } + }, + { + "id": "aion-labs/aion-3.0", + "name": "AionLabs: Aion-3.0", + "context_length": 131072, + "pricing": { + "prompt": "0.000003", + "completion": "0.000006", + "input_cache_read": "0.00000075" + } + }, + { + "id": "aion-labs/aion-3.0-mini", + "name": "AionLabs: Aion-3.0-Mini", + "context_length": 131072, + "pricing": { + "prompt": "0.0000007", + "completion": "0.0000014", + "input_cache_read": "0.00000018" + } + }, + { + "id": "aion-labs/aion-3.5", + "name": "AionLabs: Aion 3.5", + "context_length": 262144, + "pricing": { + "prompt": "0.000003", + "completion": "0.000006", + "input_cache_read": "0.00000075" + } + }, + { + "id": "aion-labs/aion-3.5-mini", + "name": "AionLabs: Aion 3.5 Mini", + "context_length": 262144, + "pricing": { + "prompt": "0.0000007", + "completion": "0.0000014", + "input_cache_read": "0.00000018" + } + }, + { + "id": "aion-labs/aion-rp-llama-3.1-8b", + "name": "AionLabs: Aion-RP 1.0 (8B)", + "context_length": 32768, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000016" + } + }, + { + "id": "amazon/nova-2-lite-v1", + "name": "Amazon: Nova 2 Lite", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000025" + } + }, + { + "id": "amazon/nova-lite-v1", + "name": "Amazon: Nova Lite 1.0", + "context_length": 300000, + "pricing": { + "prompt": "0.00000006", + "completion": "0.00000024" + } + }, + { + "id": "amazon/nova-micro-v1", + "name": "Amazon: Nova Micro 1.0", + "context_length": 128000, + "pricing": { + "prompt": "0.000000035", + "completion": "0.00000014" + } + }, + { + "id": "amazon/nova-premier-v1", + "name": "Amazon: Nova Premier 1.0", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000125", + "input_cache_read": "0.000000625" + } + }, + { + "id": "amazon/nova-pro-v1", + "name": "Amazon: Nova Pro 1.0", + "context_length": 300000, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000032" + } + }, + { + "id": "anthracite-org/magnum-v4-72b", + "name": "Magnum v4 72B", + "context_length": 32768, + "pricing": { + "prompt": "0.0000025", + "completion": "0.000005", + "input_cache_read": "0.0000025" + } + }, + { + "id": "anthropic/claude-fable-5", + "name": "Anthropic: Claude Fable 5", + "context_length": 1000000, + "pricing": { + "prompt": "0.00001", + "completion": "0.00005", + "input_cache_read": "0.000001" + } + }, + { + "id": "anthropic/claude-fable-5.1", + "name": "Anthropic: Claude Fable 5.1", + "context_length": 1000000, + "pricing": { + "prompt": "0.00001", + "completion": "0.00005", + "input_cache_read": "0.00000025" + } + }, + { + "id": "anthropic/claude-fable-5.1:batch", + "name": "Anthropic: Claude Fable 5.1 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.000000125" + } + }, + { + "id": "anthropic/claude-fable-5.2", + "name": "Anthropic: Claude Fable 5.2", + "context_length": 1000000, + "pricing": { + "prompt": "0.000008", + "completion": "0.00004", + "input_cache_read": "0.0000002" + } + }, + { + "id": "anthropic/claude-fable-5.2:batch", + "name": "Anthropic: Claude Fable 5.2 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000004", + "completion": "0.00002", + "input_cache_read": "0.0000001" + } + }, + { + "id": "anthropic/claude-fable-5:batch", + "name": "Anthropic: Claude Fable 5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "anthropic/claude-haiku-4.5", + "name": "Anthropic: Claude Haiku 4.5", + "context_length": 200000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.0000001" + } + }, + { + "id": "anthropic/claude-haiku-4.5:batch", + "name": "Anthropic: Claude Haiku 4.5 (batch)", + "context_length": 200000, + "pricing": { + "prompt": "0.0000005", + "completion": "0.0000025", + "input_cache_read": "0.00000005" + } + }, + { + "id": "anthropic/claude-haiku-5.5", + "name": "Anthropic: Claude Haiku 5.5", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000005", + "input_cache_read": "0.00000001" + } + }, + { + "id": "anthropic/claude-haiku-5.5:batch", + "name": "Anthropic: Claude Haiku 5.5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000025", + "input_cache_read": "0.000000005" + } + }, + { + "id": "anthropic/claude-opus-4.1", + "name": "Anthropic: Claude Opus 4.1", + "context_length": 200000, + "pricing": { + "prompt": "0.000015", + "completion": "0.000075", + "input_cache_read": "0.0000015" + } + }, + { + "id": "anthropic/claude-opus-4.1:batch", + "name": "Anthropic: Claude Opus 4.1 (batch)", + "context_length": 200000, + "pricing": { + "prompt": "0.0000075", + "completion": "0.0000375", + "input_cache_read": "0.00000075" + } + }, + { + "id": "anthropic/claude-opus-4.5", + "name": "Anthropic: Claude Opus 4.5", + "context_length": 200000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "anthropic/claude-opus-4.5:batch", + "name": "Anthropic: Claude Opus 4.5 (batch)", + "context_length": 200000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000125", + "input_cache_read": "0.00000025" + } + }, + { + "id": "anthropic/claude-opus-4.6", + "name": "Anthropic: Claude Opus 4.6", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "anthropic/claude-opus-4.6:batch", + "name": "Anthropic: Claude Opus 4.6 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000125", + "input_cache_read": "0.00000025" + } + }, + { + "id": "anthropic/claude-opus-4.7", + "name": "Anthropic: Claude Opus 4.7", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "anthropic/claude-opus-4.7:batch", + "name": "Anthropic: Claude Opus 4.7 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000125", + "input_cache_read": "0.00000025" + } + }, + { + "id": "anthropic/claude-opus-4.8", + "name": "Anthropic: Claude Opus 4.8", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "anthropic/claude-opus-4.8:batch", + "name": "Anthropic: Claude Opus 4.8 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000125", + "input_cache_read": "0.00000025" + } + }, + { + "id": "anthropic/claude-opus-5", + "name": "Anthropic: Claude Opus 5", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "anthropic/claude-opus-5.5", + "name": "Anthropic: Claude Opus 5.5", + "context_length": 1000000, + "pricing": { + "prompt": "0.000004", + "completion": "0.00002", + "input_cache_read": "0.0000002" + } + }, + { + "id": "anthropic/claude-opus-5.5:batch", + "name": "Anthropic: Claude Opus 5.5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "anthropic/claude-opus-5:batch", + "name": "Anthropic: Claude Opus 5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000125", + "input_cache_read": "0.00000025" + } + }, + { + "id": "anthropic/claude-sonnet-4.5", + "name": "Anthropic: Claude Sonnet 4.5", + "context_length": 1000000, + "pricing": { + "prompt": "0.000003", + "completion": "0.000015", + "input_cache_read": "0.0000003" + } + }, + { + "id": "anthropic/claude-sonnet-4.5:batch", + "name": "Anthropic: Claude Sonnet 4.5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000075", + "input_cache_read": "0.00000015" + } + }, + { + "id": "anthropic/claude-sonnet-4.6", + "name": "Anthropic: Claude Sonnet 4.6", + "context_length": 1000000, + "pricing": { + "prompt": "0.000003", + "completion": "0.000015", + "input_cache_read": "0.0000003" + } + }, + { + "id": "anthropic/claude-sonnet-4.6:batch", + "name": "Anthropic: Claude Sonnet 4.6 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000075", + "input_cache_read": "0.00000015" + } + }, + { + "id": "anthropic/claude-sonnet-5", + "name": "Anthropic: Claude Sonnet 5", + "context_length": 1000000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000002" + } + }, + { + "id": "anthropic/claude-sonnet-5.5", + "name": "Anthropic: Claude Sonnet 5.5", + "context_length": 1000000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "anthropic/claude-sonnet-5.5:batch", + "name": "Anthropic: Claude Sonnet 5.5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "anthropic/claude-sonnet-5:batch", + "name": "Anthropic: Claude Sonnet 5 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.0000001" + } + }, + { + "id": "baidu/ernie-5.5-flash-preview:free", + "name": "Baidu: ERNIE-5.5-Flash-Preview (free)", + "context_length": 1024000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "baidu/ernie-light-dt-1.0-intl", + "name": "Baidu: ERNIE-Light-DT-1.0", + "context_length": 1024000, + "pricing": { + "prompt": "0.00000113", + "completion": "0.00000394", + "input_cache_read": "0.000000113" + } + }, + { + "id": "bytedance-seed/seed-2-1-turbo", + "name": "ByteDance Seed: Seed 2.1 Turbo", + "context_length": 262144, + "pricing": { + "prompt": "0.0000005", + "completion": "0.0000025" + } + }, + { + "id": "bytedance-seed/seed-2.0-lite", + "name": "ByteDance Seed: Seed-2.0-Lite", + "context_length": 262144, + "pricing": { + "prompt": "0.00000025", + "completion": "0.000002" + } + }, + { + "id": "bytedance-seed/seed-2.0-mini", + "name": "ByteDance Seed: Seed-2.0-Mini", + "context_length": 262144, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000004" + } + }, + { + "id": "bytedance/ui-tars-1.5-7b", + "name": "ByteDance: UI-TARS 7B ", + "context_length": 128000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000002", + "input_cache_read": "0.0000001" + } + }, + { + "id": "cognitivecomputations/dolphin-mistral-24b-venice-edition", + "name": "Venice: Uncensored", + "context_length": 128000, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000009" + } + }, + { + "id": "cohere/command-a", + "name": "Cohere: Command A", + "context_length": 256000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.00001" + } + }, + { + "id": "cohere/command-a-plus", + "name": "Cohere: Command A+", + "context_length": 192000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000015", + "input_cache_read": "0.00000015" + } + }, + { + "id": "cohere/command-r-08-2024", + "name": "Cohere: Command R (08-2024)", + "context_length": 128000, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006" + } + }, + { + "id": "cohere/command-r-plus-08-2024", + "name": "Cohere: Command R+ (08-2024)", + "context_length": 128000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.00001" + } + }, + { + "id": "cohere/command-r7b-12-2024", + "name": "Cohere: Command R7B (12-2024)", + "context_length": 128000, + "pricing": { + "prompt": "0.0000000375", + "completion": "0.00000015" + } + }, + { + "id": "cohere/north-mini-code:free", + "name": "Cohere: North Mini Code (free)", + "context_length": 256000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "deepseek/deepseek-chat", + "name": "DeepSeek: DeepSeek V3", + "context_length": 163840, + "pricing": { + "prompt": "0.0000002574", + "completion": "0.0000010287" + } + }, + { + "id": "deepseek/deepseek-chat-v3-0324", + "name": "DeepSeek: DeepSeek V3 0324", + "context_length": 163840, + "pricing": { + "prompt": "0.00000029", + "completion": "0.00000114", + "input_cache_read": "0.00000011" + } + }, + { + "id": "deepseek/deepseek-chat-v3.1", + "name": "DeepSeek: DeepSeek V3.1", + "context_length": 163840, + "pricing": { + "prompt": "0.00000025", + "completion": "0.00000095", + "input_cache_read": "0.00000013" + } + }, + { + "id": "deepseek/deepseek-r1-0528", + "name": "DeepSeek: R1 0528", + "context_length": 163840, + "pricing": { + "prompt": "0.0000005", + "completion": "0.00000215", + "input_cache_read": "0.00000035" + } + }, + { + "id": "deepseek/deepseek-v3.1-terminus", + "name": "DeepSeek: DeepSeek V3.1 Terminus", + "context_length": 163840, + "pricing": { + "prompt": "0.00000027", + "completion": "0.000001" + } + }, + { + "id": "deepseek/deepseek-v3.2", + "name": "DeepSeek: DeepSeek V3.2", + "context_length": 163840, + "pricing": { + "prompt": "0.00000026", + "completion": "0.00000038", + "input_cache_read": "0.00000013" + } + }, + { + "id": "deepseek/deepseek-v3.2-exp", + "name": "DeepSeek: DeepSeek V3.2 Exp", + "context_length": 163840, + "pricing": { + "prompt": "0.00000027", + "completion": "0.00000041" + } + }, + { + "id": "deepseek/deepseek-v4-flash", + "name": "DeepSeek: DeepSeek V4 Flash 0423", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000009", + "completion": "0.00000018", + "input_cache_read": "0.000000018" + } + }, + { + "id": "deepseek/deepseek-v4-flash-0731", + "name": "DeepSeek: DeepSeek V4 Flash 0731", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000006", + "completion": "0.00000018", + "input_cache_read": "0.000000015" + } + }, + { + "id": "deepseek/deepseek-v4-flash-0731:batch", + "name": "DeepSeek: DeepSeek V4 Flash 0731 (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000048", + "completion": "0.000000144", + "input_cache_read": "0.000000012" + } + }, + { + "id": "deepseek/deepseek-v4-flash-vision-exp", + "name": "DeepSeek: DeepSeek V4 Flash Vision Exp", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000044", + "completion": "0.00000132", + "input_cache_read": "0.000000014" + } + }, + { + "id": "deepseek/deepseek-v4-pro", + "name": "DeepSeek: DeepSeek V4 Pro 0423", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000009", + "completion": "0.0000015", + "input_cache_read": "0.00000025" + } + }, + { + "id": "deepseek/deepseek-v4-pro-0813", + "name": "DeepSeek: DeepSeek V4 Pro 0813", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000111", + "completion": "0.00000444", + "input_cache_read": "0.000000097" + } + }, + { + "id": "deepseek/deepseek-v4.1-flash", + "name": "DeepSeek: DeepSeek V4.1 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000014", + "completion": "0.00000042", + "input_cache_read": "0.0000000042" + } + }, + { + "id": "deepseek/deepseek-v4.1-flash-1017", + "name": "DeepSeek: DeepSeek V4.1 Flash 1017", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006", + "input_cache_read": "0.000000003" + } + }, + { + "id": "deepseek/deepseek-v4.1-flash-1017:batch", + "name": "DeepSeek: DeepSeek V4.1 Flash 1017 (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000035", + "completion": "0.00000031", + "input_cache_read": "0.000000003" + } + }, + { + "id": "deepseek/deepseek-v4.1-flash:batch", + "name": "DeepSeek: DeepSeek V4.1 Flash (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000112", + "completion": "0.000000336", + "input_cache_read": "0.00000000336" + } + }, + { + "id": "dots-studio/dots-3-note-preview:free", + "name": "Dots Studio: Dots3-Note Preview (free)", + "context_length": 512000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "elorian/glimpse", + "name": "Elorian: Glimpse", + "context_length": 262144, + "pricing": { + "prompt": "0.0000006", + "completion": "0.000003", + "input_cache_read": "0.00000006" + } + }, + { + "id": "fireworks/ember-1", + "name": "Fireworks: Ember-1", + "context_length": 1048576, + "pricing": { + "prompt": "0.000003", + "completion": "0.000015", + "input_cache_read": "0.0000003" + } + }, + { + "id": "google/gemini-2.5-flash", + "name": "Google: Gemini 2.5 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000025", + "input_cache_read": "0.00000003" + } + }, + { + "id": "google/gemini-2.5-flash-image", + "name": "Google: Nano Banana (Gemini 2.5 Flash Image)", + "context_length": 32768, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000025", + "input_cache_read": "0.00000003" + } + }, + { + "id": "google/gemini-2.5-flash-lite", + "name": "Google: Gemini 2.5 Flash Lite", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000004", + "input_cache_read": "0.00000001" + } + }, + { + "id": "google/gemini-2.5-pro", + "name": "Google: Gemini 2.5 Pro", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00001", + "input_cache_read": "0.000000125" + } + }, + { + "id": "google/gemini-2.5-pro-preview", + "name": "Google: Gemini 2.5 Pro Preview 06-05", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00001", + "input_cache_read": "0.000000125" + } + }, + { + "id": "google/gemini-3-flash-preview", + "name": "Google: Gemini 3 Flash Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000005", + "completion": "0.000003", + "input_cache_read": "0.00000005" + } + }, + { + "id": "google/gemini-3-flash-preview:batch", + "name": "Google: Gemini 3 Flash Preview (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000025", + "completion": "0.0000015" + } + }, + { + "id": "google/gemini-3-pro-image", + "name": "Google: Nano Banana Pro (Gemini 3 Pro Image)", + "context_length": 131072, + "pricing": { + "prompt": "0.000002", + "completion": "0.000012", + "input_cache_read": "0.0000002" + } + }, + { + "id": "google/gemini-3-pro-image-preview", + "name": "Google: Nano Banana Pro (Gemini 3 Pro Image Preview)", + "context_length": 65536, + "pricing": { + "prompt": "0.000002", + "completion": "0.000012", + "input_cache_read": "0.0000002" + } + }, + { + "id": "google/gemini-3.1-flash-image", + "name": "Google: Nano Banana 2 (Gemini 3.1 Flash Image)", + "context_length": 131072, + "pricing": { + "prompt": "0.0000005", + "completion": "0.000003" + } + }, + { + "id": "google/gemini-3.1-flash-image-preview", + "name": "Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)", + "context_length": 65536, + "pricing": { + "prompt": "0.0000005", + "completion": "0.000003" + } + }, + { + "id": "google/gemini-3.1-flash-lite", + "name": "Google: Gemini 3.1 Flash Lite", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000025", + "completion": "0.0000015", + "input_cache_read": "0.000000025" + } + }, + { + "id": "google/gemini-3.1-flash-lite-image", + "name": "Google: Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)", + "context_length": 65536, + "pricing": { + "prompt": "0.00000025", + "completion": "0.0000015" + } + }, + { + "id": "google/gemini-3.1-flash-lite-preview", + "name": "Google: Gemini 3.1 Flash Lite Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000025", + "completion": "0.0000015", + "input_cache_read": "0.000000025" + } + }, + { + "id": "google/gemini-3.1-flash-lite:batch", + "name": "Google: Gemini 3.1 Flash Lite (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000125", + "completion": "0.00000075", + "input_cache_read": "0.0000000125" + } + }, + { + "id": "google/gemini-3.1-pro-preview", + "name": "Google: Gemini 3.1 Pro Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0.000002", + "completion": "0.000012", + "input_cache_read": "0.0000002" + } + }, + { + "id": "google/gemini-3.1-pro-preview-customtools", + "name": "Google: Gemini 3.1 Pro Preview Custom Tools", + "context_length": 1048576, + "pricing": { + "prompt": "0.000002", + "completion": "0.000012", + "input_cache_read": "0.0000002" + } + }, + { + "id": "google/gemini-3.1-pro-preview:batch", + "name": "Google: Gemini 3.1 Pro Preview (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000001", + "completion": "0.000006" + } + }, + { + "id": "google/gemini-3.5-flash", + "name": "Google: Gemini 3.5 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000015", + "completion": "0.000009", + "input_cache_read": "0.00000015" + } + }, + { + "id": "google/gemini-3.5-flash-lite", + "name": "Google: Gemini 3.5 Flash Lite", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000025", + "input_cache_read": "0.00000003" + } + }, + { + "id": "google/gemini-3.5-flash-lite:batch", + "name": "Google: Gemini 3.5 Flash Lite (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000015", + "completion": "0.00000125", + "input_cache_read": "0.000000015" + } + }, + { + "id": "google/gemini-3.5-flash:batch", + "name": "Google: Gemini 3.5 Flash (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000075", + "completion": "0.0000045", + "input_cache_read": "0.000000075" + } + }, + { + "id": "google/gemini-3.6-flash", + "name": "Google: Gemini 3.6 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000075", + "completion": "0.00000375", + "input_cache_read": "0.000000075" + } + }, + { + "id": "google/gemini-3.6-flash:batch", + "name": "Google: Gemini 3.6 Flash (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000375", + "completion": "0.000001875", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "google/gemini-3.7-flash", + "name": "Google: Gemini 3.7 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000075", + "completion": "0.00000375", + "input_cache_read": "0.000000075" + } + }, + { + "id": "google/gemini-3.7-flash:batch", + "name": "Google: Gemini 3.7 Flash (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000375", + "completion": "0.000001875", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "google/gemini-3.8-flash", + "name": "Google: Gemini 3.8 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000825", + "completion": "0.000004125", + "input_cache_read": "0.0000000825" + } + }, + { + "id": "google/gemini-3.8-flash:batch", + "name": "Google: Gemini 3.8 Flash (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000375", + "completion": "0.000001875", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "google/gemini-4-argon", + "name": "Google: Gemini 4 Argon", + "context_length": 1048576, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "google/gemini-4-argon:batch", + "name": "Google: Gemini 4 Argon (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "google/gemini-4-carbon", + "name": "Google: Gemini 4 Carbon", + "context_length": 1048576, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "google/gemini-4-carbon:batch", + "name": "Google: Gemini 4 Carbon (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "google/gemini-4-hydrogen", + "name": "Google: Gemini 4 Hydrogen", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000075", + "input_cache_read": "0.000000075" + } + }, + { + "id": "google/gemini-4-hydrogen:batch", + "name": "Google: Gemini 4 Hydrogen (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000075", + "completion": "0.00000375", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "google/gemini-nano-banana-2.1", + "name": "Google: Nano Banana 2.1", + "context_length": 65536, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000075" + } + }, + { + "id": "google/gemini-omni-1.1-flash", + "name": "Google: Gemini Omni 1.1 Flash", + "context_length": 131072, + "pricing": { + "prompt": "0.0000015", + "completion": "0.000009" + } + }, + { + "id": "google/gemini-omni-1.2-flash", + "name": "Google: Gemini Omni 1.2 Flash", + "context_length": 131072, + "pricing": { + "prompt": "0.0000015", + "completion": "0.000009" + } + }, + { + "id": "google/gemma-2-27b-it", + "name": "Google: Gemma 2 27B", + "context_length": 8192, + "pricing": { + "prompt": "0.00000065", + "completion": "0.00000065" + } + }, + { + "id": "google/gemma-3-12b-it", + "name": "Google: Gemma 3 12B", + "context_length": 131072, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000015" + } + }, + { + "id": "google/gemma-3-27b-it", + "name": "Google: Gemma 3 27B", + "context_length": 131072, + "pricing": { + "prompt": "0.00000008", + "completion": "0.00000035", + "input_cache_read": "0.00000004" + } + }, + { + "id": "google/gemma-3-4b-it", + "name": "Google: Gemma 3 4B", + "context_length": 131072, + "pricing": { + "prompt": "0.00000005", + "completion": "0.0000001" + } + }, + { + "id": "google/gemma-4-26b-a4b-it", + "name": "Google: Gemma 4 26B A4B ", + "context_length": 262144, + "pricing": { + "prompt": "0.00000009", + "completion": "0.0000003", + "input_cache_read": "0.00000005" + } + }, + { + "id": "google/gemma-4-26b-a4b-it:free", + "name": "Google: Gemma 4 26B A4B (free)", + "context_length": 262144, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "google/gemma-4-31b-it", + "name": "Google: Gemma 4 31B", + "context_length": 262144, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000004" + } + }, + { + "id": "google/gemma-4-31b-it:free", + "name": "Google: Gemma 4 31B (free)", + "context_length": 262144, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "google/lyria-3-clip-preview", + "name": "Google: Lyria 3 Clip Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "google/lyria-3-pro-preview", + "name": "Google: Lyria 3 Pro Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "gryphe/mythomax-l2-13b", + "name": "MythoMax 13B", + "context_length": 8192, + "pricing": { + "prompt": "0.00000008", + "completion": "0.00000011" + } + }, + { + "id": "ibm-granite/granite-4.2-8b", + "name": "IBM: Granite 4.2 8B", + "context_length": 131072, + "pricing": { + "prompt": "0.00000006", + "completion": "0.00000015", + "input_cache_read": "0.000000015" + } + }, + { + "id": "inclusionai/ling-3.0-flash", + "name": "inclusionAI: Ling 3.0 Flash", + "context_length": 262144, + "pricing": { + "prompt": "0.000000021", + "completion": "0.000000063", + "input_cache_read": "0.0000000042" + } + }, + { + "id": "inclusionai/ling-3.0-flash-vl", + "name": "inclusionAI: Ling 3.0 Flash VL", + "context_length": 131072, + "pricing": { + "prompt": "0.00000006", + "completion": "0.00000018", + "input_cache_read": "0.000000012" + } + }, + { + "id": "inclusionai/ling-3.0-tiny", + "name": "inclusionAI: Ling 3.0 Tiny", + "context_length": 262144, + "pricing": { + "prompt": "0.000000015", + "completion": "0.000000045", + "input_cache_read": "0.000000003" + } + }, + { + "id": "inclusionai/ling-3.1-flash", + "name": "inclusionAI: Ling 3.1 Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.000000045", + "completion": "0.000000135", + "input_cache_read": "0.000000009" + } + }, + { + "id": "inclusionai/ling-3.2-flash:free", + "name": "inclusionAI: Ling 3.2 Flash (free)", + "context_length": 1048576, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "inference-net/schematron-v2-small", + "name": "Inference.net: Schematron V2 Small", + "context_length": 128000, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000023", + "input_cache_read": "0.00000005" + } + }, + { + "id": "inference-net/schematron-v2-turbo", + "name": "Inference.net: Schematron V2 Turbo", + "context_length": 128000, + "pricing": { + "prompt": "0.00000003", + "completion": "0.00000015", + "input_cache_read": "0.00000003" + } + }, + { + "id": "kt/midm-k-3.0-pro", + "name": "KT: Mi:dm K 3.0 Pro", + "context_length": 261795, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000008", + "input_cache_read": "0.00000004" + } + }, + { + "id": "liquid/lfm-2.5-24b-a2b", + "name": "LiquidAI: LFM2.5-24B-A2B", + "context_length": 128000, + "pricing": { + "prompt": "0.00000005", + "completion": "0.0000007", + "input_cache_read": "0.000000025" + } + }, + { + "id": "liquid/lfm-3-1.7b", + "name": "LiquidAI: LFM3-1.7B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000008", + "completion": "0.0000002", + "input_cache_read": "0.00000002" + } + }, + { + "id": "liquid/lfm-3-1.7b:free", + "name": "LiquidAI: LFM3-1.7B (free)", + "context_length": 262144, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "mancer/weaver", + "name": "Mancer: Weaver (alpha)", + "context_length": 8000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000005", + "input_cache_read": "0.0000003" + } + }, + { + "id": "meituan/longcat-2.0", + "name": "Meituan: LongCat 2.0", + "context_length": 1048756, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000012", + "input_cache_read": "0.000000006" + } + }, + { + "id": "meta-llama/llama-3.1-70b-instruct", + "name": "Meta: Llama 3.1 70B Instruct", + "context_length": 131072, + "pricing": { + "prompt": "0.00000072", + "completion": "0.00000072" + } + }, + { + "id": "meta-llama/llama-3.1-8b-instruct", + "name": "Meta: Llama 3.1 8B Instruct", + "context_length": 131072, + "pricing": { + "prompt": "0.00000002", + "completion": "0.00000004" + } + }, + { + "id": "meta-llama/llama-3.2-1b-instruct", + "name": "Meta: Llama 3.2 1B Instruct", + "context_length": 60000, + "pricing": { + "prompt": "0.000000027", + "completion": "0.000000201" + } + }, + { + "id": "meta-llama/llama-3.2-3b-instruct", + "name": "Meta: Llama 3.2 3B Instruct", + "context_length": 131072, + "pricing": { + "prompt": "0.0000000509", + "completion": "0.000000335" + } + }, + { + "id": "meta-llama/llama-3.3-70b-instruct", + "name": "Meta: Llama 3.3 70B Instruct", + "context_length": 131072, + "pricing": { + "prompt": "0.00000071", + "completion": "0.00000071", + "input_cache_read": "0.00000071" + } + }, + { + "id": "meta-llama/llama-4-maverick", + "name": "Meta: Llama 4 Maverick", + "context_length": 524288, + "pricing": { + "prompt": "0.00000035", + "completion": "0.000001", + "input_cache_read": "0.00000017" + } + }, + { + "id": "meta-llama/llama-4-scout", + "name": "Meta: Llama 4 Scout", + "context_length": 1310720, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000003" + } + }, + { + "id": "meta-llama/llama-guard-4-12b", + "name": "Meta: Llama Guard 4 12B", + "context_length": 163840, + "pricing": { + "prompt": "0.00000018", + "completion": "0.00000018" + } + }, + { + "id": "meta/muse-ember", + "name": "Meta: Muse Ember", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000005", + "input_cache_read": "0.000000004" + } + }, + { + "id": "meta/muse-glimmer-30b", + "name": "Meta: Muse Glimmer 30B", + "context_length": 131072, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000012", + "input_cache_read": "0.00000004" + } + }, + { + "id": "meta/muse-glimmer-30b:batch", + "name": "Meta: Muse Glimmer 30B (batch)", + "context_length": 131072, + "pricing": { + "prompt": "0.00000024", + "completion": "0.00000096", + "input_cache_read": "0.000000032" + } + }, + { + "id": "meta/muse-spark-1.1", + "name": "Meta: Muse Spark 1.1", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00000425", + "input_cache_read": "0.00000015" + } + }, + { + "id": "meta/muse-spark-1.2", + "name": "Meta: Muse Spark 1.2", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00000425", + "input_cache_read": "0.00000015" + } + }, + { + "id": "meta/muse-spark-1.2-contributor", + "name": "Meta: Muse Spark 1.2 Contributor", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000002", + "input_cache_read": "0.000000002" + } + }, + { + "id": "meta/muse-spark-1.3", + "name": "Meta: Muse Spark 1.3", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00000425", + "input_cache_read": "0.00000015" + } + }, + { + "id": "meta/muse-spark-1.3-contributor", + "name": "Meta: Muse Spark 1.3 Contributor", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000002", + "input_cache_read": "0.000000002" + } + }, + { + "id": "meta/muse-spark-open", + "name": "Meta: Muse Spark Open", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00000425", + "input_cache_read": "0.00000015" + } + }, + { + "id": "meta/muse-wonder", + "name": "Meta: Muse Wonder", + "context_length": 1048576, + "pricing": { + "prompt": "0.000004", + "completion": "0.00002", + "input_cache_read": "0.0000002" + } + }, + { + "id": "microsoft/phi-4", + "name": "Microsoft: Phi 4", + "context_length": 16384, + "pricing": { + "prompt": "0.00000007", + "completion": "0.00000014" + } + }, + { + "id": "minimax/minimax-m2.5", + "name": "MiniMax: MiniMax M2.5", + "context_length": 198000, + "pricing": { + "prompt": "0.000000295", + "completion": "0.0000012", + "input_cache_read": "0.00000006" + } + }, + { + "id": "minimax/minimax-m2.7", + "name": "MiniMax: MiniMax M2.7", + "context_length": 196608, + "pricing": { + "prompt": "0.00000021", + "completion": "0.00000084", + "input_cache_read": "0.000000042" + } + }, + { + "id": "minimax/minimax-m3", + "name": "MiniMax: MiniMax M3", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000012", + "input_cache_read": "0.00000006" + } + }, + { + "id": "minimax/minimax-m3.1-flash", + "name": "MiniMax: MiniMax M3.1 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000075", + "completion": "0.0000003", + "input_cache_read": "0.0000000075" + } + }, + { + "id": "minimax/minimax-m3:batch", + "name": "MiniMax: MiniMax M3 (batch)", + "context_length": 524288, + "pricing": { + "prompt": "0.000000224", + "completion": "0.00000088", + "input_cache_read": "0.0000000448" + } + }, + { + "id": "mistralai/codestral-2508", + "name": "Mistral: Codestral 2508", + "context_length": 256000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000009", + "input_cache_read": "0.00000003" + } + }, + { + "id": "mistralai/devstral-2512", + "name": "Mistral: Devstral 2 2512", + "context_length": 262144, + "pricing": { + "prompt": "0.0000004", + "completion": "0.000002", + "input_cache_read": "0.00000004" + } + }, + { + "id": "mistralai/ministral-14b-2512", + "name": "Mistral: Ministral 3 14B 2512", + "context_length": 262144, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000002", + "input_cache_read": "0.00000002" + } + }, + { + "id": "mistralai/ministral-3b-2512", + "name": "Mistral: Ministral 3 3B 2512", + "context_length": 131072, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000001", + "input_cache_read": "0.00000001" + } + }, + { + "id": "mistralai/ministral-8b-2512", + "name": "Mistral: Ministral 3 8B 2512", + "context_length": 262144, + "pricing": { + "prompt": "0.00000015", + "completion": "0.00000015", + "input_cache_read": "0.000000015" + } + }, + { + "id": "mistralai/mistral-large", + "name": "Mistral Large", + "context_length": 128000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000002" + } + }, + { + "id": "mistralai/mistral-large-2407", + "name": "Mistral Large 2407", + "context_length": 131072, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000002" + } + }, + { + "id": "mistralai/mistral-large-2512", + "name": "Mistral: Mistral Large 3 2512", + "context_length": 262144, + "pricing": { + "prompt": "0.0000005", + "completion": "0.0000015", + "input_cache_read": "0.00000005" + } + }, + { + "id": "mistralai/mistral-large-4-0", + "name": "Mistral: Mistral Large 4", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000007", + "completion": "0.0000021", + "input_cache_read": "0.00000007" + } + }, + { + "id": "mistralai/mistral-medium-3", + "name": "Mistral: Mistral Medium 3", + "context_length": 131072, + "pricing": { + "prompt": "0.0000004", + "completion": "0.000002", + "input_cache_read": "0.00000004" + } + }, + { + "id": "mistralai/mistral-medium-3-5", + "name": "Mistral: Mistral Medium 3.5", + "context_length": 262144, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000075" + } + }, + { + "id": "mistralai/mistral-medium-3-5:batch", + "name": "Mistral: Mistral Medium 3.5 (batch)", + "context_length": 262144, + "pricing": { + "prompt": "0.00000075", + "completion": "0.00000375" + } + }, + { + "id": "mistralai/mistral-medium-3.1", + "name": "Mistral: Mistral Medium 3.1", + "context_length": 131072, + "pricing": { + "prompt": "0.0000004", + "completion": "0.000002", + "input_cache_read": "0.00000004" + } + }, + { + "id": "mistralai/mistral-nemo", + "name": "Mistral: Mistral Nemo", + "context_length": 131072, + "pricing": { + "prompt": "0.000000029", + "completion": "0.00000003" + } + }, + { + "id": "mistralai/mistral-saba", + "name": "Mistral: Saba", + "context_length": 32768, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000006", + "input_cache_read": "0.00000002" + } + }, + { + "id": "mistralai/mistral-small-24b-instruct-2501", + "name": "Mistral: Mistral Small 3", + "context_length": 32768, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000008" + } + }, + { + "id": "mistralai/mistral-small-2603", + "name": "Mistral: Mistral Small 4", + "context_length": 262144, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006", + "input_cache_read": "0.000000015" + } + }, + { + "id": "mistralai/mistral-small-3.1-24b-instruct", + "name": "Mistral: Mistral Small 3.1 24B", + "context_length": 128000, + "pricing": { + "prompt": "0.000000351", + "completion": "0.000000555" + } + }, + { + "id": "mistralai/mistral-small-3.2-24b-instruct", + "name": "Mistral: Mistral Small 3.2 24B", + "context_length": 256000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000003", + "input_cache_read": "0.00000001" + } + }, + { + "id": "mistralai/mixtral-8x22b-instruct", + "name": "Mistral: Mixtral 8x22B Instruct", + "context_length": 65536, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000002" + } + }, + { + "id": "mistralai/voxtral-small-24b-2507", + "name": "Mistral: Voxtral Small 24B 2507", + "context_length": 32768, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000003", + "input_cache_read": "0.00000001" + } + }, + { + "id": "moondream/moondream3-preview", + "name": "Moondream: Moondream 3 Preview", + "context_length": 32000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000025" + } + }, + { + "id": "moondream/moondream3.1-9b-a2b", + "name": "Moondream: Moondream 3.1", + "context_length": 32000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000025" + } + }, + { + "id": "moonshotai/kimi-k2", + "name": "MoonshotAI: Kimi K2 0711", + "context_length": 131072, + "pricing": { + "prompt": "0.00000057", + "completion": "0.0000023" + } + }, + { + "id": "moonshotai/kimi-k2-0905", + "name": "MoonshotAI: Kimi K2 0905", + "context_length": 262144, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000025" + } + }, + { + "id": "moonshotai/kimi-k2-thinking", + "name": "MoonshotAI: Kimi K2 Thinking", + "context_length": 262144, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000025", + "input_cache_read": "0.00000015" + } + }, + { + "id": "moonshotai/kimi-k2.5", + "name": "MoonshotAI: Kimi K2.5", + "context_length": 262144, + "pricing": { + "prompt": "0.0000005", + "completion": "0.0000025", + "input_cache_read": "0.00000015" + } + }, + { + "id": "moonshotai/kimi-k2.6", + "name": "MoonshotAI: Kimi K2.6", + "context_length": 262144, + "pricing": { + "prompt": "0.00000065", + "completion": "0.00000341", + "input_cache_read": "0.00000015" + } + }, + { + "id": "moonshotai/kimi-k2.7-code", + "name": "MoonshotAI: Kimi K2.7 Code", + "context_length": 262144, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000035", + "input_cache_read": "0.00000016" + } + }, + { + "id": "moonshotai/kimi-k3", + "name": "MoonshotAI: Kimi K3", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000192", + "completion": "0.000016", + "input_cache_read": "0.000000182" + } + }, + { + "id": "moonshotai/kimi-k3.1-pro", + "name": "MoonshotAI: Kimi K3.1 Pro", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000002403", + "completion": "0.0000084023", + "input_cache_read": "0.0000002" + } + }, + { + "id": "moonshotai/kimi-k3.1-pro:batch", + "name": "MoonshotAI: Kimi K3.1 Pro (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000362", + "completion": "0.000005421", + "input_cache_read": "0.000000115" + } + }, + { + "id": "moonshotai/kimi-k3:batch", + "name": "MoonshotAI: Kimi K3 (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000228", + "completion": "0.0000114", + "input_cache_read": "0.000000228" + } + }, + { + "id": "morph/morph-v3-fast", + "name": "Morph: Morph V3 Fast", + "context_length": 262144, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000012" + } + }, + { + "id": "morph/morph-v3-fast:batch", + "name": "Morph: Morph V3 Fast (batch)", + "context_length": 81920, + "pricing": { + "prompt": "0.0000004", + "completion": "0.0000006" + } + }, + { + "id": "morph/morph-v3-large", + "name": "Morph: Morph V3 Large", + "context_length": 262144, + "pricing": { + "prompt": "0.0000009", + "completion": "0.0000019" + } + }, + { + "id": "morph/morph-v3-large:batch", + "name": "Morph: Morph V3 Large (batch)", + "context_length": 262144, + "pricing": { + "prompt": "0.00000045", + "completion": "0.00000095" + } + }, + { + "id": "motif-technologies/motif-3", + "name": "Motif Technologies: Motif 3", + "context_length": 262144, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000012", + "input_cache_read": "0.00000006" + } + }, + { + "id": "nex-agi/nex-n2.5-mini", + "name": "Nex AGI: Nex-N2.5-Mini", + "context_length": 262144, + "pricing": { + "prompt": "0.000000025", + "completion": "0.0000001", + "input_cache_read": "0.0000000025" + } + }, + { + "id": "nex-agi/nex-n2.5-pro", + "name": "Nex AGI: Nex-N2.5-Pro", + "context_length": 262144, + "pricing": { + "prompt": "0.000000075", + "completion": "0.00000025", + "input_cache_read": "0.000000015" + } + }, + { + "id": "nex-agi/nex-n2.6", + "name": "Nex AGI: Nex-N2.6", + "context_length": 262144, + "pricing": { + "prompt": "0.00000012", + "completion": "0.0000004", + "input_cache_read": "0.000000024" + } + }, + { + "id": "nousresearch/hermes-4-405b", + "name": "Nous: Hermes 4 405B", + "context_length": 131072, + "pricing": { + "prompt": "0.000001", + "completion": "0.000003", + "input_cache_read": "0.0000002" + } + }, + { + "id": "nvidia/nemotron-3-nano-30b-a3b", + "name": "NVIDIA: Nemotron 3 Nano 30B A3B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000006", + "completion": "0.00000024", + "input_cache_read": "0.000000012" + } + }, + { + "id": "nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free", + "name": "NVIDIA: Nemotron 3 Nano Omni (free)", + "context_length": 256000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "nvidia/nemotron-3-super-120b-a12b", + "name": "NVIDIA: Nemotron 3 Super", + "context_length": 262144, + "pricing": { + "prompt": "0.000000075", + "completion": "0.0000004" + } + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b", + "name": "NVIDIA: Nemotron 3 Ultra", + "context_length": 262144, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000024", + "input_cache_read": "0.00000012" + } + }, + { + "id": "nvidia/nemotron-3-ultra-550b-a55b:free", + "name": "NVIDIA: Nemotron 3 Ultra (free)", + "context_length": 1000000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "nvidia/nemotron-3.5-content-safety", + "name": "NVIDIA: Nemotron 3.5 Content Safety", + "context_length": 131072, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000002" + } + }, + { + "id": "nvidia/nemotron-3.5-lightning", + "name": "NVIDIA: Nemotron 3.5 Lightning", + "context_length": 262144, + "pricing": { + "prompt": "0.00000007", + "completion": "0.0000002", + "input_cache_read": "0.00000004" + } + }, + { + "id": "nvidia/nemotron-3.5-lightning:free", + "name": "NVIDIA: Nemotron 3.5 Lightning (free)", + "context_length": 1000000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "nvidia/nemotron-3.5-super-vl", + "name": "NVIDIA: Nemotron 3.5 Super VL", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000005", + "input_cache_read": "0.00000002" + } + }, + { + "id": "nvidia/nemotron-3.5-super-vl:free", + "name": "NVIDIA: Nemotron 3.5 Super VL (free)", + "context_length": 1000000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "nvidia/switchyard", + "name": "NVIDIA: Switchyard", + "context_length": 1000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "openai/gpt-3.5-turbo-0613", + "name": "OpenAI: GPT-3.5 Turbo (older v0613)", + "context_length": 4095, + "pricing": { + "prompt": "0.000001", + "completion": "0.000002" + } + }, + { + "id": "openai/gpt-3.5-turbo-16k", + "name": "OpenAI: GPT-3.5 Turbo 16k", + "context_length": 16385, + "pricing": { + "prompt": "0.000003", + "completion": "0.000004" + } + }, + { + "id": "openai/gpt-4", + "name": "OpenAI: GPT-4", + "context_length": 8191, + "pricing": { + "prompt": "0.00003", + "completion": "0.00006" + } + }, + { + "id": "openai/gpt-4-turbo:batch", + "name": "OpenAI: GPT-4 Turbo (batch)", + "context_length": 128000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000015" + } + }, + { + "id": "openai/gpt-4.1", + "name": "OpenAI: GPT-4.1", + "context_length": 1047576, + "pricing": { + "prompt": "0.000002", + "completion": "0.000008", + "input_cache_read": "0.0000005" + } + }, + { + "id": "openai/gpt-4.1-mini", + "name": "OpenAI: GPT-4.1 Mini", + "context_length": 1047576, + "pricing": { + "prompt": "0.0000004", + "completion": "0.0000016", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-4.1-mini:batch", + "name": "OpenAI: GPT-4.1 Mini (batch)", + "context_length": 1047576, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000008", + "input_cache_read": "0.00000005" + } + }, + { + "id": "openai/gpt-4.1-nano", + "name": "OpenAI: GPT-4.1 Nano", + "context_length": 1047576, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000004", + "input_cache_read": "0.00000003" + } + }, + { + "id": "openai/gpt-4.1-nano:batch", + "name": "OpenAI: GPT-4.1 Nano (batch)", + "context_length": 1047576, + "pricing": { + "prompt": "0.00000005", + "completion": "0.0000002", + "input_cache_read": "0.0000000125" + } + }, + { + "id": "openai/gpt-4.1:batch", + "name": "OpenAI: GPT-4.1 (batch)", + "context_length": 1047576, + "pricing": { + "prompt": "0.000001", + "completion": "0.000004", + "input_cache_read": "0.00000025" + } + }, + { + "id": "openai/gpt-4o", + "name": "OpenAI: GPT-4o", + "context_length": 128000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.00001", + "input_cache_read": "0.00000125" + } + }, + { + "id": "openai/gpt-4o-2024-05-13", + "name": "OpenAI: GPT-4o (2024-05-13)", + "context_length": 128000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000015" + } + }, + { + "id": "openai/gpt-4o-2024-08-06", + "name": "OpenAI: GPT-4o (2024-08-06)", + "context_length": 128000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.00001", + "input_cache_read": "0.00000125" + } + }, + { + "id": "openai/gpt-4o-2024-11-20", + "name": "OpenAI: GPT-4o (2024-11-20)", + "context_length": 128000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.00001", + "input_cache_read": "0.00000125" + } + }, + { + "id": "openai/gpt-4o-mini", + "name": "OpenAI: GPT-4o-mini", + "context_length": 128000, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006", + "input_cache_read": "0.000000075" + } + }, + { + "id": "openai/gpt-4o-mini-2024-07-18", + "name": "OpenAI: GPT-4o-mini (2024-07-18)", + "context_length": 128000, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006", + "input_cache_read": "0.000000075" + } + }, + { + "id": "openai/gpt-4o-mini:batch", + "name": "OpenAI: GPT-4o-mini (batch)", + "context_length": 128000, + "pricing": { + "prompt": "0.000000075", + "completion": "0.0000003", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "openai/gpt-4o:batch", + "name": "OpenAI: GPT-4o (batch)", + "context_length": 128000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.000005", + "input_cache_read": "0.000000625" + } + }, + { + "id": "openai/gpt-5", + "name": "OpenAI: GPT-5", + "context_length": 400000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00001", + "input_cache_read": "0.000000125" + } + }, + { + "id": "openai/gpt-5-image", + "name": "OpenAI: GPT-5 Image", + "context_length": 400000, + "pricing": { + "prompt": "0.00001", + "completion": "0.00001", + "input_cache_read": "0.00000125" + } + }, + { + "id": "openai/gpt-5-image-mini", + "name": "OpenAI: GPT-5 Image Mini", + "context_length": 400000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.000002", + "input_cache_read": "0.00000025" + } + }, + { + "id": "openai/gpt-5-mini", + "name": "OpenAI: GPT-5 Mini", + "context_length": 400000, + "pricing": { + "prompt": "0.00000025", + "completion": "0.000002", + "input_cache_read": "0.000000025" + } + }, + { + "id": "openai/gpt-5-mini:batch", + "name": "OpenAI: GPT-5 Mini (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.000000125", + "completion": "0.000001", + "input_cache_read": "0.0000000125" + } + }, + { + "id": "openai/gpt-5-nano", + "name": "OpenAI: GPT-5 Nano", + "context_length": 400000, + "pricing": { + "prompt": "0.00000005", + "completion": "0.0000004", + "input_cache_read": "0.000000005" + } + }, + { + "id": "openai/gpt-5-nano:batch", + "name": "OpenAI: GPT-5 Nano (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.000000025", + "completion": "0.0000002", + "input_cache_read": "0.0000000025" + } + }, + { + "id": "openai/gpt-5-pro", + "name": "OpenAI: GPT-5 Pro", + "context_length": 400000, + "pricing": { + "prompt": "0.000015", + "completion": "0.00012" + } + }, + { + "id": "openai/gpt-5-pro:batch", + "name": "OpenAI: GPT-5 Pro (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.0000075", + "completion": "0.00006" + } + }, + { + "id": "openai/gpt-5.1", + "name": "OpenAI: GPT-5.1", + "context_length": 400000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00001", + "input_cache_read": "0.000000125" + } + }, + { + "id": "openai/gpt-5.1-codex", + "name": "OpenAI: GPT-5.1-Codex", + "context_length": 400000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00001", + "input_cache_read": "0.00000013" + } + }, + { + "id": "openai/gpt-5.1-codex-max", + "name": "OpenAI: GPT-5.1-Codex-Max", + "context_length": 400000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.00001", + "input_cache_read": "0.000000125" + } + }, + { + "id": "openai/gpt-5.1-codex-mini", + "name": "OpenAI: GPT-5.1-Codex-Mini", + "context_length": 400000, + "pricing": { + "prompt": "0.00000025", + "completion": "0.000002", + "input_cache_read": "0.00000003" + } + }, + { + "id": "openai/gpt-5.1:batch", + "name": "OpenAI: GPT-5.1 (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.000000625", + "completion": "0.000005", + "input_cache_read": "0.0000000625" + } + }, + { + "id": "openai/gpt-5.2", + "name": "OpenAI: GPT-5.2", + "context_length": 400000, + "pricing": { + "prompt": "0.00000175", + "completion": "0.000014", + "input_cache_read": "0.000000175" + } + }, + { + "id": "openai/gpt-5.2-chat", + "name": "OpenAI: GPT-5.2 Chat", + "context_length": 128000, + "pricing": { + "prompt": "0.00000175", + "completion": "0.000014", + "input_cache_read": "0.000000175" + } + }, + { + "id": "openai/gpt-5.2-codex", + "name": "OpenAI: GPT-5.2-Codex", + "context_length": 400000, + "pricing": { + "prompt": "0.00000175", + "completion": "0.000014", + "input_cache_read": "0.000000175" + } + }, + { + "id": "openai/gpt-5.2-pro", + "name": "OpenAI: GPT-5.2 Pro", + "context_length": 400000, + "pricing": { + "prompt": "0.000021", + "completion": "0.000168" + } + }, + { + "id": "openai/gpt-5.2-pro:batch", + "name": "OpenAI: GPT-5.2 Pro (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.0000105", + "completion": "0.000084" + } + }, + { + "id": "openai/gpt-5.2:batch", + "name": "OpenAI: GPT-5.2 (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.000000875", + "completion": "0.000007", + "input_cache_read": "0.0000000875" + } + }, + { + "id": "openai/gpt-5.3-codex", + "name": "OpenAI: GPT-5.3-Codex", + "context_length": 400000, + "pricing": { + "prompt": "0.00000175", + "completion": "0.000014", + "input_cache_read": "0.000000175" + } + }, + { + "id": "openai/gpt-5.4", + "name": "OpenAI: GPT-5.4", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.000015", + "input_cache_read": "0.00000025" + } + }, + { + "id": "openai/gpt-5.4-image-2", + "name": "OpenAI: GPT-5.4 Image 2", + "context_length": 272000, + "pricing": { + "prompt": "0.000008", + "completion": "0.000015", + "input_cache_read": "0.000002" + } + }, + { + "id": "openai/gpt-5.4-mini", + "name": "OpenAI: GPT-5.4 Mini", + "context_length": 400000, + "pricing": { + "prompt": "0.00000075", + "completion": "0.0000045", + "input_cache_read": "0.000000075" + } + }, + { + "id": "openai/gpt-5.4-mini:batch", + "name": "OpenAI: GPT-5.4 Mini (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.000000375", + "completion": "0.00000225", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "openai/gpt-5.4-nano", + "name": "OpenAI: GPT-5.4 Nano", + "context_length": 400000, + "pricing": { + "prompt": "0.0000002", + "completion": "0.00000125", + "input_cache_read": "0.00000002" + } + }, + { + "id": "openai/gpt-5.4-nano:batch", + "name": "OpenAI: GPT-5.4 Nano (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.000000625", + "input_cache_read": "0.00000001" + } + }, + { + "id": "openai/gpt-5.4-pro", + "name": "OpenAI: GPT-5.4 Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.00003", + "completion": "0.00018" + } + }, + { + "id": "openai/gpt-5.4-pro:batch", + "name": "OpenAI: GPT-5.4 Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000015", + "completion": "0.00009" + } + }, + { + "id": "openai/gpt-5.4:batch", + "name": "OpenAI: GPT-5.4 (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.0000075", + "input_cache_read": "0.000000125" + } + }, + { + "id": "openai/gpt-5.5", + "name": "OpenAI: GPT-5.5", + "context_length": 1050000, + "pricing": { + "prompt": "0.000005", + "completion": "0.00003", + "input_cache_read": "0.0000005" + } + }, + { + "id": "openai/gpt-5.5-pro", + "name": "OpenAI: GPT-5.5 Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.00003", + "completion": "0.00018" + } + }, + { + "id": "openai/gpt-5.5-pro:batch", + "name": "OpenAI: GPT-5.5 Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000015", + "completion": "0.00009" + } + }, + { + "id": "openai/gpt-5.5:batch", + "name": "OpenAI: GPT-5.5 (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.000015", + "input_cache_read": "0.00000025" + } + }, + { + "id": "openai/gpt-5.6-luna", + "name": "OpenAI: GPT-5.6 Luna", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000012", + "input_cache_read": "0.00000002" + } + }, + { + "id": "openai/gpt-5.6-luna-pro", + "name": "OpenAI: GPT-5.6 Luna Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000002", + "completion": "0.0000012", + "input_cache_read": "0.00000002" + } + }, + { + "id": "openai/gpt-5.6-luna-pro:batch", + "name": "OpenAI: GPT-5.6 Luna Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000006", + "input_cache_read": "0.00000001" + } + }, + { + "id": "openai/gpt-5.6-luna:batch", + "name": "OpenAI: GPT-5.6 Luna (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000006", + "input_cache_read": "0.00000001" + } + }, + { + "id": "openai/gpt-5.6-sol", + "name": "OpenAI: GPT-5.6 Sol", + "context_length": 1050000, + "pricing": { + "prompt": "0.000004", + "completion": "0.00002", + "input_cache_read": "0.0000004" + } + }, + { + "id": "openai/gpt-5.6-sol-pro", + "name": "OpenAI: GPT-5.6 Sol Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.000004", + "completion": "0.00002", + "input_cache_read": "0.0000004" + } + }, + { + "id": "openai/gpt-5.6-sol-pro:batch", + "name": "OpenAI: GPT-5.6 Sol Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000002" + } + }, + { + "id": "openai/gpt-5.6-sol:batch", + "name": "OpenAI: GPT-5.6 Sol (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000002" + } + }, + { + "id": "openai/gpt-5.6-terra", + "name": "OpenAI: GPT-5.6 Terra", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000012", + "input_cache_read": "0.0000002" + } + }, + { + "id": "openai/gpt-5.6-terra-pro", + "name": "OpenAI: GPT-5.6 Terra Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000012", + "input_cache_read": "0.0000002" + } + }, + { + "id": "openai/gpt-5.6-terra-pro:batch", + "name": "OpenAI: GPT-5.6 Terra Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000006", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-5.6-terra:batch", + "name": "OpenAI: GPT-5.6 Terra (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000006", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-5:batch", + "name": "OpenAI: GPT-5 (batch)", + "context_length": 400000, + "pricing": { + "prompt": "0.000000625", + "completion": "0.000005", + "input_cache_read": "0.0000000625" + } + }, + { + "id": "openai/gpt-6-astra", + "name": "OpenAI: GPT-6 Astra", + "context_length": 1050000, + "pricing": { + "prompt": "0.00001", + "completion": "0.00005", + "input_cache_read": "0.000001" + } + }, + { + "id": "openai/gpt-6-astra-pro", + "name": "OpenAI: GPT-6 Astra Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.00001", + "completion": "0.00005", + "input_cache_read": "0.000001" + } + }, + { + "id": "openai/gpt-6-astra-pro:batch", + "name": "OpenAI: GPT-6 Astra Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "openai/gpt-6-astra:batch", + "name": "OpenAI: GPT-6 Astra (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000005", + "completion": "0.000025", + "input_cache_read": "0.0000005" + } + }, + { + "id": "openai/gpt-6-luna", + "name": "OpenAI: GPT-6 Luna", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000005", + "input_cache_read": "0.00000001" + } + }, + { + "id": "openai/gpt-6-luna-pro", + "name": "OpenAI: GPT-6 Luna Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000005", + "input_cache_read": "0.00000001" + } + }, + { + "id": "openai/gpt-6-luna-pro:batch", + "name": "OpenAI: GPT-6 Luna Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000025", + "input_cache_read": "0.000000005" + } + }, + { + "id": "openai/gpt-6-luna:batch", + "name": "OpenAI: GPT-6 Luna (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000025", + "input_cache_read": "0.000000005" + } + }, + { + "id": "openai/gpt-6-sol", + "name": "OpenAI: GPT-6 Sol", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000002" + } + }, + { + "id": "openai/gpt-6-sol-pro", + "name": "OpenAI: GPT-6 Sol Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000002" + } + }, + { + "id": "openai/gpt-6-sol-pro:batch", + "name": "OpenAI: GPT-6 Sol Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-6-sol:batch", + "name": "OpenAI: GPT-6 Sol (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-6.1-sol", + "name": "OpenAI: GPT-6.1 Sol", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-6.1-sol-pro", + "name": "OpenAI: GPT-6.1 Sol Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "openai/gpt-6.1-sol-pro:batch", + "name": "OpenAI: GPT-6.1 Sol Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "openai/gpt-6.1-sol:batch", + "name": "OpenAI: GPT-6.1 Sol (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "openai/gpt-6.1-terra", + "name": "OpenAI: GPT-6.1 Terra", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "openai/gpt-6.1-terra-pro", + "name": "OpenAI: GPT-6.1 Terra Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "openai/gpt-6.1-terra-pro:batch", + "name": "OpenAI: GPT-6.1 Terra Pro (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000005", + "completion": "0.0000025", + "input_cache_read": "0.000000025" + } + }, + { + "id": "openai/gpt-6.1-terra:batch", + "name": "OpenAI: GPT-6.1 Terra (batch)", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000005", + "completion": "0.0000025", + "input_cache_read": "0.000000025" + } + }, + { + "id": "openai/gpt-audio", + "name": "OpenAI: GPT Audio", + "context_length": 128000, + "pricing": { + "prompt": "0.0000025", + "completion": "0.00001" + } + }, + { + "id": "openai/gpt-audio-mini", + "name": "OpenAI: GPT Audio Mini", + "context_length": 128000, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000024" + } + }, + { + "id": "openai/gpt-chat-latest", + "name": "OpenAI: GPT Chat Latest", + "context_length": 400000, + "pricing": { + "prompt": "0.000005", + "completion": "0.00003", + "input_cache_read": "0.0000005" + } + }, + { + "id": "openai/gpt-oss-120b", + "name": "OpenAI: gpt-oss-120b", + "context_length": 131072, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006", + "input_cache_read": "0.000000075" + } + }, + { + "id": "openai/gpt-oss-120b:batch", + "name": "OpenAI: gpt-oss-120b (batch)", + "context_length": 131072, + "pricing": { + "prompt": "0.0000000296", + "completion": "0.000000136" + } + }, + { + "id": "openai/gpt-oss-20b", + "name": "OpenAI: gpt-oss-20b", + "context_length": 131072, + "pricing": { + "prompt": "0.000000075", + "completion": "0.0000003", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "openai/gpt-oss-20b:batch", + "name": "OpenAI: gpt-oss-20b (batch)", + "context_length": 131072, + "pricing": { + "prompt": "0.000000024", + "completion": "0.000000112" + } + }, + { + "id": "openai/gpt-oss-safeguard-20b", + "name": "OpenAI: gpt-oss-safeguard-20b", + "context_length": 131072, + "pricing": { + "prompt": "0.000000075", + "completion": "0.0000003", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "openai/o3", + "name": "OpenAI: o3", + "context_length": 200000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000008", + "input_cache_read": "0.0000005" + } + }, + { + "id": "openai/o3-mini:batch", + "name": "OpenAI: o3 Mini (batch)", + "context_length": 200000, + "pricing": { + "prompt": "0.00000055", + "completion": "0.0000022", + "input_cache_read": "0.000000275" + } + }, + { + "id": "openai/o3-pro", + "name": "OpenAI: o3 Pro", + "context_length": 200000, + "pricing": { + "prompt": "0.00002", + "completion": "0.00008" + } + }, + { + "id": "openai/o3:batch", + "name": "OpenAI: o3 (batch)", + "context_length": 200000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000004", + "input_cache_read": "0.00000025" + } + }, + { + "id": "openai/o4-mini:batch", + "name": "OpenAI: o4 Mini (batch)", + "context_length": 200000, + "pricing": { + "prompt": "0.00000055", + "completion": "0.0000022", + "input_cache_read": "0.0000001375" + } + }, + { + "id": "openrouter/auto", + "name": "Auto Router", + "context_length": 2000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "openrouter/auto-beta", + "name": "Auto Router (Beta)", + "context_length": 2000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "openrouter/auto-code", + "name": "Auto Code", + "context_length": 2000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "openrouter/bodybuilder", + "name": "Body Builder (beta)", + "context_length": 128000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "openrouter/free", + "name": "Free Models Router", + "context_length": 200000, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "openrouter/fusion", + "name": "OpenRouter: Fusion", + "context_length": 1000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "openrouter/pareto-code", + "name": "Pareto Code Router", + "context_length": 2000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "particle-ai/particle-1", + "name": "Particle AI: Particle-1", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000006", + "completion": "0.0000005", + "input_cache_read": "0.000000003" + } + }, + { + "id": "particle-ai/particle-1:free", + "name": "Particle AI: Particle-1 (free)", + "context_length": 1048576, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "perceptron/perceptron-mk1", + "name": "Perceptron: Perceptron Mk1", + "context_length": 32768, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000015" + } + }, + { + "id": "perceptron/perceptron-mk1.5", + "name": "Perceptron: Perceptron Mk1.5", + "context_length": 36864, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000015" + } + }, + { + "id": "perplexity/sonar", + "name": "Perplexity: Sonar", + "context_length": 127072, + "pricing": { + "prompt": "0.000001", + "completion": "0.000001" + } + }, + { + "id": "perplexity/sonar-deep-research", + "name": "Perplexity: Sonar Deep Research", + "context_length": 128000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000008" + } + }, + { + "id": "perplexity/sonar-pro", + "name": "Perplexity: Sonar Pro", + "context_length": 200000, + "pricing": { + "prompt": "0.000003", + "completion": "0.000015" + } + }, + { + "id": "perplexity/sonar-pro-search", + "name": "Perplexity: Sonar Pro Search", + "context_length": 200000, + "pricing": { + "prompt": "0.000003", + "completion": "0.000015" + } + }, + { + "id": "perplexity/sonar-reasoning-pro", + "name": "Perplexity: Sonar Reasoning Pro", + "context_length": 128000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000008" + } + }, + { + "id": "prism-ml/ternary-bonsai-2-27b", + "name": "PrismML: Ternary Bonsai 2 27B", + "context_length": 262144, + "pricing": { + "prompt": "0.000000075", + "completion": "0.0000005", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "prism-ml/ternary-bonsai-2-9b", + "name": "PrismML: Ternary Bonsai 2 9B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000008", + "completion": "0.00000013", + "input_cache_read": "0.00000004" + } + }, + { + "id": "qwen/qwen-2.5-72b-instruct", + "name": "Qwen2.5 72B Instruct", + "context_length": 32768, + "pricing": { + "prompt": "0.00000036", + "completion": "0.0000004" + } + }, + { + "id": "qwen/qwen-2.5-coder-32b-instruct", + "name": "Qwen2.5 Coder 32B Instruct", + "context_length": 32768, + "pricing": { + "prompt": "0.00000066", + "completion": "0.000001" + } + }, + { + "id": "qwen/qwen-plus", + "name": "Qwen: Qwen-Plus", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000026", + "completion": "0.00000078", + "input_cache_read": "0.000000052" + } + }, + { + "id": "qwen/qwen2.5-vl-72b-instruct", + "name": "Qwen: Qwen2.5 VL 72B Instruct", + "context_length": 128000, + "pricing": { + "prompt": "0.0000008", + "completion": "0.000001", + "input_cache_read": "0.0000004" + } + }, + { + "id": "qwen/qwen3-14b", + "name": "Qwen: Qwen3 14B", + "context_length": 40960, + "pricing": { + "prompt": "0.00000012", + "completion": "0.00000024" + } + }, + { + "id": "qwen/qwen3-235b-a22b-2507", + "name": "Qwen: Qwen3 235B A22B Instruct 2507", + "context_length": 262144, + "pricing": { + "prompt": "0.00000014", + "completion": "0.0000008", + "input_cache_read": "0.00000005" + } + }, + { + "id": "qwen/qwen3-235b-a22b-thinking-2507", + "name": "Qwen: Qwen3 235B A22B Thinking 2507", + "context_length": 128000, + "pricing": { + "prompt": "0.00000045", + "completion": "0.0000035" + } + }, + { + "id": "qwen/qwen3-30b-a3b", + "name": "Qwen: Qwen3 30B A3B", + "context_length": 40960, + "pricing": { + "prompt": "0.00000012", + "completion": "0.0000005" + } + }, + { + "id": "qwen/qwen3-30b-a3b-instruct-2507", + "name": "Qwen: Qwen3 30B A3B Instruct 2507", + "context_length": 262144, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000003", + "input_cache_read": "0.0000001" + } + }, + { + "id": "qwen/qwen3-32b", + "name": "Qwen: Qwen3 32B", + "context_length": 131072, + "pricing": { + "prompt": "0.00000008", + "completion": "0.00000028" + } + }, + { + "id": "qwen/qwen3-coder", + "name": "Qwen: Qwen3 Coder 480B A35B", + "context_length": 262144, + "pricing": { + "prompt": "0.0000003", + "completion": "0.000001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "qwen/qwen3-coder-30b-a3b-instruct", + "name": "Qwen: Qwen3 Coder 30B A3B Instruct", + "context_length": 262144, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006" + } + }, + { + "id": "qwen/qwen3-coder-flash", + "name": "Qwen: Qwen3 Coder Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.000000195", + "completion": "0.000000975", + "input_cache_read": "0.000000039" + } + }, + { + "id": "qwen/qwen3-coder-next", + "name": "Qwen: Qwen3 Coder Next", + "context_length": 262144, + "pricing": { + "prompt": "0.00000012", + "completion": "0.0000008", + "input_cache_read": "0.00000007" + } + }, + { + "id": "qwen/qwen3-next-80b-a3b-instruct", + "name": "Qwen: Qwen3 Next 80B A3B Instruct", + "context_length": 262144, + "pricing": { + "prompt": "0.00000009", + "completion": "0.0000011" + } + }, + { + "id": "qwen/qwen3-vl-235b-a22b-instruct", + "name": "Qwen: Qwen3 VL 235B A22B Instruct", + "context_length": 262144, + "pricing": { + "prompt": "0.00000021", + "completion": "0.0000019", + "input_cache_read": "0.0000001" + } + }, + { + "id": "qwen/qwen3-vl-30b-a3b-instruct", + "name": "Qwen: Qwen3 VL 30B A3B Instruct", + "context_length": 262144, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006" + } + }, + { + "id": "qwen/qwen3-vl-8b-instruct", + "name": "Qwen: Qwen3 VL 8B Instruct", + "context_length": 262144, + "pricing": { + "prompt": "0.00000025", + "completion": "0.00000075", + "input_cache_read": "0.00000012" + } + }, + { + "id": "qwen/qwen3.5-122b-a10b", + "name": "Qwen: Qwen3.5-122B-A10B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000026", + "completion": "0.00000208" + } + }, + { + "id": "qwen/qwen3.5-27b", + "name": "Qwen: Qwen3.5-27B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000026", + "completion": "0.0000026" + } + }, + { + "id": "qwen/qwen3.5-35b-a3b", + "name": "Qwen: Qwen3.5-35B-A3B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000014", + "completion": "0.000001", + "input_cache_read": "0.00000005" + } + }, + { + "id": "qwen/qwen3.5-397b-a17b", + "name": "Qwen: Qwen3.5 397B A17B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000045", + "completion": "0.000003", + "input_cache_read": "0.00000022" + } + }, + { + "id": "qwen/qwen3.5-9b", + "name": "Qwen: Qwen3.5-9B", + "context_length": 262144, + "pricing": { + "prompt": "0.000000143", + "completion": "0.000000211", + "input_cache_read": "0.000000129" + } + }, + { + "id": "qwen/qwen3.5-flash-02-23", + "name": "Qwen: Qwen3.5-Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.000000065", + "completion": "0.00000026" + } + }, + { + "id": "qwen/qwen3.5-plus-02-15", + "name": "Qwen: Qwen3.5 Plus 2026-02-15", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000026", + "completion": "0.00000156" + } + }, + { + "id": "qwen/qwen3.5-plus-20260420", + "name": "Qwen: Qwen3.5 Plus 2026-04-20", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000018" + } + }, + { + "id": "qwen/qwen3.6-27b", + "name": "Qwen: Qwen3.6 27B", + "context_length": 262144, + "pricing": { + "prompt": "0.00000032", + "completion": "0.0000032" + } + }, + { + "id": "qwen/qwen3.6-35b-a3b", + "name": "Qwen: Qwen3.6 35B A3B", + "context_length": 262144, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000009", + "input_cache_read": "0.000000025" + } + }, + { + "id": "qwen/qwen3.6-flash", + "name": "Qwen: Qwen3.6 Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000001875", + "completion": "0.000001125" + } + }, + { + "id": "qwen/qwen3.6-plus", + "name": "Qwen: Qwen3.6 Plus", + "context_length": 1000000, + "pricing": { + "prompt": "0.000000325", + "completion": "0.00000195" + } + }, + { + "id": "qwen/qwen3.7-flash", + "name": "Qwen: Qwen3.7 Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000003", + "completion": "0.00000013", + "input_cache_read": "0.000000006" + } + }, + { + "id": "qwen/qwen3.7-max", + "name": "Qwen: Qwen3.7 Max", + "context_length": 1000000, + "pricing": { + "prompt": "0.000001475", + "completion": "0.000004425", + "input_cache_read": "0.000000295" + } + }, + { + "id": "qwen/qwen3.7-plus", + "name": "Qwen: Qwen3.7 Plus", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000032", + "completion": "0.00000128", + "input_cache_read": "0.000000064" + } + }, + { + "id": "qwen/qwen3.7-plus:batch", + "name": "Qwen: Qwen3.7 Plus (batch)", + "context_length": 262144, + "pricing": { + "prompt": "0.00000023", + "completion": "0.00000092" + } + }, + { + "id": "qwen/qwen3.8-2.4t-a95b", + "name": "Qwen: Qwen3.8 2.4T A95B", + "context_length": 1048576, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.00000025" + } + }, + { + "id": "qwen/qwen3.8-27b", + "name": "Qwen: Qwen3.8 27B", + "context_length": 1024000, + "pricing": { + "prompt": "0.00000015", + "completion": "0.000001875", + "input_cache_read": "0.0000000375" + } + }, + { + "id": "qwen/qwen3.8-27b:batch", + "name": "Qwen: Qwen3.8 27B (batch)", + "context_length": 262144, + "pricing": { + "prompt": "0.00000016", + "completion": "0.000002", + "input_cache_read": "0.00000004" + } + }, + { + "id": "qwen/qwen3.8-flash", + "name": "Qwen: Qwen3.8 Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000015", + "completion": "0.00000047", + "input_cache_read": "0.000000016" + } + }, + { + "id": "qwen/qwen3.8-max-0902", + "name": "Qwen: Qwen3.8 Max (0902)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.00000025" + } + }, + { + "id": "qwen/qwen3.8-max-0902:batch", + "name": "Qwen: Qwen3.8 Max (0902) (batch)", + "context_length": 262144, + "pricing": { + "prompt": "0.00000115", + "completion": "0.00000345" + } + }, + { + "id": "qwen/qwen3.8-max-prime", + "name": "Qwen: Qwen3.8 Max Prime", + "context_length": 1000000, + "pricing": { + "prompt": "0.000004", + "completion": "0.000012", + "input_cache_read": "0.0000005" + } + }, + { + "id": "qwen/qwen3.8-omni-flash", + "name": "Qwen: Qwen3.8 Omni Flash", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000015", + "completion": "0.00000047", + "input_cache_read": "0.000000016" + } + }, + { + "id": "qwen/qwen4-max", + "name": "Qwen: Qwen4 Max", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000045", + "input_cache_read": "0.000000075" + } + }, + { + "id": "recursive/flint-v1.0:free", + "name": "Recursive: Flint (free)", + "context_length": 262144, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "reflection/beam-1.0-501b-a23b", + "name": "Reflection: Beam 1.0 501B A23B", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000003", + "completion": "0.000001", + "input_cache_read": "0.00000004" + } + }, + { + "id": "rekaai/reka-edge", + "name": "Reka Edge", + "context_length": 16384, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000001" + } + }, + { + "id": "rekaai/reka-flash-3", + "name": "Reka Flash 3", + "context_length": 65536, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000002" + } + }, + { + "id": "relace/relace-apply-3", + "name": "Relace: Relace Apply 3", + "context_length": 256000, + "pricing": { + "prompt": "0.00000085", + "completion": "0.00000125" + } + }, + { + "id": "relace/relace-search", + "name": "Relace: Relace Search", + "context_length": 256000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000003" + } + }, + { + "id": "ricursiveai/ripple-65b-preview", + "name": "Ricursive: Ripple 65B Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000003", + "input_cache_read": "0.000000025" + } + }, + { + "id": "sakana/fugu-max", + "name": "Sakana: Fugu Max", + "context_length": 1000000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.00000025" + } + }, + { + "id": "sakana/fugu-ultra", + "name": "Sakana: Fugu Ultra", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.00003", + "input_cache_read": "0.0000005" + } + }, + { + "id": "sakana/fugu-ultra-v2", + "name": "Sakana: Fugu Ultra v2", + "context_length": 1000000, + "pricing": { + "prompt": "0.000005", + "completion": "0.00003", + "input_cache_read": "0.0000005" + } + }, + { + "id": "sakana/sakana-namazu", + "name": "Sakana: Sakana Namazu", + "context_length": 262144, + "pricing": { + "prompt": "0.00000095", + "completion": "0.000004", + "input_cache_read": "0.00000015" + } + }, + { + "id": "sao10k/l3-lunaris-8b", + "name": "Sao10K: Llama 3 8B Lunaris", + "context_length": 8192, + "pricing": { + "prompt": "0.00000004", + "completion": "0.00000005" + } + }, + { + "id": "sao10k/l3.1-euryale-70b", + "name": "Sao10K: Llama 3.1 Euryale 70B v2.2", + "context_length": 131072, + "pricing": { + "prompt": "0.00000085", + "completion": "0.00000085" + } + }, + { + "id": "scaledown/extract", + "name": "ScaleDown: Extract", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000004", + "completion": "0" + } + }, + { + "id": "scaledown/summarize", + "name": "ScaleDown: Summarize", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000004", + "completion": "0" + } + }, + { + "id": "stepfun/step-3.7-flash", + "name": "StepFun: Step 3.7 Flash", + "context_length": 262144, + "pricing": { + "prompt": "0.0000002", + "completion": "0.00000115", + "input_cache_read": "0.00000004" + } + }, + { + "id": "stepfun/step-5-preview", + "name": "StepFun: Step 5 Preview", + "context_length": 1000000, + "pricing": { + "prompt": "0.000001", + "completion": "0.0000027", + "input_cache_read": "0.0000001" + } + }, + { + "id": "tencent/hy-mt2-1.8b", + "name": "Tencent: Hy-MT2-1.8B", + "context_length": 8192, + "pricing": { + "prompt": "0.000000044", + "completion": "0.000000177" + } + }, + { + "id": "tencent/hy-mt2-30b-a3b", + "name": "Tencent: Hy-MT2-30B-A3B", + "context_length": 8192, + "pricing": { + "prompt": "0.000000074", + "completion": "0.000000295" + } + }, + { + "id": "tencent/hy-mt2-7b", + "name": "Tencent: Hy-MT2-7B", + "context_length": 8192, + "pricing": { + "prompt": "0.000000074", + "completion": "0.000000295" + } + }, + { + "id": "tencent/hy3", + "name": "Tencent: Hy3", + "context_length": 262144, + "pricing": { + "prompt": "0.0000000825", + "completion": "0.00000033", + "input_cache_read": "0.000000020625" + } + }, + { + "id": "tencent/hy3-preview", + "name": "Tencent: Hy3 preview", + "context_length": 262144, + "pricing": { + "prompt": "0.00000018", + "completion": "0.0000006", + "input_cache_read": "0.00000006" + } + }, + { + "id": "tencent/hy4", + "name": "Tencent: Hy4", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000417", + "completion": "0.0000012505", + "input_cache_read": "0.000000021" + } + }, + { + "id": "tencent/hy4-flash", + "name": "Tencent: Hy4 flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000004375", + "completion": "0.000000175625", + "input_cache_read": "0.000000001875" + } + }, + { + "id": "tencent/hy4-preview", + "name": "Tencent: Hy4 preview", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000007506", + "completion": "0.0000022509", + "input_cache_read": "0.0000000378" + } + }, + { + "id": "thedrummer/cydonia-24b-v4.1", + "name": "TheDrummer: Cydonia 24B V4.1", + "context_length": 131072, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000005", + "input_cache_read": "0.00000015" + } + }, + { + "id": "thedrummer/skyfall-36b-v2", + "name": "TheDrummer: Skyfall 36B V2", + "context_length": 32768, + "pricing": { + "prompt": "0.00000055", + "completion": "0.0000008", + "input_cache_read": "0.00000025" + } + }, + { + "id": "thedrummer/unslopnemo-12b", + "name": "TheDrummer: UnslopNemo 12B", + "context_length": 1024000, + "pricing": { + "prompt": "0.0000004", + "completion": "0.0000004" + } + }, + { + "id": "thinkingmachines/inkling", + "name": "Thinking Machines: Inkling", + "context_length": 524288, + "pricing": { + "prompt": "0.000001", + "completion": "0.00000405", + "input_cache_read": "0.00000017" + } + }, + { + "id": "thinkingmachines/inkling-2-small", + "name": "Thinking Machines: Inkling 2 Small", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000003", + "completion": "0.000001", + "input_cache_read": "0.00000003" + } + }, + { + "id": "thinkingmachines/inkling-2-small:free", + "name": "Thinking Machines: Inkling 2 Small (free)", + "context_length": 1048576, + "pricing": { + "prompt": "0", + "completion": "0" + } + }, + { + "id": "thinkingmachines/inkling-small", + "name": "Thinking Machines: Inkling Small", + "context_length": 524288, + "pricing": { + "prompt": "0.00000045", + "completion": "0.0000012", + "input_cache_read": "0.0000001" + } + }, + { + "id": "thinkingmachines/inkling-small:batch", + "name": "Thinking Machines: Inkling Small (batch)", + "context_length": 524288, + "pricing": { + "prompt": "0.00000036", + "completion": "0.00000096", + "input_cache_read": "0.00000008" + } + }, + { + "id": "typesafe/jev-router", + "name": "TypeSafe: Jev Router", + "context_length": 1000000, + "pricing": { + "prompt": "-1", + "completion": "-1" + } + }, + { + "id": "unbiased/pareto-26.10", + "name": "Pareto 26.10", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000032", + "input_cache_read": "0.00000003" + } + }, + { + "id": "unbiased/pareto-26.10-preview", + "name": "Pareto 26.10 Preview", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000032", + "input_cache_read": "0.00000003" + } + }, + { + "id": "unbiased/pareto-26.9", + "name": "Pareto 26.9", + "context_length": 262144, + "pricing": { + "prompt": "0.0000025", + "completion": "0.0000075", + "input_cache_read": "0.00000025" + } + }, + { + "id": "undi95/remm-slerp-l2-13b", + "name": "ReMM SLERP 13B", + "context_length": 6144, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000005", + "input_cache_read": "0.0000002" + } + }, + { + "id": "upstage/solar-mini4", + "name": "Upstage: Solar Mini 4", + "context_length": 524288, + "pricing": { + "prompt": "0.00000005", + "completion": "0.0000002", + "input_cache_read": "0.000000005" + } + }, + { + "id": "upstage/solar-pro4", + "name": "Upstage: Solar Pro 4", + "context_length": 524288, + "pricing": { + "prompt": "0.00000015", + "completion": "0.0000006", + "input_cache_read": "0.00000003" + } + }, + { + "id": "writer/palmyra-x5", + "name": "Writer: Palmyra X5", + "context_length": 1040000, + "pricing": { + "prompt": "0.0000006", + "completion": "0.000006" + } + }, + { + "id": "x-ai/grok-4.20", + "name": "SpaceXAI: Grok 4.20", + "context_length": 2000000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.0000025", + "input_cache_read": "0.0000002" + } + }, + { + "id": "x-ai/grok-4.20-multi-agent", + "name": "SpaceXAI: Grok 4.20 Multi-Agent", + "context_length": 2000000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.0000025", + "input_cache_read": "0.0000002" + } + }, + { + "id": "x-ai/grok-4.3", + "name": "SpaceXAI: Grok 4.3", + "context_length": 1000000, + "pricing": { + "prompt": "0.00000125", + "completion": "0.0000025", + "input_cache_read": "0.0000002" + } + }, + { + "id": "x-ai/grok-4.3:batch", + "name": "SpaceXAI: Grok 4.3 (batch)", + "context_length": 1000000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000002", + "input_cache_read": "0.00000016" + } + }, + { + "id": "x-ai/grok-4.5", + "name": "SpaceXAI: Grok 4.5", + "context_length": 500000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000003" + } + }, + { + "id": "x-ai/grok-4.6", + "name": "SpaceXAI: Grok 4.6", + "context_length": 500000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000005" + } + }, + { + "id": "x-ai/grok-4.6:batch", + "name": "SpaceXAI: Grok 4.6 (batch)", + "context_length": 500000, + "pricing": { + "prompt": "0.0000016", + "completion": "0.0000048", + "input_cache_read": "0.0000004" + } + }, + { + "id": "x-ai/grok-4.7", + "name": "SpaceXAI: Grok 4.7", + "context_length": 500000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000005" + } + }, + { + "id": "x-ai/grok-4.7:batch", + "name": "SpaceXAI: Grok 4.7 (batch)", + "context_length": 500000, + "pricing": { + "prompt": "0.0000016", + "completion": "0.0000048", + "input_cache_read": "0.0000004" + } + }, + { + "id": "x-ai/grok-build-0.1", + "name": "SpaceXAI: Grok Build 0.1", + "context_length": 256000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000002", + "input_cache_read": "0.0000002" + } + }, + { + "id": "xiaomi/mimo-v2.5", + "name": "Xiaomi: MiMo-V2.5", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000004", + "completion": "0.000002", + "input_cache_read": "0.00000008" + } + }, + { + "id": "xiaomi/mimo-v2.5-pro", + "name": "Xiaomi: MiMo-V2.5-Pro", + "context_length": 1024000, + "pricing": { + "prompt": "0.000000435", + "completion": "0.00000087", + "input_cache_read": "0.0000000036" + } + }, + { + "id": "xiaomi/mimo-v2.6-flash", + "name": "Xiaomi: MiMo-V2.6-Flash", + "context_length": 1050000, + "pricing": { + "prompt": "0.00000014", + "completion": "0.00000028", + "input_cache_read": "0.0000000028" + } + }, + { + "id": "xiaomi/mimo-v2.6-pro", + "name": "Xiaomi: MiMo-V2.6-Pro", + "context_length": 1050000, + "pricing": { + "prompt": "0.000000435", + "completion": "0.00000087", + "input_cache_read": "0.0000000036" + } + }, + { + "id": "xiaomi/mimo-v2.6-pro-ultraspeed", + "name": "Xiaomi: MiMo-V2.6-Pro-UltraSpeed", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000435", + "completion": "0.0000087", + "input_cache_read": "0.000000036" + } + }, + { + "id": "z-ai/glm-4.5", + "name": "Z.ai: GLM 4.5", + "context_length": 131072, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000022", + "input_cache_read": "0.00000011" + } + }, + { + "id": "z-ai/glm-4.5-air", + "name": "Z.ai: GLM 4.5 Air", + "context_length": 131072, + "pricing": { + "prompt": "0.00000013", + "completion": "0.00000085", + "input_cache_read": "0.000000025" + } + }, + { + "id": "z-ai/glm-4.5v", + "name": "Z.ai: GLM 4.5V", + "context_length": 65536, + "pricing": { + "prompt": "0.0000006", + "completion": "0.0000018", + "input_cache_read": "0.00000011" + } + }, + { + "id": "z-ai/glm-4.6", + "name": "Z.ai: GLM 4.6", + "context_length": 204800, + "pricing": { + "prompt": "0.0000005", + "completion": "0.000002", + "input_cache_read": "0.0000001" + } + }, + { + "id": "z-ai/glm-4.6v", + "name": "Z.ai: GLM 4.6V", + "context_length": 131072, + "pricing": { + "prompt": "0.0000003", + "completion": "0.0000009", + "input_cache_read": "0.000000055" + } + }, + { + "id": "z-ai/glm-4.7", + "name": "Z.ai: GLM 4.7", + "context_length": 204800, + "pricing": { + "prompt": "0.0000004", + "completion": "0.00000175", + "input_cache_read": "0.00000008" + } + }, + { + "id": "z-ai/glm-4.7-flash", + "name": "Z.ai: GLM 4.7 Flash", + "context_length": 200000, + "pricing": { + "prompt": "0.0000000605", + "completion": "0.0000004" + } + }, + { + "id": "z-ai/glm-5", + "name": "Z.ai: GLM 5", + "context_length": 204800, + "pricing": { + "prompt": "0.000001", + "completion": "0.0000032", + "input_cache_read": "0.0000002" + } + }, + { + "id": "z-ai/glm-5-turbo", + "name": "Z.ai: GLM 5 Turbo", + "context_length": 202752, + "pricing": { + "prompt": "0.0000012", + "completion": "0.000004", + "input_cache_read": "0.00000024" + } + }, + { + "id": "z-ai/glm-5.1", + "name": "Z.ai: GLM 5.1", + "context_length": 204800, + "pricing": { + "prompt": "0.0000014", + "completion": "0.0000044", + "input_cache_read": "0.00000026" + } + }, + { + "id": "z-ai/glm-5.2", + "name": "Z.ai: GLM 5.2", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000007", + "completion": "0.0000068", + "input_cache_read": "0.000000006" + } + }, + { + "id": "z-ai/glm-5.3", + "name": "Z.ai: GLM 5.3", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000000699", + "completion": "0.0000014", + "input_cache_read": "0.0000000689" + } + }, + { + "id": "z-ai/glm-5.3-flash", + "name": "Z.ai: GLM 5.3 Flash", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000000399", + "completion": "0.0000000784", + "input_cache_read": "0.00000003" + } + }, + { + "id": "z-ai/glm-5.3-flash:batch", + "name": "Z.ai: GLM 5.3 Flash (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000005", + "completion": "0.00000018", + "input_cache_read": "0.00000001" + } + }, + { + "id": "z-ai/glm-5.3-flashx", + "name": "Z.ai: GLM 5.3 FlashX", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000037", + "completion": "0.00000125", + "input_cache_read": "0.000000075" + } + }, + { + "id": "z-ai/glm-5.3-flashx-legal", + "name": "Z.ai: GLM 5.3 FlashX Legal", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000037", + "completion": "0.00000125", + "input_cache_read": "0.000000075" + } + }, + { + "id": "z-ai/glm-5.3-prime", + "name": "Z.ai: GLM 5.3 Prime", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000028", + "completion": "0.0000088", + "input_cache_read": "0.00000056" + } + }, + { + "id": "z-ai/glm-5.3:batch", + "name": "Z.ai: GLM 5.3 (batch)", + "context_length": 1048576, + "pricing": { + "prompt": "0.00000045", + "completion": "0.000002", + "input_cache_read": "0.0000001" + } + }, + { + "id": "z-ai/glm-5v-turbo", + "name": "Z.ai: GLM 5V Turbo", + "context_length": 202752, + "pricing": { + "prompt": "0.0000012", + "completion": "0.000004", + "input_cache_read": "0.00000024" + } + }, + { + "id": "~anthropic/claude-fable-latest", + "name": "Anthropic: Claude Fable Latest", + "context_length": 1000000, + "pricing": { + "prompt": "0.000008", + "completion": "0.00004", + "input_cache_read": "0.0000002" + } + }, + { + "id": "~anthropic/claude-haiku-latest", + "name": "Anthropic: Claude Haiku Latest", + "context_length": 1000000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000005", + "input_cache_read": "0.00000001" + } + }, + { + "id": "~anthropic/claude-opus-latest", + "name": "Anthropic: Claude Opus Latest", + "context_length": 1000000, + "pricing": { + "prompt": "0.000004", + "completion": "0.00002", + "input_cache_read": "0.0000002" + } + }, + { + "id": "~anthropic/claude-sonnet-latest", + "name": "Anthropic: Claude Sonnet Latest", + "context_length": 1000000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "~deepseek/deepseek-flash-latest", + "name": "DeepSeek: DeepSeek Flash Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.000000036", + "completion": "0.0000005", + "input_cache_read": "0.00000001" + } + }, + { + "id": "~deepseek/deepseek-pro-latest", + "name": "DeepSeek: DeepSeek Pro Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000000999", + "completion": "0.000008", + "input_cache_read": "0.0000000999" + } + }, + { + "id": "~deepseek/deepseek-v4-flash-latest", + "name": "DeepSeek: DeepSeek V4 Flash Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000000434", + "completion": "0.0000003", + "input_cache_read": "0.000000035" + } + }, + { + "id": "~google/gemini-flash-latest", + "name": "Google: Gemini Flash Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000015", + "completion": "0.0000075", + "input_cache_read": "0.000000075" + } + }, + { + "id": "~google/gemini-pro-latest", + "name": "Google: Gemini Pro Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "~moonshotai/kimi-latest", + "name": "MoonshotAI: Kimi Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000001824", + "completion": "0.0000110055", + "input_cache_read": "0.00000018" + } + }, + { + "id": "~openai/gpt-astra-latest", + "name": "OpenAI: GPT Astra Latest", + "context_length": 1050000, + "pricing": { + "prompt": "0.00001", + "completion": "0.00005", + "input_cache_read": "0.000001" + } + }, + { + "id": "~openai/gpt-luna-latest", + "name": "OpenAI: GPT Luna Latest", + "context_length": 1050000, + "pricing": { + "prompt": "0.0000001", + "completion": "0.0000005", + "input_cache_read": "0.00000001" + } + }, + { + "id": "~openai/gpt-mini-latest", + "name": "OpenAI: GPT Mini Latest", + "context_length": 400000, + "pricing": { + "prompt": "0.00000075", + "completion": "0.0000045", + "input_cache_read": "0.000000075" + } + }, + { + "id": "~openai/gpt-sol-latest", + "name": "OpenAI: GPT Sol Latest", + "context_length": 1050000, + "pricing": { + "prompt": "0.000002", + "completion": "0.00001", + "input_cache_read": "0.0000001" + } + }, + { + "id": "~openai/gpt-terra-latest", + "name": "OpenAI: GPT Terra Latest", + "context_length": 1050000, + "pricing": { + "prompt": "0.000001", + "completion": "0.000005", + "input_cache_read": "0.00000005" + } + }, + { + "id": "~unbiased/pareto-latest", + "name": "Pareto Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000008", + "completion": "0.0000032", + "input_cache_read": "0.00000003" + } + }, + { + "id": "~x-ai/grok-latest", + "name": "xAI: Grok Latest", + "context_length": 500000, + "pricing": { + "prompt": "0.000002", + "completion": "0.000006", + "input_cache_read": "0.0000005" + } + }, + { + "id": "~z-ai/glm-flash-latest", + "name": "Z.ai: GLM Flash Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000000399", + "completion": "0.0000000784", + "input_cache_read": "0.00000003" + } + }, + { + "id": "~z-ai/glm-latest", + "name": "Z.ai: GLM Latest", + "context_length": 1048576, + "pricing": { + "prompt": "0.0000000699", + "completion": "0.0000014", + "input_cache_read": "0.0000000689" + } + } + ] +} diff --git a/src/pkg/dashboard/agent_model_picker_9945_test.go b/src/pkg/dashboard/agent_model_picker_9945_test.go index c332a3308d..0512a542b6 100644 --- a/src/pkg/dashboard/agent_model_picker_9945_test.go +++ b/src/pkg/dashboard/agent_model_picker_9945_test.go @@ -27,6 +27,7 @@ func modelSelectHelpersJS(t *testing.T, html string) string { extractJSFunction(t, html, "inferenceBackendDefaultModel") + "\n }\n" + extractJSFunction(t, html, "modelDisallowedByGateway") + "\n }\n" + extractJSFunction(t, html, "modelDefaultOptionLabel") + "\n }\n" + + extractJSFunction(t, html, "modelOptionPriceSuffix") + "\n }\n" + extractJSFunction(t, html, "modelSelectOptionsHtml") + "\n }\n" + extractJSFunction(t, html, "_modelIdMatches") + "\n }\n" + `var _inferenceModelCache = (typeof _inferenceModelCache !== 'undefined') ? _inferenceModelCache : {}; diff --git a/src/pkg/dashboard/api_governor.go b/src/pkg/dashboard/api_governor.go index 6b5262c7d1..f2bf29dff2 100644 --- a/src/pkg/dashboard/api_governor.go +++ b/src/pkg/dashboard/api_governor.go @@ -1932,7 +1932,7 @@ func describeEgressProxy(req *http.Request) string { // still sent as the Bearer — for watsonx the caller passes the minted IAM token // as apiKey, not the raw key. func probeModelsWithHeaders(endpoint, apiKey string, extraHeaders map[string]string) (int, error) { - modelsURL := strings.TrimRight(endpoint, "/") + "/v1/models" + modelsURL := openAIModelsURL(endpoint) req, err := http.NewRequest("GET", modelsURL, nil) if err != nil { return 0, fmt.Errorf("building request: %w", err) diff --git a/src/pkg/dashboard/api_models.go b/src/pkg/dashboard/api_models.go index f864d04185..2e3f7e6e1f 100644 --- a/src/pkg/dashboard/api_models.go +++ b/src/pkg/dashboard/api_models.go @@ -159,6 +159,14 @@ func (s *Server) handleInferenceModels(w http.ResponseWriter, r *http.Request) { if def := s.inferenceBackendDefaultModel(backend); def != "" { resp["default_model"] = def } + // An OpenRouter gateway's catalog carries prices and context windows; the + // per-agent model pickers group its ~hundreds of ids by provider and show + // "$/1M in · out" from this. Never attached to the static fallback. + if !fallback { + if gw := s.resolveGatewayForBackend(backend); gw != nil { + s.attachOpenRouterModelInfo(resp, gw.Kind, gw.Endpoint, models) + } + } jsonResponse(w, resp) } @@ -445,7 +453,7 @@ func fetchModelsFromEndpoint(baseURL, apiKey string) ([]string, error) { // headers (e.g. watsonx's X-IBM-Project-ID). apiKey, when non-empty, is sent as // the Bearer; for watsonx the caller passes the minted IAM token as apiKey. func fetchModelsWithHeaders(baseURL, apiKey string, extraHeaders map[string]string) ([]string, error) { - modelsURL := strings.TrimRight(baseURL, "/") + "/v1/models" + modelsURL := openAIModelsURL(baseURL) client := &http.Client{ Timeout: inferenceModelQueryTimeout, // SECURITY (audit F13): Go's default redirect policy PRESERVES the @@ -486,6 +494,22 @@ func fetchModelsWithHeaders(baseURL, apiKey string, extraHeaders map[string]stri return models, nil } +// openAIModelsURL builds the OpenAI-compatible model-list URL for a gateway +// endpoint. Most endpoints are stored as the server root (vLLM's +// http://host:8000, watsonx's .../ml/gateway) and get "/v1/models"; an +// endpoint that already ends in "/v1" (OpenRouter's https://openrouter.ai/api/v1, +// which is the URL the OpenRouter preset and scan-to-fund store) gets +// "/models", mirroring how the inference proxy builds /chat/completions. +// Without this an OpenRouter gateway probed /api/v1/v1/models, got a 404, and +// its model dropdown fell back to unrelated static aliases. +func openAIModelsURL(endpoint string) string { + base := strings.TrimRight(endpoint, "/") + if strings.HasSuffix(base, "/v1") { + return base + "/models" + } + return base + "/v1/models" +} + // parseModelsResponse decodes an OpenAI-style GET /v1/models body into the // list of model IDs. It is the single source of truth shared by the // model-discovery dropdown (fetchModelsFromEndpoint) and the Test Connection diff --git a/src/pkg/dashboard/gateways.go b/src/pkg/dashboard/gateways.go index e5b20fb0d0..d50b6e5f52 100644 --- a/src/pkg/dashboard/gateways.go +++ b/src/pkg/dashboard/gateways.go @@ -596,9 +596,59 @@ func (s *Server) handleGovernorGatewaysDiscover(w http.ResponseWriter, r *http.R probe := map[string]interface{}{"ok": true, "model_count": len(models)} probe["diagnostic"] = gatewayProbeDiagnosticText(probeGW, probe, key) s.appendInferenceRouteForForm(probeGW, probe) - jsonResponse(w, map[string]interface{}{"ok": true, "models": models, "diagnostic": probe["diagnostic"], "probe": probe}) + resp := map[string]interface{}{"ok": true, "models": models, "diagnostic": probe["diagnostic"], "probe": probe} + s.attachOpenRouterModelInfo(resp, kind, endpoint, models) + jsonResponse(w, resp) } +// attachOpenRouterModelInfo adds the public catalog's name, context length and +// prices for the discovered ids ("model_info") plus the curated suggestions +// still live ("suggested") when the gateway is OpenRouter, so the form's model +// picker can show "$/1M in · out · ctx" and pin the curated short list on top. +// Other kinds publish no prices on /v1/models and are left untouched. +func (s *Server) attachOpenRouterModelInfo(resp map[string]interface{}, kind, endpoint string, models []string) { + if !isOpenRouterGateway(kind, endpoint) { + return + } + or := s.openRouter() + if or == nil { + return + } + catalog := or.PublicModels() + if len(catalog) == 0 { + return + } + want := make(map[string]bool, len(models)) + for _, m := range models { + want[m] = true + } + info := make([]OpenRouterModel, 0, len(models)) + for _, m := range catalog { + if want[m.ID] { + info = append(info, m) + } + } + resp["model_info"] = info + resp["suggested"] = availableOpenRouterSuggested(or.SuggestedModels(), models) +} + +// isOpenRouterGateway reports whether a gateway is OpenRouter, by kind or — +// for a "custom" entry someone pointed at OpenRouter by hand — by endpoint +// host. +func isOpenRouterGateway(kind, endpoint string) bool { + if strings.EqualFold(kind, config.GatewayKindOpenRouter) { + return true + } + u, err := url.Parse(strings.TrimSpace(endpoint)) + if err != nil { + return false + } + return strings.EqualFold(u.Hostname(), openRouterAPIHost) +} + +// openRouterAPIHost is the public OpenRouter API host. +const openRouterAPIHost = "openrouter.ai" + // handleGovernorGatewaysTest runs a live /v1/models probe against a named // gateway's resolved endpoint + key and returns {ok, model_count, error}. func (s *Server) handleGovernorGatewaysTest(w http.ResponseWriter, r *http.Request) { diff --git a/src/pkg/dashboard/model_picker.test.js b/src/pkg/dashboard/model_picker.test.js new file mode 100644 index 0000000000..f532d18735 --- /dev/null +++ b/src/pkg/dashboard/model_picker.test.js @@ -0,0 +1,110 @@ +// Run the gateway model picker's pure helpers (js/model-picker.js) against +// recorded OpenRouter catalog shapes: filtering, provider grouping, the custom +// entry and price display. The dashboard script is one classic script, so the +// file is evaluated in a sandbox with the two globals it touches injected. +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); +const plain = value => JSON.parse(JSON.stringify(value)); + +function esc(s) { + if (typeof s !== 'string') return ''; + return s.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); +} + +function load() { + const src = fs.readFileSync(path.join(__dirname, 'static-src/js/model-picker.js'), 'utf8'); + const ctx = vm.createContext({ esc, document: { addEventListener() {} } }); + vm.runInContext(src + '\nthis.__combos = _modelCombos; this.__min = MODEL_COMBOBOX_MIN_OPTIONS;', ctx); + return ctx; +} +const P = load(); + +// Per-token prices as /api/openrouter/models serves them (model_info). +const INFO = [ + { id: 'deepseek/deepseek-v4.1-flash', name: 'DeepSeek: DeepSeek V4.1 Flash', context_length: 1048576, pricing: { prompt: 0.00000014, completion: 0.00000042, input_cache_read: 0.0000000042 } }, + { id: 'z-ai/glm-5.3', name: 'Z.ai: GLM 5.3', context_length: 1048576, pricing: { prompt: 0.0000000699, completion: 0.0000014, input_cache_read: 0.0000000689 } }, + { id: 'z-ai/glm-5.3-flash', name: 'Z.ai: GLM 5.3 Flash', context_length: 1048576, pricing: { prompt: 0.0000000399, completion: 0.0000000784 } }, + { id: 'anthropic/claude-sonnet-5.5', name: 'Anthropic: Claude Sonnet 5.5', context_length: 1000000, pricing: { prompt: 0.000002, completion: 0.00001 } }, + { id: 'openrouter/auto', name: 'Auto Router', context_length: 2000000, pricing: {} }, + { id: 'meta/free-model', name: 'Free', context_length: 200000, pricing: { prompt: 0, completion: 0 } }, +]; +const IDS = INFO.map(m => m.id).concat(['bare-model']); + +test('price per 1M: small prices keep significant digits, zero is free, missing is unknown', () => { + assert.equal(P.formatModelPricePerM(0.00000014), '$0.14'); + assert.equal(P.formatModelPricePerM(0.0000014), '$1.40'); + assert.equal(P.formatModelPricePerM(0.0000000042), '$0.0042'); + assert.equal(P.formatModelPricePerM(0.0000000699), '$0.07'); + assert.equal(P.formatModelPricePerM(0), '$0'); + assert.equal(P.formatModelPricePerM(undefined), ''); + assert.equal(P.formatModelPricePerM(null), ''); + assert.equal(P.formatModelPricePerM(-1), ''); +}); + +test('option detail shows in/out (+cached) per 1M and context, or says price unknown', () => { + const idx = P.modelInfoIndex(INFO); + assert.equal(P.modelPriceLabel(idx['deepseek/deepseek-v4.1-flash']), '$0.14 in · $0.42 out /1M · $0.0042 cached · 1M ctx'); + assert.equal(P.modelPriceLabel(idx['anthropic/claude-sonnet-5.5']), '$2.00 in · $10.00 out /1M · 1M ctx'); + assert.equal(P.modelPriceLabel(idx['openrouter/auto']), 'price unknown · 2M ctx'); + assert.equal(P.modelPriceLabel(idx['meta/free-model']), '$0 in · $0 out /1M · 200K ctx'); + assert.equal(P.modelPriceLabel(undefined), ''); +}); + +test('filter matches id or display name, every term, case-insensitively', () => { + const idx = P.modelInfoIndex(INFO); + assert.deepEqual(plain(P.filterModelOptions(IDS, 'GLM flash', idx)), ['z-ai/glm-5.3-flash']); + assert.deepEqual(plain(P.filterModelOptions(IDS, 'sonnet', idx)), ['anthropic/claude-sonnet-5.5']); + // "Z.ai" lives only in the display name. + assert.deepEqual(plain(P.filterModelOptions(IDS, 'z.ai', idx)), ['z-ai/glm-5.3', 'z-ai/glm-5.3-flash']); + assert.equal(P.filterModelOptions(IDS, '', idx).length, IDS.length); + assert.deepEqual(plain(P.filterModelOptions(IDS, 'nope', idx)), []); +}); + +test('groups by provider prefix, sorted, bare ids last, suggestions pinned first and not repeated', () => { + const groups = P.groupModelOptions(IDS, [{ id: 'deepseek/deepseek-v4.1-flash', label: 'DeepSeek' }, { id: 'retired/model', label: 'gone' }]); + assert.deepEqual(plain(groups.map(g => g.provider)), ['Suggested', 'anthropic', 'meta', 'openrouter', 'z-ai', 'other']); + assert.deepEqual(plain(groups[0].ids), ['deepseek/deepseek-v4.1-flash']); + assert.ok(!groups.some(g => g.provider === 'deepseek'), 'pinned id must not repeat in its provider group'); + assert.deepEqual(plain(groups[groups.length - 1].ids), ['bare-model']); + assert.equal(P.modelProviderOf('~anthropic/claude-sonnet-latest'), 'anthropic'); + assert.equal(P.modelProviderOf('bare'), ''); +}); + +test('listbox html: ARIA options, prices, suggestion labels, and the custom entry', () => { + P.modelComboboxHtml({ id: 'c1', ids: IDS, info: INFO, suggested: [{ id: 'z-ai/glm-5.3', label: 'GLM-5.3 (strong, cheap)' }], current: 'z-ai/glm-5.3' }); + const all = P.modelComboListHtml('c1', ''); + assert.match(all, /role="option"[^>]*data-value="z-ai\/glm-5.3"/); + assert.ok(all.includes('GLM-5.3 (strong, cheap)'), 'suggestion label shown'); + assert.ok(all.includes('$0.14 in · $0.42 out /1M'), 'price shown'); + assert.ok(all.includes('Custom… (type any model id)'), 'empty custom entry always offered'); + + const typed = P.modelComboListHtml('c1', 'acme/brand-new'); + assert.ok(typed.includes('No catalog model matches'), 'no-match notice'); + assert.match(typed, /data-custom="1"[^>]*data-arg1="acme\/brand-new"/); + assert.ok(typed.includes('Use “acme/brand-new” as a custom model id')); + + const exact = P.modelComboListHtml('c1', 'z-ai/glm-5.3'); + assert.match(exact, /data-custom="1"[^>]*data-arg1=""/, 'an exact catalog id is not re-offered as custom'); +}); + +test('combobox markup is an ARIA combobox owning a hidden listbox, value is the current id', () => { + const html = P.modelComboboxHtml({ id: 'c2', inputId: 'gw-default-model', ids: IDS, info: INFO, current: 'deepseek/deepseek-v4.1-flash', label: 'Default model' }); + assert.match(html, /]*id="gw-default-model"[^>]*role="combobox"[^>]*aria-expanded="false"[^>]*aria-controls="c2-list"/); + assert.match(html, /