thezakuloGet the newsletter
← All setup guides

Setup guide · 4 steps · about 10 minutes

How to start using gpt-oss-120b

gpt-oss-120b is an open-weight 117B-parameter Mixture-of-Experts language model from OpenAI for high-reasoning, agentic, and general-purpose use, with configurable reasoning depth, full chain-of-thought access, and native tool use including function calling, browsing, and structured output.

Built from the official docs: openrouter.ai · gpt-oss-120b - API Pricing & Benchmarks · checked 13 November 2026

Through OpenRouter

  1. 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.

  2. 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?"
    }'
  3. 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?"
      })
    )
  4. 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.

Try these first

Get every issue by email

One email a week with the written issue. Free, one-click unsubscribe

Subscribe