Posts tagged "Ai-gateway"

Subscribe to feed
  • TypeSafe Jev now available in AI Gateway

    TypeSafe’s Jev model is now available through Netlify’s AI Gateway with zero configuration required.

    Install @typesafe-ai/sdk and 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: choice picks one option from a set, score rates against ordered levels, and noul returns 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-latest alias, currently jev-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 choice helper declares the three possible destinations up front, so answers.team.choice comes 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.

    Permalink to TypeSafe Jev now available in AI Gateway
  • DeepSeek V4.1 Flash now available in AI Gateway

    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.

    Permalink to DeepSeek V4.1 Flash now available in AI Gateway
  • ChatGPT Images 2.5 now available in AI Gateway and Agent Runners

    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-flare or gpt-image-2.5-sunburst to 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-flare model:

    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.

    Permalink to ChatGPT Images 2.5 now available in AI Gateway and Agent Runners
  • GPT-6 Astra now available in AI Gateway and Agent Runners

    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.

    Permalink to GPT-6 Astra now available in AI Gateway and Agent Runners
  • Google Gemini 3.8 Flash now available in AI Gateway and Agent Runners

    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.

    Permalink to Google Gemini 3.8 Flash now available in AI Gateway and Agent Runners
  • Claude Fable 5.1 now available in AI Gateway and Agent Runners

    Anthropic’s Claude Fable 5.1 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. The AI Gateway handles everything automatically. Here’s an example using the Claude Fable 5.1 model:

    import Anthropic from '@anthropic-ai/sdk';
    export default async () => {
    const anthropic = new Anthropic();
    const response = await anthropic.messages.create({
    model: 'claude-fable-5-1',
    max_tokens: 4096,
    messages: [
    {
    role: 'user',
    content: 'How can AI improve my coding?'
    }
    ]
    });
    return new Response(JSON.stringify(response), {
    headers: { 'Content-Type': 'application/json' }
    });
    };

    Claude Fable 5.1 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.

    Permalink to Claude Fable 5.1 now available in AI Gateway and Agent Runners
  • Google Gemini 3.7 Flash now available in AI Gateway and Agent Runners

    Google’s Gemini 3.7 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.7 Flash model:

    import { GoogleGenAI } from '@google/genai';
    export default async () => {
    const ai = new GoogleGenAI({});
    const response = await ai.models.generateContent({
    model: 'gemini-3.7-flash',
    contents: 'How can AI improve my coding?'
    });
    return Response.json(response);
    };

    Gemini 3.7 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.

    Permalink to Google Gemini 3.7 Flash now available in AI Gateway and Agent Runners
  • AI Gateway adds OpenRouter support for more AI model choice

    The AI Gateway now supports OpenRouter, giving you access to models from providers beyond Netlify’s direct integrations (OpenAI, Anthropic, Google Gemini).

    This partnership opens up models from providers like DeepSeek, Meta, Mistral, Qwen, and xAI, all billed through your existing Netlify credits.

    Learn more about our OpenRouter partnership through the Netlify blog on open models.

    Supported models

    For a full list of models available on OpenRouter, visit OpenRouter’s models page.

    Note that Netlify only allows requests through OpenRouter for model providers that support a Zero Data Retention (ZDR) policy, meaning your prompts and outputs are never stored nor trained on. Models on OpenRouter that do not have any available provider guaranteeing this policy (at the time of your request) are not available via Netlify.

    Set up OpenRouter for AI Gateway

    As with the other providers, Netlify automatically injects OPENROUTER_API_KEY and OPENROUTER_BASE_URL into your Netlify Functions, Edge Functions, and Preview Server (unless you’ve already set your own values for either).

    You can call an OpenRouter-served model using whichever client you prefer:

    • OpenRouter SDK (@openrouter/sdk): pass OPENROUTER_BASE_URL explicitly as serverURL when constructing the client, this is the one exception where the base URL isn’t picked up automatically.
    • OpenAI SDK: works out of the box, no extra config. Just pass a model ID in OpenRouter notation (e.g. deepseek/deepseek-v4-flash-0731).
    • REST API: call ${OPENROUTER_BASE_URL}/chat/completions with a bearer token from OPENROUTER_API_KEY.

    Whichever client you use, you can find model IDs to pass in the OpenRouter models directory.

    Note that a model listed in OpenRouter’s directory will not work through the AI Gateway if it does not support a Zero Data Retention (ZDR) policy since Netlify only routes to OpenRouter providers with this support.

    To learn more about using AI Gateway, check out our official AI Gateway Netlify docs.

    Permalink to AI Gateway adds OpenRouter support for more AI model choice
  • GPT-5.6 Luna and Terra price reduction on AI Gateway

    GPT-5.6 Luna now costs 80% less and GPT-5.6 Terra is 20% less through Netlify AI Gateway, making both models more cost-efficient for production AI workloads.

    These reductions improve the price-performance tradeoff across the GPT-5.6 model family, giving teams more flexibility to choose the right balance of capability and cost for each workload.

    Learn more in OpenAI’s announcement, Advancing the price-performance frontier with GPT-5.6.

    Permalink to GPT-5.6 Luna and Terra price reduction on AI Gateway
Next page