Skip to main content
Core.Today
|
OpenAIMediumHigh

GPT-5.1 Codex

GPT-5.1 variant optimized for agentic coding in Codex-style harnesses. Tuned for long tool-use loops, code editing, and repository-scale tasks, and served via the OpenAI Responses API.

2,322.5/18,580credits
input / output ยท per 1M tokens
Optimized for agentic coding harnesses (Codex-style)
Served via the Responses API - this gateway routes Codex models to /v1/responses, not chat completions
400K context window
Cached input tokens for cost savings on repeated context
Function calling & streaming support

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Model Specifications

Context Window
400K
tokens
Max Output
128K
tokens
Training Cutoff
2025-03
Compatible SDK
OpenAI

Capabilities

Vision
Function Calling
Streaming
JSON Mode
System Prompt

Token Pricing (per 1M tokens)

Token TypeCreditsUSD Equivalent
Input Tokens2,322.5$1.55
Output Tokens18,580$12.39
Cached Tokens232.25$0.15

* 1,500 credits โ‰ˆ $1 (actual charges may vary based on usage)

Quick Start

curl -X POST "https://api.core.today/llm/openai/v1/responses" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "model": "gpt-5.1-codex",
  "input": "Refactor this function to remove the duplicated error handling, and add a unit test:\n\n<code snippet>",
  "max_output_tokens": 4000
}'

Parameters

ParameterTypeRequiredDefaultDescription
modelstringYesgpt-5.1-codexModel identifier
inputstring | arrayYes-Responses API input: a plain string or an array of input items (messages, tool results)
instructionsstringNo-System-level instructions for the run
max_output_tokensintegerNo-Maximum tokens in the response (Responses API field; not max_tokens)
streambooleanNofalseEnable Server-Sent Events streaming

Examples

Agentic Coding Task

Responses API request for a coding task

curl -X POST "https://api.core.today/llm/openai/v1/responses" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer cdt_your_api_key" \
  -d '{
  "model": "gpt-5.1-codex",
  "input": "Refactor this function to remove the duplicated error handling, and add a unit test:\n\n<code snippet>",
  "max_output_tokens": 4000
}'

Tips & Best Practices

1Works with the OpenAI SDK - set base_url to https://ai.api.core.today/llm/openai/v1 and use client.responses.create()
2Codex models are served via the Responses API (POST /llm/openai/v1/responses), not chat completions
3Cached input tokens are billed at a ~10x discount - reuse long repository context across turns
4Best used inside an agentic harness with tool calling rather than one-shot prompts

Use Cases

Coding agents and autonomous dev loops
Large-scale code editing and refactoring
Test generation and bug fixing with tool use
Code review automation