Posts tagged "Ai-gateway"

Subscribe to feed
  • TypeSafe Jev 1.14.0 Now Available in AI Gateway

    TypeSafe’s Jev 1.14.0 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 without managing API keys or authentication. AI Gateway handles credentials automatically, and usage is billed to your Netlify credits.

    Jev answers typed questions about your application state. Here’s an example using jev-1.14.0 to categorize a support ticket as a bug, feature request, or question:

    import { choice, TypeSafeClient } from '@typesafe-ai/sdk';
    export default async () => {
    const typesafe = new TypeSafeClient();
    const response = await typesafe.systemOne({
    model: 'jev-1.14.0',
    state: { issue: 'App crashes when I click Save.' },
    questions: {
    label: choice('Categorize this ticket', {
    bug: null,
    feature: null,
    question: null,
    }),
    },
    });
    return Response.json(response);
    };

    Jev 1.14.0 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 the TypeSafe documentation.

    Permalink to TypeSafe Jev 1.14.0 Now Available in AI Gateway
  • Google Gemini 4 Argon now available in AI Gateway and Agent Runners

    Google’s Gemini 4 Argon 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 4 Argon model:

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

    Gemini 4 Argon 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 4 Argon now available in AI Gateway and Agent Runners
  • Meta Models Now Available in AI Gateway

    Meta’s Muse Spark and Muse Wonder models are now available through Netlify’s AI Gateway with zero configuration required. Choose muse-spark-1.1 for coding, computer use, and multimodal perception; muse-spark-1.2 for coding-optimized agentic workflows; muse-spark-1.3 for long-horizon coding and agentic work with cleaner code and fewer tokens; or muse-wonder-1.0 for complex coding tasks, long-running agents, and advanced computer use.

    Use the OpenAI SDK directly in your Netlify Functions without managing API keys or authentication. AI Gateway takes care of the setup automatically. Here’s an example using Muse Wonder with the Responses API:

    import OpenAI from 'openai';
    export default async () => {
    const meta = new OpenAI();
    const response = await meta.responses.create({
    model: 'muse-wonder-1.0',
    input: 'How can AI improve my coding?'
    });
    return Response.json(response);
    };

    These Meta models also work in Scheduled Functions, Background Functions, and Edge Functions, with Netlify’s caching, rate limiting, and authentication infrastructure available automatically.

    Learn more in the AI Gateway documentation and explore the models on Meta’s developer site.

    Permalink to Meta Models Now Available in AI Gateway
  • Claude Haiku 5.5 now available in AI Gateway and Agent Runners

    Anthropic’s Claude Haiku 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 Haiku 5.5 with the Messages API:

    import Anthropic from '@anthropic-ai/sdk';
    export default async () => {
    const anthropic = new Anthropic();
    const response = await anthropic.messages.create({
    model: 'claude-haiku-5-5',
    max_tokens: 1024,
    messages: [
    { role: 'user', content: 'Give a concise explanation of how AI works.' }
    ],
    });
    return Response.json(response);
    };

    Claude Haiku 5.5 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.

    Permalink to Claude Haiku 5.5 now available in AI Gateway and Agent Runners
  • OpenAI Decisions API now available in AI Gateway

    OpenAI’s Decisions API is now available through Netlify’s AI Gateway with zero configuration required.

    Use the OpenAI SDK directly in your Netlify Functions to classify, route, and score inputs without managing API keys. Instead of generating prose, the Decisions API answers questions you define about an input, and choice answers are always one of the options you declared. That means there’s no output to parse and nothing unexpected to handle before you branch on the result. The Decisions API is in beta and currently runs on gpt-6-luna.

    Here’s a Function for an online store that sorts incoming return requests by reason:

    import type { Config } from "@netlify/functions";
    import OpenAI from "openai";
    export default async (req: Request) => {
    const openai = new OpenAI();
    const { answers } = await openai.decisions.create({
    model: "gpt-6-luna",
    input: await req.text(),
    questions: [
    {
    type: "choice",
    name: "reason",
    instructions: "Why is the customer returning this item?",
    choices: [
    { value: "wrong_size" },
    { value: "defective" },
    { value: "not_as_described" },
    { value: "changed_mind" },
    ],
    },
    ],
    });
    return Response.json(answers[0]);
    };
    export const config: Config = { path: "/api/returns", method: "POST" };

    Send it “The jacket fits well, but the zipper came off the second time I wore it” and you get back:

    {
    "type": "choice",
    "name": "reason",
    "choice": "defective",
    "probabilities": [
    { "value": "wrong_size", "probability": 0.01 },
    { "value": "defective", "probability": 0.95 },
    { "value": "not_as_described", "probability": 0.03 },
    { "value": "changed_mind", "probability": 0.01 }
    ],
    "confidence": 0.93
    }

    choice is safe to branch on directly, so you can send a prepaid label for defective items or offer an exchange for the wrong size, and use confidence to pass unclear requests to your support team.

    Learn more in the AI Gateway documentation and the OpenAI API reference.

    Permalink to OpenAI Decisions API now available in AI Gateway
  • Google’s Gemini Nano Banana 2.1 now available in AI Gateway

    Google’s Gemini Nano Banana 2.1 is now available through Netlify AI Gateway. You can call this image generation model from Netlify Functions without configuring API keys; AI Gateway provides the connection to Google for you.

    Use the Google Gen AI SDK with the model ID gemini-nano-banana-2.1. Here’s an example that generates an image from a prompt and returns it directly from a Function:

    import { GoogleGenAI } from '@google/genai';
    // Netlify Function: Generate an image with Gemini Nano Banana 2.1 and return it directly.
    // Usage (GET): /.netlify/functions/nano-banana-2-1?prompt=Your+prompt+here
    // Returns: binary image (PNG/JPEG/etc) with proper content-type. If no image, JSON error.
    export default async (request: Request) => {
    const url = new URL(request.url);
    const prompt = url.searchParams.get('prompt') || 'two happy bananas holding flashlights';
    const ai = new GoogleGenAI({});
    try {
    const response = await ai.models.generateContent({
    model: 'gemini-nano-banana-2.1',
    contents: prompt,
    config: {
    imageConfig: {
    aspectRatio: '16:9',
    imageSize: '1K'
    }
    }
    });
    let imagePart = null;
    for (const part of response.candidates[0].content.parts) {
    if (part.inlineData) {
    imagePart = part.inlineData;
    break;
    }
    }
    const bytes = Buffer.from(imagePart.data, 'base64');
    const mimeType = imagePart.mimeType || 'image/png';
    return new Response(bytes, {
    status: 200,
    headers: {
    'Content-Type': mimeType,
    'Cache-Control': 'no-store'
    }
    });
    } catch (err) {
    return new Response(JSON.stringify({ error: String(err), prompt }), {
    status: 500,
    headers: { 'Content-Type': 'application/json' }
    });
    }
    };

    Gemini Nano Banana 2.1 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.

    Permalink to Google’s Gemini Nano Banana 2.1 now available in AI Gateway
  • GPT-6.1 Sol now available in AI Gateway and Agent Runners

    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.

    Permalink to GPT-6.1 Sol now available in AI Gateway and Agent Runners
  • Claude Sonnet 5.5 now available in AI Gateway and Agent Runners

    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.

    Permalink to Claude Sonnet 5.5 now available in AI Gateway and Agent Runners
  • Claude Opus 5.5 now available in AI Gateway and Agent Runners

    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.

    Permalink to Claude Opus 5.5 now available in AI Gateway and Agent Runners
Next page