gpt-5.3-codex

circle-info

This documentation is valid for the following list of our models:

  • openai/gpt-5-3-codex

Model Overview

A code-focused large language model designed for advanced code generation, refactoring, and debugging workflows. Optimized for high-accuracy programming tasks and production development environments.

chevron-rightHow to make the first API callhashtag

1️⃣ Required setup (don’t skip this)Create an account: Sign up on the AI/ML API website (if you don’t have one yet). ▪ Generate an API key: In your account dashboard, create an API key and make sure it’s enabled in the UI.

2️ Copy the code example At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.

3️ Update the snippet for your use caseInsert your API key: replace <YOUR_AIMLAPI_KEY> with your real AI/ML API key. ▪ Select a model: set the model field to the model you want to call. ▪ Provide input: fill in the request input field(s) shown in the example (for example, messages for chat/LLM models, or other inputs for image/video/audio models).

4️ (Optional) Tune the request Depending on the model type, you can add optional parameters to control the output (e.g., generation settings, quality, length, etc.). See the API schema below for the full list.

5️ Run your code Run the updated code in your development environment. Response time depends on the model and request size, but simple requests typically return quickly.

circle-check

API Schema

chevron-rightChat Completions vs. Responses APIhashtag

Chat Completions The chat completions API is the older, chat-oriented interface where you send a list of messages (role: user, role: assistant, etc.), and the model returns a single response. It was designed specifically for conversational workflows and follows a structured chat message format. It is now considered a legacy interface.

Responses The Responses API is the newer, unified interface used across OpenAI’s latest models. Instead of focusing only on chat, it supports multiple input types (text, images, audio, tools, etc.) and multiple output modalities (text, JSON, images, audio, video). It is more flexible, more consistent across models, and intended to replace chat completions entirely.

Responses Endpoint

post
Body
modelstring · enumRequiredPossible values:
inputany ofRequired

Text, image, or file inputs to the model, used to generate a response.

stringOptional

A text input to the model, equivalent to a text input with the user role.

or
backgroundbooleanOptional

Whether to run the model response in the background.

Default: false
instructionsstring · nullableOptional

A system (or developer) message inserted into the model's context.

When using along with previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.

max_output_tokensinteger · min: 16Optional

An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.

previous_response_idstring · nullableOptional

The unique ID of the previous response to the model. Use this to create multi-turn conversations.

storeboolean · nullableOptional

Whether to store the generated model response for later retrieval via API.

Default: false
streamboolean · nullableOptional

If set to true, the model response data will be streamed to the client as it is generated using server-sent events.

Default: false
truncationstring · enumOptional

The truncation strategy to use for the model response.

  • auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.
  • disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
Default: disabledPossible values:
tool_choiceany ofOptional

How the model should select which tool (or tools) to use when generating a response.

string · enumOptional

Controls which (if any) tool is called by the model.

none means the model will not call any tool and instead generates a message.

auto means the model can pick between generating a message or calling one or more tools.

required means the model must call one or more tools.

Possible values:
or
or
parallel_tool_callsboolean · nullableOptional

Whether to allow the model to run tool calls in parallel.

Responses
chevron-right
200Success
backgroundboolean · nullableOptional

Whether to run the model response in the background.

Example: false
created_atnumberRequired

Unix timestamp (in seconds) of when this Response was created.

Example: 1762343744
idstringRequired

Unique identifier for this Response.

Example: resp_68963fb142d08197b4d3ae3ad852542c054845c6ea84caa2
instructionsany ofOptional

A system (or developer) message inserted into the model's context.

stringOptional

A text input to the model, equivalent to a text input with the developer role.

or
or
any · nullableOptional
max_output_tokensinteger · nullableOptional

An upper bound for the number of tokens that can be generated for a response, including visible output tokens and reasoning tokens.

modelstringRequired

Model ID used to generate the response.

Example: openai/gpt-5-3-codex
objectstring · enumRequired

The object type of this resource - always set to response.

Example: responsePossible values:
output_textstring · nullableOptional

SDK-only convenience property that contains the aggregated text output from all output_text items in the output array, if any are present. Supported in the Python and JavaScript SDKs.

Example: Hi! How’s your day going?
parallel_tool_callsbooleanRequired

Whether to allow the model to run tool calls in parallel.

Example: false
previous_response_idstring · nullableOptional

The unique ID of the previous response to the model. Use this to create multi-turn conversations.

service_tierstring · nullableOptional

Specifies the processing type used for serving the request.

statusstring · enumOptional

The status of the response generation.

Example: completedPossible values:
temperaturenumber · max: 2 · nullableOptional

What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both.

tool_choiceany ofOptional

How the model should select which tool (or tools) to use when generating a response.

string · enumOptional

Controls which (if any) tool is called by the model.

none means the model will not call any tool and instead generates a message.

auto means the model can pick between generating a message or calling one or more tools.

required means the model must call one or more tools.

Possible values:
or
or
or
any · nullableOptional
top_pnumber · nullableOptional

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.

We generally recommend altering this or temperature but not both.

truncationstring · enum · nullableOptional

The truncation strategy to use for the model response.

  • auto: If the context of this response and previous ones exceeds the model's context window size, the model will truncate the response to fit the context window by dropping input items in the middle of the conversation.
  • disabled (default): If a model response will exceed the context window size for a model, the request will fail with a 400 error.
Possible values:
post
/v1/responses
200Success

Code Example: Using /responses Endpoint

chevron-rightResponsehashtag

Last updated

Was this helpful?