Built from the official docs: openrouter.ai · gpt-oss-120b - API Pricing & Benchmarks · checked 13 November 2026
Through OpenRouter
Get an API key
Sign up at OpenRouter and create an API key in your dashboard. OpenRouter gives you access to many models through a single endpoint.
Call the model with curl
Send an HTTP POST to the OpenRouter responses endpoint. Replace the placeholder with your key; the model slug for this model is openai/gpt-oss-120b.
curl https://openrouter.ai/api/v1/responses \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <OPENROUTER_API_KEY>" \ -d '{ "model": "openai/gpt-oss-120b", "input": "What is the meaning of life?" }'Or call it from Python
Use the requests library to POST to the same endpoint. The HTTP-Referer and X-OpenRouter-Title headers are optional and only affect OpenRouter leaderboard attribution.
import requests import json response = requests.post( url="https://openrouter.ai/api/v1/responses", headers={ "Authorization": "Bearer <OPENROUTER_API_KEY>", }, data=json.dumps({ "model": "openai/gpt-oss-120b", "input": "What is the meaning of life?" }) )Or use the OpenAI SDK pointed at OpenRouter
OpenRouter is OpenAI-compatible, so you can use the OpenAI SDK as a drop-in replacement by setting the base URL to OpenRouter.
from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key="<OPENROUTER_API_KEY>", ) response = client.responses.create( model="openai/gpt-oss-120b", input="What is the meaning of life?" ) print(response.output_text)
Check it worked
You get a completed response containing generated text in the output; in the OpenAI SDK example, response.output_text prints the model's reply.