⚡ AI Tip: Editing a file with AI? Hand it the old version as a "prediction"

Most of a refactored file stays the same. OpenAI's Predicted Outputs let you pass the current text in the prediction parameter of Chat Completions, so the model can reuse matching tokens and return the whole file with lower latency.

Example: ask GPT-4.1 to rename username to email in a JS class, and send the original code as {"type": "content", "content": code}.

Watch the fine print:
• Works with GPT-4o, GPT-4o mini and the GPT-4.1 family
• Prediction tokens that don't make it into the answer are still billed as output; check rejected_prediction_tokens in usage
• No function calling, n > 1, logprobs or max_completion_tokens

⭐ Best for small edits to big files.

#AI