Unlock exclusive introductory pricing for the newly launched Gemini 3.5 Flash.
O

GPT 5.1 Codex

ๅ…ฅๅŠ›:$1/M
ๅ‡บๅŠ›:$8/M
ๆ–‡่„ˆ:400K
ๆœ€ๅคงๅ‡บๅŠ›:128K
ใƒชใƒชใƒผใ‚นๆ—ฅ:Nov 13, 2025

GPT-5.1-Codex is a high-performance large language model focused on code generation and understanding, with enhanced capabilities for complex programming tasks, code reasoning, and production-level applications.

ๆ–ฐ็€
ๅ•†็”จๅˆฉ็”จ

GPT 5.1 CodexใฎPlayground

GPT 5.1 CodexใฎPlaygroundใ‚’ๆŽข็ดข โ€” ใƒขใƒ‡ใƒซใ‚’ใƒ†ใ‚นใƒˆใ—ใ€ใƒชใ‚ขใƒซใ‚ฟใ‚คใƒ ใงใ‚ฏใ‚จใƒชใ‚’ๅฎŸ่กŒใ™ใ‚‹ใ‚คใƒณใ‚ฟใƒฉใ‚ฏใƒ†ใ‚ฃใƒ–ใช็’ฐๅขƒใ€‚ใƒ—ใƒญใƒณใƒ—ใƒˆใ‚’่ฉฆใ—ใ€ใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’่ชฟๆ•ดใ—ใ€ๅณๅบงใซๅๅพฉใ—ใฆ้–‹็™บใ‚’ๅŠ ้€Ÿใ—ใ€ใƒฆใƒผใ‚นใ‚ฑใƒผใ‚นใ‚’ๆคœ่จผใ—ใพใ™ใ€‚

What is the GPT-5.1-Codex ?

gpt-5.1-codex is a specialized member of OpenAIโ€™s GPT-5.1 family, optimized for agentic, long-running software-engineering workflows (code generation, patching, large refactors, structured code review and multi-step agentic tasks).

Features

  • Agentic tooling first โ€” built to emit structured patch operations and shell calls (the model can produce apply_patch_call and shell_call items which your integration executes and returns outputs for). This enables reliable create/update/delete operations across files.
  • Responses API only โ€” Codex variants in the 5.1 line are available only via the Responses API and are tuned for tool-driven workflows rather than conversational chat flows.
  • Adaptive reasoning and latency modes โ€” GPT-5.1 family introduces reasoning_effort (including a none mode for latency-sensitive interactions) and extended prompt caching (up to 24h) to improve interactive coding sessions. Codex models emphasize efficient iterative work.
  • Steerability and code personality โ€” tuned to be more โ€œdeliberateโ€ for fewer wasted actions in long sessions and to produce clearer update messages for PRs and patch diffs.
  • Codex-specific UX: IDE/CLI default model setting, session resume, context compaction, image/screenshot inputs for frontend tasks in Codex Web.

Technical details & operational considerations

  • API surface: gpt-5.1-codex is served via the Responses API (not Chat Completions). The Responses API supports tool calling, structured outputs, streaming, and the apply_patch and shell tools that Codex leverages.
  • Tool calling semantics: include tools in the request (tools: ). The model may emit apply_patch_call or shell_call items; your code executes the patch/command and returns outputs back to the model in the follow-up request. The Responses API is agentic by default so it can orchestrate multi-step plans.
  • Reasoning tuning: use reasoning={"effort":"none"} (Responses API) for minimal thinking/low latency, or {"effort":"medium"}/high for thorough code reasoning and validation. Note that none improves parallel tool-calling and latency-sensitive code edits.
  • Session persistence / context: Codex and the Responses API support session resume and context compaction to summarize older context as you approach the context limit, enabling extended interactive sessions without manual context trimming.
  • Interactive IDE workflows: intelligent code completion, PR drafting, inline patching and multi-turn code edits.
  • Agentic automation: long-running agent tasks that require applying a sequence of patches, running shell steps, and validating via tests.
  • Code review & refactoring: higher-quality diffs and structured review comments (SWE-bench improvements reported by partners).
  • Test generation & validation: generate unit/integration tests, run them via a controlled shell tool, iterate on failures.

How to use GPT-5.1 Codex API

Required Steps

  • Log in to cometapi.com. If you are not our user yet, please register first.
  • Sign into your CometAPI console.
  • Get the access credential API key of the interface. Click โ€œAdd Tokenโ€ at the API token in the personal center, get the token key: sk-xxxxx and submit.

Use Method

  1. Select the โ€œgpt-5.1-codexโ€ endpoint to send the API request and set the request body. The request method and request body are obtained from our website API doc. Our website also provides Apifox test for your convenience.
  2. Replace <YOUR_API_KEY> with your actual CometAPI key from your account.
  3. Insert your question or request into the content fieldโ€”this is what the model will respond to.
  4. . Process the API response to get the generated answer.

CometAPI provides a fully compatible REST APIโ€”for seamless migration. Key details to Responses

See also GPT-5.1 API and GPT-5.1-Chat-latest API

GPT 5.1 Codexใฎๆ–™้‡‘

GPT 5.1 Codexใฎ็ซถไบ‰ๅŠ›ใฎใ‚ใ‚‹ไพกๆ ผ่จญๅฎšใ‚’ใ”็ขบ่ชใใ ใ•ใ„ใ€‚ใ•ใพใ–ใพใชไบˆ็ฎ—ใ‚„ๅˆฉ็”จใƒ‹ใƒผใ‚บใซๅฏพๅฟœใงใใ‚‹ใ‚ˆใ†่จญ่จˆใ•ใ‚Œใฆใ„ใพใ™ใ€‚ๆŸ”่ปŸใชใƒ—ใƒฉใƒณใซใ‚ˆใ‚Šใ€ไฝฟ็”จใ—ใŸๅˆ†ใ ใ‘ใŠๆ”ฏๆ‰•ใ„ใ„ใŸใ ใ‘ใ‚‹ใŸใ‚ใ€่ฆไปถใฎๆ‹กๅคงใซๅˆใ‚ใ›ใฆ็ฐกๅ˜ใซใ‚นใ‚ฑใƒผใƒซใ‚ขใƒƒใƒ—ใงใใพใ™ใ€‚GPT 5.1 CodexใŒใ‚ณใ‚นใƒˆใ‚’็ฎก็†ใ—ใชใŒใ‚‰ใ€ใŠๅฎขๆง˜ใฎใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆใ‚’ใฉใฎใ‚ˆใ†ใซๅผทๅŒ–ใงใใ‚‹ใ‹ใ‚’ใ”่ฆงใใ ใ•ใ„ใ€‚

ModelComet Price (USD / M Tokens)Official Price (USD / M Tokens)Discount
gpt-5.1-codex
ๅ…ฅๅŠ›:$1/M
ๅ‡บๅŠ›:$8/M
ๅ…ฅๅŠ›:$1.25/M
ๅ‡บๅŠ›:$10/M
-20%
gpt-5.1-codex-max
ๅ…ฅๅŠ›:$1/M
ๅ‡บๅŠ›:$8/M
ๅ…ฅๅŠ›:$1.25/M
ๅ‡บๅŠ›:$10/M
-20%

GPT 5.1 Codexใฎใ‚ตใƒณใƒ—ใƒซใ‚ณใƒผใƒ‰ใจAPI

gpt-5.1-codex is a specialized member of OpenAIโ€™s GPT-5.1 family, optimized for agentic, long-running software-engineering workflows (code generation, patching, large refactors, structured code review and multi-step agentic tasks).

curl https://api.cometapi.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -d '{
    "model": "gpt-5.1-codex",
    "input": "Tell me a three sentence bedtime story about a unicorn."
  }'

cURL Code Example

curl https://api.cometapi.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -d '{
    "model": "gpt-5.1-codex",
    "input": "Tell me a three sentence bedtime story about a unicorn."
  }'

JavaScript Code Example

import OpenAI from "openai";

// Get your CometAPI key from https://api.cometapi.com/console/token, and paste it here
const api_key = process.env.COMETAPI_KEY;
const base_url = "https://api.cometapi.com/v1";

const openai = new OpenAI({
  apiKey: api_key,
  baseURL: base_url,
});

const response = await openai.responses.create({
  model: "gpt-5.1-codex",
  input: "Tell me a three sentence bedtime story about a unicorn.",
});

console.log(response);

GPT 5.1 Codexใฎใƒใƒผใ‚ธใƒงใƒณ

GPT 5.1 Codexใซ่ค‡ๆ•ฐใฎใ‚นใƒŠใƒƒใƒ—ใ‚ทใƒงใƒƒใƒˆใŒๅญ˜ๅœจใ™ใ‚‹็†็”ฑใจใ—ใฆใฏใ€ใ‚ขใƒƒใƒ—ใƒ‡ใƒผใƒˆๅพŒใฎๅ‡บๅŠ›ๅค‰ๅ‹•ใซใ‚ˆใ‚Šๆ—ง็‰ˆใ‚นใƒŠใƒƒใƒ—ใ‚ทใƒงใƒƒใƒˆใฎไธ€่ฒซๆ€ง็ถญๆŒใŒๅฟ…่ฆใชๅ ดๅˆใ€้–‹็™บ่€…ใซ้ฉๅฟœใƒป็งป่กŒๆœŸ้–“ใ‚’ๆไพ›ใ™ใ‚‹ใŸใ‚ใ€ใ‚ฐใƒญใƒผใƒใƒซ/ใƒชใƒผใ‚ธใƒงใƒŠใƒซใ‚จใƒณใƒ‰ใƒใ‚คใƒณใƒˆใซๅฏพๅฟœใ™ใ‚‹็•ฐใชใ‚‹ใ‚นใƒŠใƒƒใƒ—ใ‚ทใƒงใƒƒใƒˆใซใ‚ˆใ‚‹ใƒฆใƒผใ‚ถใƒผไฝ“้จ“ๆœ€้ฉๅŒ–ใชใฉใŒ่€ƒใˆใ‚‰ใ‚Œใพใ™ใ€‚ๅ„ใƒใƒผใ‚ธใƒงใƒณใฎ่ฉณ็ดฐใชๅทฎ็•ฐใซใคใ„ใฆใฏใ€ๅ…ฌๅผใƒ‰ใ‚ญใƒฅใƒกใƒณใƒˆใ‚’ใ”ๅ‚็…งใใ ใ•ใ„ใ€‚

Version
gpt-5.1-codex
gpt-5.1-codex-max