GPT 5 Nano

GPT 5 Nano is a reasoning model by OpenAI with vision, function calling, web search, prompt caching, structured output — designed for complex, multi-step problem solving where accuracy matters more than speed. It supports a 272K token context window with up to 128K tokens of output. Priced at $0.05 per million input tokens and $0.4 per million output tokens, it is one of the most cost-efficient options in its class. Access GPT 5 Nano through Inworld Router with OpenAI SDK compatibility, built-in failover, and intelligent routing across providers.

→ Function Calling Web Search Reasoning Prompt Caching Response Schema Vision reasoning Capability

Step 1 — Create Router

cURL

curl --location 'https://api.inworld.ai/router/v1/routers' \
--header 'Authorization: Basic <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
  "name": "compare-frontier-models",
  "defaultRoute": {
    "route_id": "default",
    "variants": [
      {
        "variant": {
          "variant_id": "openai/gpt-5-nano-a",
          "model_id": "openai/gpt-5-nano"
        },
        "weight": 33
      },
      {
        "variant": {
          "variant_id": "openai/gpt-3.5-turbo-b",
          "model_id": "openai/gpt-3.5-turbo"
        },
        "weight": 33
      },
      {
        "variant": {
          "variant_id": "openai/gpt-4.1-c",
          "model_id": "openai/gpt-4.1"
        },
        "weight": 34
      }
    ]
  }
}'

Python

import requests

response = requests.post(
    "https://api.inworld.ai/router/v1/routers",
    headers={
        "Authorization": "Basic <your-api-key>",
        "Content-Type": "application/json",
    },
    json={
        "name": "compare-frontier-models",
        "defaultRoute": {
            "route_id": "default",
            "variants": [
                {
                    "variant": {
                        "variant_id": "openai/gpt-5-nano-a",
                        "model_id": "openai/gpt-5-nano"
                    },
                    "weight": 33
                },
                {
                    "variant": {
                        "variant_id": "openai/gpt-3.5-turbo-b",
                        "model_id": "openai/gpt-3.5-turbo"
                    },
                    "weight": 33
                },
                {
                    "variant": {
                        "variant_id": "openai/gpt-4.1-c",
                        "model_id": "openai/gpt-4.1"
                    },
                    "weight": 34
                }
            ]
        }
    },
)
print(response.json())

JavaScript

const response = await fetch(
"https://api.inworld.ai/router/v1/routers",
{
    method: "POST",
    headers: {
      Authorization: "Basic <your-api-key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "compare-frontier-models",
      defaultRoute: {
        route_id: "default",
        variants: [
          {
            variant: {
              variant_id: "openai/gpt-5-nano-a",
              model_id: "openai/gpt-5-nano",
            },
            weight: 33,
          },
          {
            variant: {
              variant_id: "openai/gpt-3.5-turbo-b",
              model_id: "openai/gpt-3.5-turbo",
            },
            weight: 33,
          },
          {
            variant: {
              variant_id: "openai/gpt-4.1-c",
              model_id: "openai/gpt-4.1",
            },
            weight: 34,
          },
        ],
      },
    }),
}
);
const data = await response.json();
console.log(data);

Step 2 — Chat Completion

cURL

curl --location 'https://api.inworld.ai/v1/chat/completions' \
--header 'Authorization: Basic <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
  "model": "inworld/compare-frontier-models",
  "messages": [{"role": "user", "content": "Hello!"}]
}'

Python

from openai import OpenAI

client = OpenAI(
    api_key="<your-api-key>",
    base_url="https://api.inworld.ai/v1",
)

response = client.chat.completions.create(
    model="inworld/compare-frontier-models",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)

JavaScript

import OpenAI from "openai";

const client = new OpenAI({
    apiKey: "<your-api-key>",
    baseURL: "https://api.inworld.ai/v1",
});

const response = await client.chat.completions.create({
    model: "inworld/compare-frontier-models",
    messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);

GPT 5 Nano pricing and providers

Access GPT 5 Nano through OpenAI via Inworld Router or Realtime API. By using the AI provider(s) below you acknowledge you reviewed and agree to their terms listed in the Legal section under the AI provider's name.

Provider Context Max Output Input ($/1M tokens) Output ($/1M tokens) Capabilities Input modalities Output modalities
OpenAI 272K 128K $0.05 $0.40 +4

Other OpenAI models available through Inworld

Compare GPT 5 Nano with other OpenAI models available through Inworld Router or Realtime API.

Model Context Max Output Input ($/1M tokens) Output ($/1M tokens) Capabilities Input modalities Output modalities Inference provider
GPT 3.5 Turbo 16.4K 4.1K $0.50 $1.50 OpenAI
GPT 4.1 1M 32.8K $2.00 $8.00 +2 OpenAI
GPT 4.1 Mini 1M 32.8K $0.40 $1.60 +2 OpenAI
GPT 4.1 Nano 1M 32.8K $0.10 $0.40 +1 OpenAI
GPT 4o 128K 16.4K $2.50 $10.00 +1 OpenAI
GPT 5 Mini 272K 128K $0.25 $2.00 +4 OpenAI
Openai/gpt Oss 120b 131.1K 131.1K $0.039 $0.19 +2 DeepInfra

Start building with GPT 5 Nano

Access GPT 5 Nano and every other model through Inworld Router or Realtime API. Create your free account and start routing in minutes.

Get Started Free Contact Sales