gpt-5.1-codex
OpenAI logo

GPT-5.1-Codex

gpt-5.1-codex
OpenAI
GPT-5.1-Codex is a version of GPT-5 optimized for agentic coding tasks in Codex or similar environments. It's available in the Responses API only and the underlying model snapshot will be regularly updated.

Pricing

  • Input Tokens: $1.250 /M tokens
  • Output Tokens: $10.000 /M tokens
  • Cache Read: $0.125 /M tokens

Input Modalities

  • Text
  • Vision

Output Modalities

  • Text

Capabilities

  • Thinking
  • Tool calling
  • Structured outputs

Try this model

Python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["AIHUBMIX_API_KEY"],
    base_url="https://aihubmix.com/v1",
)

response = client.chat.completions.create(
    model="gpt-5.1-codex",
    messages=[
      {
        "role": "user",
        "content": "Hello, how are you?"
      }
    ],
    max_tokens=1024,
    stream=False,
)

print(response.choices[0].message.content)

Frequently asked questions

What is gpt-5.1-codex?

GPT-5.1-Codex is a version of GPT-5 optimized for agentic coding tasks in Codex or similar environments. It's available in the Responses API only and the underlying model snapshot will be regularly updated.