---
title: "OpenAI Decisions API now available in AI Gateway"
description: "Call OpenAI’s Decisions API through Netlify AI Gateway with zero configuration. Get typed routing answers from GPT-6 Luna with no API keys."
source: "https://www.netlify.com/changelog/openai-decisions-api-ai-gateway/"
last_updated: "2026-10-08T01:25:02.000Z"
---
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](https://docs.netlify.com/build/ai-gateway/overview/) and the [OpenAI API reference](https://platform.openai.com/docs/api-reference/decisions).