• bitcoinBitcoin(BTC)$80,052.00-0.97%
  • ethereumEthereum(ETH)$2,321.64-1.81%
  • tetherTether(USDT)$1.000.02%
  • binancecoinBNB(BNB)$741.63-0.67%
  • rippleXRP(XRP)$1.29-1.68%
  • usd-coinUSDC(USDC)$1.000.02%
  • solanaSolana(SOL)$101.31-1.10%
  • tronTRON(TRX)$0.3301510.48%
  • Figure HelocFigure Heloc(FIGR_HELOC)$1.06-0.69%
  • zcashZcash(ZEC)$1,205.77-0.62%
  • HyperliquidHyperliquid(HYPE)$76.04-0.79%
  • dogecoinDogecoin(DOGE)$0.077098-0.72%
  • moneroMonero(XMR)$591.82-3.02%
  • USDSUSDS(USDS)$1.00-0.01%
  • whitebitWhiteBIT Coin(WBT)$77.07-1.14%
  • chainlinkChainlink(LINK)$11.45-0.81%
  • leo-tokenLEO Token(LEO)$9.01-0.32%
  • cardanoCardano(ADA)$0.204434-1.53%
  • stellarStellar(XLM)$0.168754-1.72%
  • RainRain(RAIN)$0.0083622.04%
  • nearNEAR Protocol(NEAR)$4.510.70%
  • bitcoin-cashBitcoin Cash(BCH)$283.702.49%
  • Ethena USDeEthena USDe(USDE)$1.000.00%
  • daiDai(DAI)$1.000.03%
  • litecoinLitecoin(LTC)$56.74-0.24%
  • uniswapUniswap(UNI)$6.931.59%
  • CantonCanton(CC)$0.1017090.95%
  • avalanche-2Avalanche(AVAX)$8.92-0.31%
  • USD1USD1(USD1)$1.00-0.01%
  • suiSui(SUI)$0.92-1.39%
  • the-open-networkGram (prev. Toncoin)(GRAM)$1.24-0.63%
  • hedera-hashgraphHedera(HBAR)$0.077221-0.66%
  • tether-goldTether Gold(XAUT)$4,014.770.55%
  • Global DollarGlobal Dollar(USDG)$1.000.00%
  • paypal-usdPayPal USD(PYUSD)$1.00-0.01%
  • shiba-inuShiba Inu(SHIB)$0.000005-1.18%
  • BittensorBittensor(TAO)$251.380.10%
  • quant-networkQuant(QNT)$192.295.01%
  • EthenaEthena(ENA)$0.2073056.70%
  • crypto-com-chainCronos(CRO)$0.054165-1.78%
  • BitwayBitway(BTW)$1.65-4.74%
  • Ripple USDRipple USD(RLUSD)$1.000.00%
  • Circle USYCCircle USYC(USYC)$1.140.00%
  • Ondo US Dollar YieldOndo US Dollar Yield(USDY)$1.15-0.02%
  • okbOKB(OKB)$108.12-0.01%
  • MemeCoreMemeCore(M)$0.976.98%
  • BlackRock USD Institutional Digital Liquidity FundBlackRock USD Institutional Digital Liquidity Fund(BUIDL)$1.000.00%
  • aaveAave(AAVE)$135.68-1.24%
  • OndoOndo(ONDO)$0.407768-0.28%
  • Pump.funPump.fun(PUMP)$0.004207-1.88%
TradePoint.io
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop
No Result
View All Result
TradePoint.io
No Result
View All Result

A Developer’s Guide to OpenAI’s GPT-5 Model Capabilities

August 8, 2025
in AI & Technology
Reading Time: 7 mins read
A A
A Developer’s Guide to OpenAI’s GPT-5 Model Capabilities
ShareShareShareShareShare

In this tutorial, we’ll explore the new capabilities introduced in OpenAI’s latest model, GPT-5. The update brings several powerful features, including the Verbosity parameter, Free-form Function Calling, Context-Free Grammar (CFG), and Minimal Reasoning. We’ll look at what they do and how to use them in practice. Check out the Full Codes here.

Installing the libraries

!pip install pandas openai

To get an OpenAI API key, visit https://platform.openai.com/settings/organization/api-keys and generate a new key. If you’re a new user, you may need to add billing details and make a minimum payment of $5 to activate API access. Check out the Full Codes here.

YOU MAY ALSO LIKE

Which Screenless Fitness Tracker Is Better For You?

Can You Run Regular Ethernet Cables Outside?

import os
from getpass import getpass
os.environ['OPENAI_API_KEY'] = getpass('Enter OpenAI API Key: ')

Verbosity Parameter

The Verbosity parameter lets you control how detailed the model’s replies are without changing your prompt.

  • low → Short and concise, minimal extra text.
  • medium (default) → Balanced detail and clarity.
  • high → Very detailed, ideal for explanations, audits, or teaching. Check out the Full Codes here.
from openai import OpenAI
import pandas as pd
from IPython.display import display

client = OpenAI()

question = "Write a poem about a detective and his first solve"

data = []

for verbosity in ["low", "medium", "high"]:
    response = client.responses.create(
        model="gpt-5-mini",
        input=question,
        text={"verbosity": verbosity}
    )

    # Extract text
    output_text = ""
    for item in response.output:
        if hasattr(item, "content"):
            for content in item.content:
                if hasattr(content, "text"):
                    output_text += content.text

    usage = response.usage
    data.append({
        "Verbosity": verbosity,
        "Sample Output": output_text,
        "Output Tokens": usage.output_tokens
    })
# Create DataFrame
df = pd.DataFrame(data)

# Display nicely with centered headers
pd.set_option('display.max_colwidth', None)
styled_df = df.style.set_table_styles(
    [
        {'selector': 'th', 'props': [('text-align', 'center')]},  # Center column headers
        {'selector': 'td', 'props': [('text-align', 'left')]}     # Left-align table cells
    ]
)

display(styled_df)

The output tokens scale roughly linearly with verbosity: low (731) → medium (1017) → high (1263).

Free-Form Function Calling

Free-form function calling lets GPT-5 send raw text payloads—like Python scripts, SQL queries, or shell commands—directly to your tool, without the JSON formatting used in GPT-4. Check out the Full Codes here.

This makes it easier to connect GPT-5 to external runtimes such as:

  • Code sandboxes (Python, C++, Java, etc.)
  • SQL databases (outputs raw SQL directly)
  • Shell environments (outputs ready-to-run Bash)
  • Config generators
from openai import OpenAI

client = OpenAI()

response = client.responses.create(
    model="gpt-5-mini",
    input="Please use the code_exec tool to calculate the cube of the number of vowels in the word 'pineapple'",
    text={"format": {"type": "text"}},
    tools=[
        {
            "type": "custom",
            "name": "code_exec",
            "description": "Executes arbitrary python code",
        }
    ]
)
print(response.output[1].input)

This output shows GPT-5 generating raw Python code that counts the vowels in the word pineapple, calculates the cube of that count, and prints both values. Instead of returning a structured JSON object (like GPT-4 typically would for tool calls), GPT-5 delivers plain executable code. This makes it possible to feed the result directly into a Python runtime without extra parsing.

Context-Free Grammar (CFG)

A Context-Free Grammar (CFG) is a set of production rules that define valid strings in a language. Each rule rewrites a non-terminal symbol into terminals and/or other non-terminals, without depending on the surrounding context.

CFGs are useful when you want to strictly constrain the model’s output so it always follows the syntax of a programming language, data format, or other structured text — for example, ensuring generated SQL, JSON, or code is always syntactically correct.

For comparison, we’ll run the same script using GPT-4 and GPT-5 with an identical CFG to see how both models adhere to the grammar rules and how their outputs differ in accuracy and speed. Check out the Full Codes here.

from openai import OpenAI
import re

client = OpenAI()

email_regex = r"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$"

prompt = "Give me a valid email address for John Doe. It can be a dummy email"

# No grammar constraints -- model might give prose or invalid format
response = client.responses.create(
    model="gpt-4o",  # or earlier
    input=prompt
)

output = response.output_text.strip()
print("GPT Output:", output)
print("Valid?", bool(re.match(email_regex, output)))
from openai import OpenAI

client = OpenAI()

email_regex = r"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$"

prompt = "Give me a valid email address for John Doe. It can be a dummy email"

response = client.responses.create(
    model="gpt-5",  # grammar-constrained model
    input=prompt,
    text={"format": {"type": "text"}},
    tools=[
        {
            "type": "custom",
            "name": "email_grammar",
            "description": "Outputs a valid email address.",
            "format": {
                "type": "grammar",
                "syntax": "regex",
                "definition": email_regex
            }
        }
    ],
    parallel_tool_calls=False
)

print("GPT-5 Output:", response.output[1].input)

This example shows how GPT-5 can adhere more closely to a specified format when using a Context-Free Grammar.

With the same grammar rules, GPT-4 produced extra text around the email address (“Sure, here’s a test email you can use for John Doe: [email protected]”), which makes it invalid according to the strict format requirement.

GPT-5, however, output exactly [email protected], matching the grammar and passing validation. This demonstrates GPT-5’s improved ability to follow CFG constraints precisely. Check out the Full Codes here.

Minimal Reasoning

Minimal reasoning mode runs GPT-5 with very few or no reasoning tokens, reducing latency and delivering a faster time-to-first-token.

It’s ideal for deterministic, lightweight tasks such as:

  • Data extraction
  • Formatting
  • Short rewrites
  • Simple classification

Because the model skips most intermediate reasoning steps, responses are quick and concise. If not specified, the reasoning effort defaults to medium. Check out the Full Codes here.

import time
from openai import OpenAI

client = OpenAI()

prompt = "Classify the given number as odd or even. Return one word only."

start_time = time.time()  # Start timer

response = client.responses.create(
    model="gpt-5",
    input=[
        { "role": "developer", "content": prompt },
        { "role": "user", "content": "57" }
    ],
    reasoning={
        "effort": "minimal"  # Faster time-to-first-token
    },
)

latency = time.time() - start_time  # End timer

# Extract model's text output
output_text = ""
for item in response.output:
    if hasattr(item, "content"):
        for content in item.content:
            if hasattr(content, "text"):
                output_text += content.text

print("--------------------------------")
print("Output:", output_text)
print(f"Latency: {latency:.3f} seconds")


I am a Civil Engineering Graduate (2022) from Jamia Millia Islamia, New Delhi, and I have a keen interest in Data Science, especially Neural Networks and their application in various areas.

Credit: Source link

ShareTweetSendSharePin

Related Posts

Which Screenless Fitness Tracker Is Better For You?
AI & Technology

Which Screenless Fitness Tracker Is Better For You?

October 26, 2026
Can You Run Regular Ethernet Cables Outside?
AI & Technology

Can You Run Regular Ethernet Cables Outside?

October 26, 2026
Why Google Chrome Is Always Using So Much RAM
AI & Technology

Why Google Chrome Is Always Using So Much RAM

October 25, 2026
Nanbeige Releases Nanbeige4.3-33B, a 33B Open Agentic Coding Model
AI & Technology

Nanbeige Releases Nanbeige4.3-33B, a 33B Open Agentic Coding Model

October 25, 2026
Next Post
Trump Is Removing Billy Long as the I.R.S. Head 2 Months After He Was Confirmed – The New York Times

Trump Is Removing Billy Long as the I.R.S. Head 2 Months After He Was Confirmed - The New York Times

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

No Result
View All Result
Top business leaders sound the alarm over skilled worker shortage

Top business leaders sound the alarm over skilled worker shortage

October 22, 2026
Treasury Proposes Rules to Expand Outbound Tech Investment Curbs – Unite.AI

Treasury Proposes Rules to Expand Outbound Tech Investment Curbs – Unite.AI

October 23, 2026
Block Unveils Dessa, a Full-Duplex Speech Model Trained on Conversation – Unite.AI

Block Unveils Dessa, a Full-Duplex Speech Model Trained on Conversation – Unite.AI

October 23, 2026

About

Learn more

Our Services

Legal

Privacy Policy

Terms of Use

Bloggers

Learn more

Article Links

Contact

Advertise

Ask us anything

©2020- TradePoint.io - All rights reserved!

Tradepoint.io, being just a publishing and technology platform, is not a registered broker-dealer or investment adviser. So we do not provide investment advice. Rather, brokerage services are provided to clients of Tradepoint.io by independent SEC-registered broker-dealers and members of FINRA/SIPC. Every form of investing carries some risk and past performance is not a guarantee of future results. “Tradepoint.io“, “Instant Investing” and “My Trading Tools” are registered trademarks of Apperbuild, LLC.

This website is operated by Apperbuild, LLC. We have no link to any brokerage firm and we do not provide investment advice. Every information and resource we provide is solely for the education of our readers. © 2020 Apperbuild, LLC. All rights reserved.

No Result
View All Result
  • Main
  • AI & Technology
  • Stock Charts
  • Market & News
  • Business
  • Finance Tips
  • Trade Tube
  • Blog
  • Shop

© 2023 - TradePoint.io - All Rights Reserved!