Use when an agent must price an LLM call or pick the cheapest model
1gateway.dev/v1/ai/llm-prices
Use when an agent must price an LLM call or pick the cheapest model. Input: model (up to 5, comma list) plus optional input_tokens, output_tokens, requests; or no model plus mode, provider, min_context, capabilities (vision, function_calling...). Output: JSON USD per 1M input/output tokens, cached/batch prices, context window, provider, capabilities, cost estimate or cheapest ranking, as_of + sour
GET
https://1gateway.dev/v1/ai/llm-pricesUptime100% of 2 checks in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://1gateway.dev/v1/ai/llm-prices?capabilities=vision&include_deprecated=false&input_tokens=12000&limit=5&min_context=100000&mode=chat&model=gpt-4o&output_tokens=800&provider=openai&requests=1000");
console.log(await res.json());Example input
{
"capabilities": "vision",
"include_deprecated": "false",
"input_tokens": 12000,
"limit": 5,
"min_context": 100000,
"mode": "chat",
"model": "gpt-4o",
"output_tokens": 800,
"provider": "openai",
"requests": 1000
}