# GPT-5.1 Codex Max - Core.Today AI API > OpenAI's long-horizon agentic coding flagship in the GPT-5.1 Codex family. Supports compaction to keep very long coding sessions within context, and is served via the OpenAI Responses API. - **Provider**: OpenAI - **Model ID**: gpt-5.1-codex-max - **Category**: LLM - **Credits**: 10 per 1K tokens (avg) - **Speed**: Medium - **Quality**: Ultra ## Model Specifications - **Context Window**: 400K tokens - **Max Output**: 128K tokens - **Training Cutoff**: 2025-03 - **Supported Formats**: text, json, markdown - **Compatible SDK**: OpenAI ### Capabilities - Vision (image input) - Function Calling - Streaming - JSON Mode - System Prompt ### Token Pricing (per 1M tokens) - **Input Tokens**: 2,322.5 credits ($1.55) - **Output Tokens**: 18,580 credits ($12.39) - **Cached Tokens**: 232.25 credits ($0.15) ## Features - Long-horizon agentic coding flagship - Compaction support for very long sessions beyond the raw context window - 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 ## Use Cases - Multi-hour autonomous coding sessions - Large refactors spanning many files - Project-scale migrations and upgrades - Complex debugging with long tool-use trajectories ## API Endpoint Base URL: https://api.core.today Endpoint: POST /llm/openai/v1/responses ## Authentication Header: Authorization: Bearer YOUR_API_KEY Note: LLM endpoints use OpenAI-compatible format with Authorization Bearer token. ## Input Parameters ### Required - **model**: string (default: gpt-5.1-codex-max) - Model identifier - **input**: string | array - Responses API input: a plain string or an array of input items (messages, tool results) ### Optional - **instructions**: string - System-level instructions for the run - **max_output_tokens**: integer - Maximum tokens in the response (Responses API field; not max_tokens) - **stream**: boolean (default: false) - Enable Server-Sent Events streaming ## Examples ### Long-Horizon Refactor Responses API request for a large multi-file task ```json { "model": "gpt-5.1-codex-max", "input": "Migrate this codebase's HTTP layer from callbacks to async/await. Work file by file and keep tests green.", "max_output_tokens": 8000 } ``` ## Response Format ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text here" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 100, "completion_tokens": 50, "total_tokens": 150 } } ``` ## Tips - Works with the OpenAI SDK - set base_url to https://ai.api.core.today/llm/openai/v1 and use client.responses.create() - Codex models are served via the Responses API (POST /llm/openai/v1/responses), not chat completions - Compaction lets sessions run far beyond the raw context window - prefer Codex Max for very long agent runs - Same token pricing as GPT-5.1 Codex - choose Max for long-horizon work, not for cost reasons ## Documentation https://platform.openai.com/docs/models