Posts tagged "Ai-gateway"
-
OpenAI’s GPT-6.1 Sol model is now available through Netlify’s AI Gateway and Agent Runners with zero configuration required.
Use the OpenAI SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using GPT-6.1 Sol with the Responses API:
import OpenAI from 'openai';export default async () => {const openai = new OpenAI();const response = await openai.responses.create({model: 'gpt-6.1-sol',input: 'Give a concise explanation of how AI works.',});return Response.json(response);};GPT-6.1 Sol is also available across Scheduled Functions, Background Functions, and Edge Functions. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.
-
Anthropic’s Claude Sonnet 5.5 model is now available through Netlify’s AI Gateway and Agent Runners with zero configuration required.
Use the Anthropic SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using Claude Sonnet 5.5:
import Anthropic from '@anthropic-ai/sdk';export default async () => {const anthropic = new Anthropic();const response = await anthropic.messages.create({model: 'claude-sonnet-5-5',max_tokens: 4096,messages: [{role: 'user',content: 'How can AI improve my coding?'}]});return Response.json(response);};Claude Sonnet 5.5 is also available across Background Functions, Scheduled Functions, and Edge Functions. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.
-
Anthropic’s Claude Opus 5.5 model is now available through Netlify’s AI Gateway and Agent Runners with zero configuration required.
Use the Anthropic SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using Claude Opus 5.5:
import Anthropic from '@anthropic-ai/sdk';export default async () => {const anthropic = new Anthropic();const response = await anthropic.messages.create({model: 'claude-opus-5-5',max_tokens: 4096,output_config: { effort: 'medium' },messages: [{role: 'user',content: 'How can AI improve my coding?',},],});return new Response(JSON.stringify(response), {headers: { 'Content-Type': 'application/json' },});};Claude Opus 5.5 is also available across Background Functions, Scheduled Functions, and Edge Functions. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.
-
OpenAI’s GPT-6 Sol and GPT-6 Luna models are now available through Netlify’s AI Gateway and Agent Runners with zero configuration required.
Use the OpenAI SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using GPT-6 Sol with the Responses API:
import OpenAI from 'openai';export default async () => {const openai = new OpenAI();const response = await openai.responses.create({model: 'gpt-6-sol',input: 'Give a concise explanation of how AI works.',});return Response.json(response);};GPT-6 Sol and GPT-6 Luna are also available across Scheduled Functions, Background Functions, and Edge Functions. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.
-
TypeSafe’s Jev model is now available through Netlify’s AI Gateway with zero configuration required.
Install
@typesafe-ai/sdkand use it directly in your Netlify Functions — no API keys to create, no provider config, no base URLs to wire up. AI Gateway handles credentials automatically, and usage is billed to your Netlify credits like every other model in the gateway.Jev is TypeSafe’s first “System One” model, and it works differently from the chat models you’re used to. Instead of generating prose, you send it your program state along with a set of typed questions, and it returns typed answers with calibrated probabilities. There are three question primitives:
choicepicks one option from a set,scorerates against ordered levels, andnoulreturns a yes/no probability between 0 and 1. Answers are constrained to the options you declare, so there’s no JSON parsing or schema coercion on your end.Every question in a request is evaluated in parallel against the same state, which means batching a dozen questions into one call costs little more than asking one. State and questions share a budget of roughly 32,000 tokens — about 150,000 characters of English text — and TypeSafe reports end-to-end response times of 70–500ms, making Jev a good fit for classification, routing, extraction, scoring, and guardrail checks on the request path. The SDK defaults to the
jev-latestalias, currentlyjev-1.13.0, and requires Node.js 20 or newer.Here’s a Function that routes an incoming contact form submission to sales, support, or spam:
import type { Config, Context } from "@netlify/functions";import { choice, TypeSafeClient } from "@typesafe-ai/sdk";export default async (req: Request, context: Context) => {const client = new TypeSafeClient();const { answers } = await client.systemOne({state: await req.json(),questions: {team: choice("Route this contact form submission", {sales: null,support: null,spam: null,}),},});return Response.json({team: answers.team.choice,requestId: context.requestId,});};export const config: Config = { path: "/api/route", method: "POST" };The
choicehelper declares the three possible destinations up front, soanswers.team.choicecomes back as one of them and nothing else, which makes the response safe to branch on directly. Each answer also carries a probability distribution and a confidence value, so you can act on high-confidence decisions and escalate the rest to a human.Learn more in the AI Gateway documentation and the TypeSafe documentation.
-
DeepSeek V4.1 Flash is now available through OpenRouter on Netlify’s AI Gateway with zero configuration required.
Use the OpenRouter SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using DeepSeek V4.1 Flash:
import { OpenRouter } from '@openrouter/sdk';export default async () => {const client = new OpenRouter();const response = await client.chat.send({chatRequest: {model: 'deepseek/deepseek-v4.1-flash',messages: [{ role: 'user', content: 'How can AI improve my coding?' }],maxTokens: 400,},});return Response.json(response);};DeepSeek V4.1 Flash is available across Background Functions, Scheduled Functions, and Edge Functions. You get automatic access to Netlify’s rate limiting and authentication infrastructure.
Learn more in the AI Gateway documentation and OpenRouter documentation.
-
OpenAI’s ChatGPT Images 2.5 models are now available through Netlify’s AI Gateway and Agent Runners with zero configuration required. Use
gpt-image-2.5-flareorgpt-image-2.5-sunburstto generate images for your applications.Use the OpenAI SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using the
gpt-image-2.5-flaremodel:import OpenAI from 'openai';const ai = new OpenAI();export default async (req, context) => {const response = await ai.images.generate({model: 'gpt-image-2.5-flare',prompt: 'A golden retriever working at a laptop in a sunny startup office',size: '1024x1024',quality: 'low',output_format: 'jpeg',output_compression: 80});const imageBuffer = Buffer.from(response.data[0].b64_json, 'base64');return new Response(imageBuffer, {status: 200,headers: {'content-type': 'image/jpeg','cache-control': 'no-store'}});};Both ChatGPT Images 2.5 models are available across standard Functions, Background Functions, Scheduled Functions, Edge Functions, and Agent Runners. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.
-
OpenAI’s GPT-6 Astra model is now available through Netlify’s AI Gateway and Agent Runners with zero configuration required.
Use the OpenAI SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway handles everything automatically. Here’s an example using GPT-6 Astra with the Responses API:
import OpenAI from 'openai';export default async () => {const openai = new OpenAI();const response = await openai.responses.create({model: 'gpt-6-astra',input: 'Give a concise explanation of how AI works.',});return Response.json(response);};GPT-6 Astra is also available across Background Functions, Scheduled Functions, and Edge Functions. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.
-
Google’s Gemini 3.8 Flash model is now available through Netlify’s AI Gateway and Agent Runners with zero configuration required.
Use the Google GenAI SDK directly in your Netlify Functions without managing API keys or authentication. The AI Gateway handles everything automatically. Here’s an example using the Gemini 3.8 Flash model:
import { GoogleGenAI } from '@google/genai';export default async () => {const ai = new GoogleGenAI({});const response = await ai.models.generateContent({model: 'gemini-3.8-flash',contents: 'How can AI improve my coding?'});return Response.json(response);};Gemini 3.8 Flash is available for all Function types and Agent Runners. You get automatic access to Netlify’s caching, rate limiting, and authentication infrastructure.
Learn more in the AI Gateway documentation and Agent Runners documentation.